请高手们帮帮忙,小弟急
代码在下载文件中

解决方案 »

  1.   

    //接口代码
    using System;
    using System.Collections.Generic;
    using System.Text;namespace SJ.Search
    {
        public interface ICustomerInfo
        {
            CustomerInfo Customer
            { get;}
        }
    }
      

  2.   

    //Customer类
    using System;
    using System.Collections.Generic;
    using System.Text;namespace SJ.Search
    {
        public class CustomerInfo
        {
            #region CustomerInfo        private int _CustomerId;
            private string _Customer;
            private string _ShortName;
            private string _CustomerCode;
            private int _CustomerTypeId;
            private int _CustomerStepId;
            private int _RelationId;
            private int _SourceId;
            private int _VocationId;
            private int _ScaleId;
            private int _CreditId;
            private int _EvaluateId;
            private int _OperaterId;   
            private int _Father_Customer_Id;
            private string _CreateBeginDate;
            private string _CreateEndDate;
            private string _UpdateBeginDate;
            private string _UpdateEndDate;
            #endregion                #region  CustomerInfo
            public int CustomerId
            {
                set { _CustomerId = value; }
                get { return _CustomerId; }
            }        public string Customer
            {
                set { _Customer = value; }
                get { return _Customer; }
            }        public string CustomerCode
            {
                set { _CustomerCode = value; }
                get { return _CustomerCode; }
            }        public string ShortName
            {
                set { _ShortName = value; }
                get { return _ShortName; }
            }        public int CustomerTypeId
            {
                set { _CustomerTypeId = value; }
                get { return _CustomerTypeId; }
            }        public int CustomerStepId
            {
                set { _CustomerStepId = value; }
                get { return _CustomerStepId; }
            }        public int RelationId
            {
                set { _RelationId = value; }
                get { return _RelationId; }
            }        public int SourceId
            {
                set { _SourceId = value; }
                get { return _SourceId; }
            }        public int VocationId
            {
                set { _VocationId = value; }
                get { return _VocationId; }
            }        public int ScaleId
            {
                set { _ScaleId = value; }
                get { return _ScaleId; }
            }        public int CreditId
            {
                set { _CreditId = value; }
                get { return _CreditId; }
            }        public int EvaluateId
            {
                set { _EvaluateId = value; }
                get { return _EvaluateId; }
            }        public int OperaterId
            {
                set { _OperaterId = value; }
                get { return _OperaterId; }
            }          public int Father_Customer_Id
            {
                set { _Father_Customer_Id = value; }
                get { return _Father_Customer_Id; }        }        public string CreateBeginDate
            {
                set { _CreateBeginDate = value; }
                get { return _CreateBeginDate; }        }        public string CreateEndDate
            {
                set { _CreateEndDate = value; }
                get { return _CreateEndDate; }        }        public string UpdateBeginDate
            {
                set { _UpdateBeginDate = value; }
                get { return _UpdateBeginDate; }        }        public string UpdateEndDate
            {
                set { _UpdateEndDate = value; }
                get { return _UpdateEndDate; }        }        #endregion         
        }
    }
      

  3.   

    //查询代码
    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using SJ.DBUtility;
    using SJ.Search;
    public partial class Search_Customer : System.Web.UI.Page, SJ.Search.ICustomerInfo
    {
        private CustomerInfo _info;    public CustomerInfo info
        {
            get { return _info; }
        }    protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                drpInit();
            }
        }
        protected void drpInit()
        {
            DbFunc.drpBind(drpCustomerType, "CustomerType", "CustomerType", "CustomertypeId");
            DbFunc.drpBind(drpCustomerStep, "CustomerStep", "CustomerStep", "CustomerStepId");
            DbFunc.drpBind(drpAller, "User", "User", "UserId");
        }    public void btnSearch_Click(object sender, EventArgs e)
        {
            _info = new CustomerInfo();        _info.Customer = txtCustomer.Text.ToString();
            _info.CustomerCode = txtCustomerCode.Text.ToString();
            _info.CustomerStepId = Convert.ToInt32(drpCustomerStep.SelectedValue);
            _info.CustomerTypeId = Convert.ToInt32(drpCustomerType.SelectedValue);
            _info.ShortName = txtShortName.Text.ToString();
            _info.CreateBeginDate = txtCreateBeginDate.Text.ToString();
            _info.CreateEndDate = txtCreateEndDate.Text.ToString();
            _info.UpdateBeginDate = txtUpdateBeginDate.Text.ToString();
            _info.UpdateEndDate = txtUpdateEndDate.Text.ToString();        Server.Transfer("../Customer/Customer.aspx", true);    } 
    }
      

  4.   

    interface demo
        {
            //成员
            int Add(int a, int b);
            string Name { get;}
        }    public class test : demo
        {
            public int Add(int a, int b)
            { }        public string Name
            {
                get { }
            }
        }
      

  5.   

    //  你的接口成员应该这样实现
    public CustomerInfo Customer 
            { get  _info;} 
      

  6.   

    //返回结果类
    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using SJ.Search;
    using SJ.ClassBase;
    public partial class Customer_Customer : System.Web.UI.Page
    {
        protected static string strId;    protected SJ.BLL.CustomerInfo bll = new SJ.BLL.CustomerInfo();    //  CustomerInfo search = new CustomerInfo();    public static string strReturn = "";    protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {            Result();            gridBind();            hlkHigh.NavigateUrl = "~/Search/Customer.aspx";
            }
        }
        private void Result()
        {
            CustomerInfo info = new CustomerInfo();        ICustomerInfo infoInterface;        //实现该接口的页面
            if (Context.Handler is ICustomerInfo)
            {
                infoInterface = (ICustomerInfo)Context.Handler;
                info = infoInterface.Customer;
            }        Response.Write(info.Customer.ToString());
        }
        private void gridBind()
        {
            grvTable.DataSource = bll.GetList(" Flag=0");        grvTable.DataBind();
        }
        #region 绑定
        protected void grvTable_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            #region 自动编号列        if (e.Row.RowIndex == -1)
                return;
            int nIndex = grvTable.PageIndex * grvTable.PageSize + e.Row.RowIndex + 1;        e.Row.Cells[0].Text = nIndex.ToString();        #endregion        grvTableBind.bind("Customer", e);    }
        #endregion    #region 删除
        /// <summary>
        /// 标记删除
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void grvTable_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            string ID = grvTable.DataKeys[e.RowIndex].Value.ToString();        bll.FlagDel(ID);        gridBind();
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnDel_Click(object sender, EventArgs e)
        {
            foreach (GridViewRow grw in grvTable.Rows)
            {
                CheckBox chk = (CheckBox)grw.FindControl("chkSelect");
                if (chk.Checked)
                {
                    string strId = grvTable.DataKeys[grw.RowIndex][0].ToString();                bll.FlagDel(strId);
                }
            }
            gridBind();
        }
        #endregion    #region 编辑
        /// <summary>
        /// 编辑
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void grvTable_RowEditing(object sender, GridViewEditEventArgs e)
        {
            strId = grvTable.DataKeys[e.NewEditIndex].Value.ToString();        string strScript;        strScript = "<script>window.showModalDialog('./Edit/EditCustomer.aspx?ID=" + strId + "','','dialogWidth=600px;dialogHeight=400px');</script>";        ClientScript.RegisterStartupScript(this.GetType(), "edit", strScript);    }    #endregion
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            //按ID号查询        CustomerInfo customer = new CustomerInfo();        customer.CustomerId = int.Parse(txtId.Text.ToString());        grvTable.DataSource = bll.dsWhere(customer);        grvTable.DataBind();
        }
    }
      

  7.   

    如果这样实现的话,那_info是哪来的,在接口里没这东东哦