private void Page_Load(object sender, System.EventArgs e)
        {
            // 在此处放置用户代码以初始化页面
            UDS.Components.CM cm = new UDS.Components.CM();
            DataSet           ds = new DataSet();

            if (type == "all")
            {
                SqlDataReader dr_contact = cm.GetContactBySellmanID(sellmanid, begintime, endtime);
                DataTable     dt         = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_contact);
                dt.TableName = "Contact";
                ds.Tables.Add(dt);
            }
            else if (type == "callin")
            {
                SqlDataReader dr_callincontact = cm.GetCallinClientBySellmanID(sellmanid, begintime, endtime);
                DataTable     dt = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_callincontact);
                dt.TableName = "Contact";
                ds.Tables.Add(dt);
            }


            UDS.Components.Staff staff    = new UDS.Components.Staff();
            SqlDataReader        dr_staff = staff.GetAllStaffs();
            DataTable            dt1      = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_staff);

            dt1.TableName = "Staffs";
            ds.Tables.Add(dt1);

            SqlDataReader dr_linkman = cm.GetAllContactLinkman();
            DataTable     dt2        = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_linkman);

            dt2.TableName = "Linkman";
            ds.Tables.Add(dt2);

            SqlDataReader dr_cooperater = cm.GetAllCooperater();
            DataTable     dt3           = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_cooperater);

            dt3.TableName = "Cooperater";
            ds.Tables.Add(dt3);

            SqlDataReader dr_att = cm.GetAttachmentByContactID(0);
            DataTable     dt4    = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_att);

            dt4.TableName = "Attachment";
            ds.Tables.Add(dt4);

            ds.Relations.Add("ContactMarketman_Staffs", ds.Tables["Staffs"].Columns["Staff_ID"], ds.Tables["Contact"].Columns["MarketmanID"]);
            ds.Relations.Add("Contact_Linkman", ds.Tables["Contact"].Columns["ID"], ds.Tables["Linkman"].Columns["ContactID"], false);
            ds.Relations.Add("Contact_Cooperater", ds.Tables["Contact"].Columns["ID"], ds.Tables["Cooperater"].Columns["ContactID"], false);
            ds.Relations.Add("Contact_Attachment", ds.Tables["Contact"].Columns["ID"], ds.Tables["Attachment"].Columns["pertainid"], false);


            rpt_data.DataSource = ds.Tables["Contact"].DefaultView;
            rpt_data.DataBind();
        }
        public void BindData()
        {
            UDS.Components.CM cm = new UDS.Components.CM();
            DataSet           ds = new DataSet();
            SqlDataReader     dr = cm.GetClientContactInfo_thisWeek(MyClientID);
            DataTable         dt = UDS.Components.Tools.ConvertDataReaderToDataTable(dr);

            dt.TableName = "ClientContact";
            ds.Tables.Add(dt);

            UDS.Components.Staff staff    = new UDS.Components.Staff();
            SqlDataReader        dr_staff = staff.GetTotalStaffs();
            DataTable            dt1      = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_staff);

            dt1.TableName = "Staffs";
            ds.Tables.Add(dt1);

            SqlDataReader dr_linkman = cm.GetAllContactLinkman();
            DataTable     dt2        = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_linkman);

            dt2.TableName = "Linkman";
            ds.Tables.Add(dt2);

            SqlDataReader dr_cooperater = cm.GetAllCooperater();
            DataTable     dt3           = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_cooperater);

            dt3.TableName = "Cooperater";
            ds.Tables.Add(dt3);

            SqlDataReader dr_att = cm.GetAttachmentByContactID(0);
            DataTable     dt4    = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_att);

            dt4.TableName = "Attachment";
            ds.Tables.Add(dt4);
            ds.Relations.Add("ContactMarketman_Staffs", ds.Tables["Staffs"].Columns["Staff_ID"], ds.Tables["ClientContact"].Columns["MarketmanID"], false);
            ds.Relations.Add("Contact_Linkman", ds.Tables["ClientContact"].Columns["ID"], ds.Tables["Linkman"].Columns["ContactID"], false);
            ds.Relations.Add("Contact_Cooperater", ds.Tables["ClientContact"].Columns["ID"], ds.Tables["Cooperater"].Columns["ContactID"], false);
            ds.Relations.Add("Contact_Attachment", ds.Tables["ClientContact"].Columns["ID"], ds.Tables["Attachment"].Columns["pertainid"], false);
            //ds.Relations.Add("ContactLinkman_Staffs",ds.Tables["Staffs"].Columns["Staff_ID"],ds.Tables["Linkman"].Columns["LinkmanID"],false);
            //ds.Relations.Add("ContactCooperater_Staffs",ds.Tables["Staffs"].Columns["Staff_ID"],ds.Tables["Cooperater"].Columns["CooperatingmanID"],false);
            rpt_data.DataSource = ds.Tables["ClientContact"].DefaultView;
            rpt_data.DataBind();
        }
        public void BindData()
        {
            UDS.Components.CM cm = new UDS.Components.CM();
            DataSet ds = new DataSet();
            SqlDataReader dr = cm.GetClientContactInfo_thisWeek(MyClientID);
            DataTable dt = UDS.Components.Tools.ConvertDataReaderToDataTable(dr);
            dt.TableName = "ClientContact";
            ds.Tables.Add(dt);

            UDS.Components.Staff staff = new UDS.Components.Staff();
            SqlDataReader dr_staff = staff.GetTotalStaffs();
            DataTable dt1 = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_staff);
            dt1.TableName = "Staffs";
            ds.Tables.Add(dt1);

            SqlDataReader dr_linkman = cm.GetAllContactLinkman();
            DataTable dt2 = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_linkman);
            dt2.TableName = "Linkman";
            ds.Tables.Add(dt2);

            SqlDataReader dr_cooperater = cm.GetAllCooperater();
            DataTable dt3 = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_cooperater);
            dt3.TableName = "Cooperater";
            ds.Tables.Add(dt3);

            SqlDataReader dr_att = cm.GetAttachmentByContactID(0);
            DataTable dt4 = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_att);
            dt4.TableName = "Attachment";
            ds.Tables.Add(dt4);
            ds.Relations.Add("ContactMarketman_Staffs",ds.Tables["Staffs"].Columns["Staff_ID"],ds.Tables["ClientContact"].Columns["MarketmanID"],false);
            ds.Relations.Add("Contact_Linkman",ds.Tables["ClientContact"].Columns["ID"],ds.Tables["Linkman"].Columns["ContactID"],false);
            ds.Relations.Add("Contact_Cooperater",ds.Tables["ClientContact"].Columns["ID"],ds.Tables["Cooperater"].Columns["ContactID"],false);
            ds.Relations.Add("Contact_Attachment",ds.Tables["ClientContact"].Columns["ID"],ds.Tables["Attachment"].Columns["pertainid"],false);
            //ds.Relations.Add("ContactLinkman_Staffs",ds.Tables["Staffs"].Columns["Staff_ID"],ds.Tables["Linkman"].Columns["LinkmanID"],false);
            //ds.Relations.Add("ContactCooperater_Staffs",ds.Tables["Staffs"].Columns["Staff_ID"],ds.Tables["Cooperater"].Columns["CooperatingmanID"],false);
            rpt_data.DataSource = ds.Tables["ClientContact"].DefaultView;
            rpt_data.DataBind();
        }
        private void Page_Load(object sender, System.EventArgs e)
        {
            // �ڴ˴������û������Գ�ʼ��ҳ��
            UDS.Components.CM cm = new UDS.Components.CM();
            DataSet ds = new DataSet();

            if(type=="all")
            {
                SqlDataReader dr_contact = cm.GetContactBySellmanID(sellmanid,begintime,endtime);
                DataTable dt = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_contact);
                dt.TableName = "Contact";
                ds.Tables.Add(dt);
            }
            else if(type=="callin")
            {
                SqlDataReader dr_callincontact = cm.GetCallinClientBySellmanID(sellmanid,begintime,endtime);
                DataTable dt = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_callincontact);
                dt.TableName = "Contact";
                ds.Tables.Add(dt);
            }

            UDS.Components.Staff staff = new UDS.Components.Staff();
            SqlDataReader dr_staff = staff.GetAllStaffs();
            DataTable dt1 = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_staff);
            dt1.TableName = "Staffs";
            ds.Tables.Add(dt1);

            SqlDataReader dr_linkman = cm.GetAllContactLinkman();
            DataTable dt2 = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_linkman);
            dt2.TableName = "Linkman";
            ds.Tables.Add(dt2);

            SqlDataReader dr_cooperater = cm.GetAllCooperater();
            DataTable dt3 = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_cooperater);
            dt3.TableName = "Cooperater";
            ds.Tables.Add(dt3);

            SqlDataReader dr_att = cm.GetAttachmentByContactID(0);
            DataTable dt4 = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_att);
            dt4.TableName = "Attachment";
            ds.Tables.Add(dt4);

            ds.Relations.Add("ContactMarketman_Staffs",ds.Tables["Staffs"].Columns["Staff_ID"],ds.Tables["Contact"].Columns["MarketmanID"]);
            ds.Relations.Add("Contact_Linkman",ds.Tables["Contact"].Columns["ID"],ds.Tables["Linkman"].Columns["ContactID"],false);
            ds.Relations.Add("Contact_Cooperater",ds.Tables["Contact"].Columns["ID"],ds.Tables["Cooperater"].Columns["ContactID"],false);
            ds.Relations.Add("Contact_Attachment",ds.Tables["Contact"].Columns["ID"],ds.Tables["Attachment"].Columns["pertainid"],false);

            rpt_data.DataSource = ds.Tables["Contact"].DefaultView;
            rpt_data.DataBind();
        }