Exemple #1
0
        private void BindData()
        {
            UDS.Components.CM cm = new UDS.Components.CM();

            DataSet ds = new DataSet();
            UDS.Components.Staff staff = new UDS.Components.Staff();
            SqlDataReader dr_Staff = staff.GetAllStaffs();
            DataTable dt_Staff = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Staff);
            dt_Staff.TableName = "Staff";
            ds.Tables.Add(dt_Staff);

            SqlDataReader dr_Linkman = cm.GetAllLinkman();
            DataTable dt_Linkman = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Linkman);
            dt_Linkman.TableName = "Linkman";
            ds.Tables.Add(dt_Linkman);

            SqlDataReader dr_client = null;
            dr_client = cm.GetContactedClientBySellmanID(sellmanid,begintime,endtime);
            DataTable dt_client = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_client);
            dt_client.TableName = "Client";
            ds.Tables.Add(dt_client);

            SqlDataReader dr_Fee = cm.GetFeeBySellmanID(sellmanid,begintime,endtime);
            DataTable dt_Fee = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Fee);
            dt_Fee.TableName = "Fee";
            ds.Tables.Add(dt_Fee);

            ds.Relations.Add("ClientAddMan_Staff",ds.Tables["Client"].Columns["AddManID"],ds.Tables["Staff"].Columns["Staff_ID"],false);
            ds.Relations.Add("ClientLinkman_Staff",ds.Tables["Client"].Columns["ChiefLinkmanID"],ds.Tables["Linkman"].Columns["ID"],false);
            ds.Relations.Add("Client_Fee",ds.Tables["Client"].Columns["ID"],ds.Tables["Fee"].Columns["ClientID"],false);

            dgrd_fee.DataSource = dt_client.DefaultView;
            dgrd_fee.DataBind();
        }
Exemple #2
0
        private void BindData()
        {
            UDS.Components.CM cm        = new UDS.Components.CM();
            SqlDataReader     dr_client = null;

            if (type == "all")
            {
                dr_client = cm.GetNewClientBySellman(sellmanid, begintime, endtime);
            }
            else if (type == "3stars")
            {
                dr_client = cm.GetNew3StarClientBySellmanID(sellmanid, begintime, endtime);
            }

            DataSet ds = new DataSet();

            UDS.Components.Staff staff    = new UDS.Components.Staff();
            SqlDataReader        dr_Staff = staff.GetAllStaffs();
            DataTable            dt_Staff = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Staff);

            dt_Staff.TableName = "Staff";
            ds.Tables.Add(dt_Staff);

            DataTable dt_client = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_client);

            dt_client.TableName = "Client";
            ds.Tables.Add(dt_client);

            ds.Relations.Add("ClientAddMan_Staff", ds.Tables["Client"].Columns["AddManID"], ds.Tables["Staff"].Columns["Staff_ID"], false);
            dgrd_sellmanclient.DataSource = dt_client.DefaultView;
            dgrd_sellmanclient.DataBind();
        }
Exemple #3
0
        //��ѡ���
        private void BindGrid(int type)
        {
            UDS.Components.Staff staff = new UDS.Components.Staff();
            UDS.Components.CM cm = new UDS.Components.CM();

            if(type==1)
            {

                SqlDataReader dr_staff = staff.GetAllStaffs();
                DataTable dt_staff = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_staff);
                dt_staff.TableName = "Staff";
                dgrd_List.Visible = true;
                dgrd_Linkman.Visible = false;
                dgrd_List.DataKeyField = "Staff_ID";
                dgrd_List.DataSource = dt_staff.DefaultView;
                dgrd_List.DataBind();
            }
            else if(type==2)
            {
                SqlDataReader dr_linkman = cm.GetLinkmenByClientAddmanID(userid);
                DataTable dt_linkman = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_linkman);
                dt_linkman.TableName = "Linkman";
                dgrd_Linkman.Visible = true;
                dgrd_List.Visible = false;
                dgrd_Linkman.DataKeyField = "ID";
                dgrd_Linkman.DataSource = dt_linkman.DefaultView;
                dgrd_Linkman.DataBind();
            }
        }
        private void Page_Load(object sender, System.EventArgs e)
        {
            if(!Page.IsPostBack)
            {
                UDS.Components.CM cm = new UDS.Components.CM();
                int clientid = Int32.Parse((Request.QueryString["ClientID"]==null)||(Request.QueryString["ClientID"]=="")?"0":Request.QueryString["ClientID"].ToString());
                UDS.Components.ClientInfo client = cm.GetClientAllInfo(clientid);
                ltl_ClientName.Text = client.ClientName;
                ltl_ClientShortName.Text = client.ClientShortName;
                ltl_UpdateTime.Text = client.UpdateTime.ToShortDateString();
                ltl_Birthday.Text = client.Birthday.ToShortDateString();
                ltl_ContactTimes.Text = client.ContactTimes.ToString();
                ltl_SellPhase.Text = client.SellPhase;
                ltl_BargainPrognosis.Text = client.BargainPrognosis;
                ltl_Fee.Text = client.Fee.ToString();

                //��ʾ������Ա
                UDS.Components.Staff staff = new UDS.Components.Staff();
                SqlDataReader dr_staff = staff.GetStaffInfo(client.AddManID);
                while(dr_staff.Read())
                {
                    ltl_AddMan.Text = dr_staff["realname"].ToString();
                }
                dr_staff.Close();
                dr_staff=null;
                ControlClientContactHistory1.MyClientID = clientid;
                ControlClientContactHistory1.BindData();
            }
        }
Exemple #5
0
        protected void btn_Del_Click(object sender, System.EventArgs e)
        {
            string selectedstring = "";

            foreach (DataGridItem dgi in dgd_Client.Items)
            {
                for (int i = 0; i < dgi.Cells[0].Controls.Count; i++)
                {
                    if (dgi.Cells[0].Controls[i].GetType().ToString() == "System.Web.UI.WebControls.CheckBox")
                    {
                        if (((CheckBox)dgi.Cells[0].Controls[i]).Checked == true)
                        {
                            selectedstring += dgd_Client.DataKeys[dgi.ItemIndex].ToString() + ",";
                        }
                    }
                }
            }
            if (selectedstring != "")
            {
                UDS.Components.CM cm = new UDS.Components.CM();
                selectedstring = selectedstring.Substring(0, selectedstring.Length - 1);
                string[] arrselected = selectedstring.Split(',');
                for (int i = 0; i < arrselected.Length; i++)
                {
                    if (arrselected[i].Trim() != "")
                    {
                        cm.DelClient(Int32.Parse(arrselected[i]));
                    }
                }
            }
            BindGrid();
        }
Exemple #6
0
 public void btn_Del_Click(object sender, System.EventArgs e)
 {
     string selectedstring = "";
     foreach(DataGridItem dgi in dgd_Client.Items)
     {
         for(int i=0;i<dgi.Cells[0].Controls.Count;i++)
         {
             if(dgi.Cells[0].Controls[i].GetType().ToString()=="System.Web.UI.WebControls.CheckBox")
             {
                 if(((CheckBox)dgi.Cells[0].Controls[i]).Checked==true)
                 {
                     selectedstring += dgd_Client.DataKeys[dgi.ItemIndex].ToString() + ",";
                 }
             }
         }
     }
     if(selectedstring!="")
     {
         UDS.Components.CM cm = new UDS.Components.CM();
         selectedstring = selectedstring.Substring(0,selectedstring.Length-1);
         string[] arrselected = selectedstring.Split(',');
         for(int i=0;i<arrselected.Length;i++)
         {
             if(arrselected[i].Trim()!="")
             {
                 cm.DelClient(Int32.Parse(arrselected[i]));
             }
         }
     }
     BindGrid();
 }
Exemple #7
0
        private void BindData()
        {
            UDS.Components.CM cm = new UDS.Components.CM();
            SqlDataReader dr_client = null;
            if(type=="all")
            {
                 dr_client = cm.GetNewClientBySellman(sellmanid,begintime,endtime);
            }
            else if(type=="3stars")
            {
                 dr_client = cm.GetNew3StarClientBySellmanID(sellmanid,begintime,endtime);
            }

            DataSet ds = new DataSet();
            UDS.Components.Staff staff = new UDS.Components.Staff();
            SqlDataReader dr_Staff = staff.GetAllStaffs();
            DataTable dt_Staff = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Staff);
            dt_Staff.TableName = "Staff";
            ds.Tables.Add(dt_Staff);

            DataTable dt_client = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_client);
            dt_client.TableName = "Client";
            ds.Tables.Add(dt_client);

            ds.Relations.Add("ClientAddMan_Staff",ds.Tables["Client"].Columns["AddManID"],ds.Tables["Staff"].Columns["Staff_ID"],false);
            dgrd_sellmanclient.DataSource = dt_client.DefaultView;
            dgrd_sellmanclient.DataBind();
        }
        private void Page_Load(object sender, System.EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                UDS.Components.CM cm             = new UDS.Components.CM();
                int clientid                     = Int32.Parse((Request.QueryString["ClientID"] == null) || (Request.QueryString["ClientID"] == "")?"0":Request.QueryString["ClientID"].ToString());
                UDS.Components.ClientInfo client = cm.GetClientAllInfo(clientid);
                ltl_ClientName.Text       = client.ClientName;
                ltl_ClientShortName.Text  = client.ClientShortName;
                ltl_UpdateTime.Text       = client.UpdateTime.ToShortDateString();
                ltl_Birthday.Text         = client.Birthday.ToShortDateString();
                ltl_ContactTimes.Text     = client.ContactTimes.ToString();
                ltl_SellPhase.Text        = client.SellPhase;
                ltl_BargainPrognosis.Text = client.BargainPrognosis;
                ltl_Fee.Text = client.Fee.ToString();


                //显示销售人员
                UDS.Components.Staff staff    = new UDS.Components.Staff();
                SqlDataReader        dr_staff = staff.GetStaffInfo(client.AddManID);
                while (dr_staff.Read())
                {
                    ltl_AddMan.Text = dr_staff["realname"].ToString();
                }
                dr_staff.Close();
                dr_staff = null;
                ControlClientContactHistory1.MyClientID = clientid;
                ControlClientContactHistory1.BindData();
            }
        }
Exemple #9
0
        //绑定选择框
        private void BindGrid(int type)
        {
            UDS.Components.Staff staff = new UDS.Components.Staff();
            UDS.Components.CM    cm    = new UDS.Components.CM();

            if (type == 1)
            {
                SqlDataReader dr_staff = staff.GetAllStaffs();
                DataTable     dt_staff = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_staff);
                dt_staff.TableName     = "Staff";
                dgrd_List.Visible      = true;
                dgrd_Linkman.Visible   = false;
                dgrd_List.DataKeyField = "Staff_ID";
                dgrd_List.DataSource   = dt_staff.DefaultView;
                dgrd_List.DataBind();
            }
            else if (type == 2)
            {
                SqlDataReader dr_linkman = cm.GetLinkmenByClientAddmanID(userid);
                DataTable     dt_linkman = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_linkman);
                dt_linkman.TableName      = "Linkman";
                dgrd_Linkman.Visible      = true;
                dgrd_List.Visible         = false;
                dgrd_Linkman.DataKeyField = "ID";
                dgrd_Linkman.DataSource   = dt_linkman.DefaultView;
                dgrd_Linkman.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();
        }
Exemple #11
0
 private void btn_Del_Click(object sender, System.EventArgs e)
 {
     UDS.Components.CM      cm      = new UDS.Components.CM();
     UDS.Components.Linkman linkman = new UDS.Components.Linkman();
     linkman.ID = linkmanid;
     if (cm.DelLinkman(linkman))
     {
         Response.Write("<script>if(opener!=null) opener.location.href=opener.location.href;alert('删除成功!');window.close();</script>");
     }
 }
Exemple #12
0
        private void BindData()
        {
            begintime = DateTime.Parse(tbx_begintime.Text);
            endtime   = DateTime.Parse(tbx_endtime.Text);

            UDS.Components.CM    cm    = new UDS.Components.CM();
            UDS.Components.Staff staff = new UDS.Components.Staff();
            DataSet ds = new DataSet();

            SqlDataReader dr_realname = staff.GetAllStaffs();
            DataTable     dt_realname = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_realname);

            dt_realname.TableName = "Realname";
            ds.Tables.Add(dt_realname);

            SqlDataReader dr_sellman = cm.GetSellman(begintime, endtime);
            DataTable     dt_sellman = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_sellman);

            dt_sellman.TableName = "Sellman";
            ds.Tables.Add(dt_sellman);

            SqlDataReader dr_contact = cm.GetContactInfo(begintime, endtime);
            DataTable     dt_contact = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_contact);

            dt_contact.TableName = "Contact";
            ds.Tables.Add(dt_contact);

            SqlDataReader dr_callincontact = cm.GetCallinContactInfo(begintime, endtime);
            DataTable     dt_callincontact = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_callincontact);

            dt_callincontact.TableName = "CallinContact";
            ds.Tables.Add(dt_callincontact);

            SqlDataReader dr_newclient = cm.GetNewClient(begintime, endtime);
            DataTable     dt_newclient = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_newclient);

            dt_newclient.TableName = "NewClient";
            ds.Tables.Add(dt_newclient);

            SqlDataReader dr_new3client = cm.GetNew3StarClient(begintime, endtime);
            DataTable     dt_new3client = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_new3client);

            dt_new3client.TableName = "New3Client";
            ds.Tables.Add(dt_new3client);

            ds.Relations.Add("staffid_realname", ds.Tables["Sellman"].Columns["SellmanID"], ds.Tables["Realname"].Columns["staff_id"], false);
            ds.Relations.Add("sellman_contact", ds.Tables["Sellman"].Columns["SellmanID"], ds.Tables["Contact"].Columns["MarketmanID"], false);
            ds.Relations.Add("sellman_callincontact", ds.Tables["Sellman"].Columns["SellmanID"], ds.Tables["CallinContact"].Columns["MarketmanID"], false);
            ds.Relations.Add("sellman_newclient", ds.Tables["Sellman"].Columns["SellmanID"], ds.Tables["NewClient"].Columns["AddmanID"], false);
            ds.Relations.Add("sellman_new3client", ds.Tables["Sellman"].Columns["SellmanID"], ds.Tables["New3Client"].Columns["AddmanID"], false);

            dgrd_sellman.DataSource = dt_sellman.DefaultView;
            dgrd_sellman.DataBind();
        }
Exemple #13
0
 private void Page_Load(object sender, System.EventArgs e)
 {
     // 在此处放置用户代码以初始化页面
     if (!Page.IsPostBack)
     {
         UDS.Components.CM cm = new UDS.Components.CM();
         SqlDataReader     dr = cm.GetAllLinkman();
         DataTable         dt = UDS.Components.Tools.ConvertDataReaderToDataTable(dr);
         dgrd_Linkman.DataSource = dt.DefaultView;
         dgrd_Linkman.DataBind();
         ltl_Count.Text = dt.Rows.Count.ToString();
     }
 }
Exemple #14
0
 private void Page_Load(object sender, System.EventArgs e)
 {
     // �ڴ˴������û������Գ�ʼ��ҳ��
     if(!Page.IsPostBack)
     {
         UDS.Components.CM cm = new UDS.Components.CM();
         SqlDataReader dr = cm.GetAllLinkman();
         DataTable dt = UDS.Components.Tools.ConvertDataReaderToDataTable(dr);
         dgrd_Linkman.DataSource = dt.DefaultView;
         dgrd_Linkman.DataBind();
         ltl_Count.Text = dt.Rows.Count.ToString();
     }
 }
        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();
        }
Exemple #16
0
        private void BindData()
        {
            begintime = DateTime.Parse(tbx_begintime.Text);
            endtime  =  DateTime.Parse(tbx_endtime.Text);

            UDS.Components.CM cm = new UDS.Components.CM();
            UDS.Components.Staff staff= new UDS.Components.Staff();
            DataSet ds = new DataSet();

            SqlDataReader dr_realname = staff.GetAllStaffs();
            DataTable dt_realname = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_realname);
            dt_realname.TableName = "Realname";
            ds.Tables.Add(dt_realname);

            SqlDataReader dr_sellman = cm.GetSellman(begintime,endtime);
            DataTable dt_sellman = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_sellman);
            dt_sellman.TableName = "Sellman";
            ds.Tables.Add(dt_sellman);

            SqlDataReader dr_contact = cm.GetContactInfo(begintime,endtime);
            DataTable dt_contact = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_contact);
            dt_contact.TableName = "Contact";
            ds.Tables.Add(dt_contact);

            SqlDataReader dr_callincontact = cm.GetCallinContactInfo(begintime,endtime);
            DataTable dt_callincontact = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_callincontact);
            dt_callincontact.TableName = "CallinContact";
            ds.Tables.Add(dt_callincontact);

            SqlDataReader dr_newclient = cm.GetNewClient(begintime,endtime);
            DataTable dt_newclient = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_newclient);
            dt_newclient.TableName = "NewClient";
            ds.Tables.Add(dt_newclient);

            SqlDataReader dr_new3client = cm.GetNew3StarClient(begintime,endtime);
            DataTable dt_new3client = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_new3client);
            dt_new3client.TableName = "New3Client";
            ds.Tables.Add(dt_new3client);

            ds.Relations.Add("staffid_realname",ds.Tables["Sellman"].Columns["SellmanID"],ds.Tables["Realname"].Columns["staff_id"],false);
            ds.Relations.Add("sellman_contact",ds.Tables["Sellman"].Columns["SellmanID"],ds.Tables["Contact"].Columns["MarketmanID"],false);
            ds.Relations.Add("sellman_callincontact",ds.Tables["Sellman"].Columns["SellmanID"],ds.Tables["CallinContact"].Columns["MarketmanID"],false);
            ds.Relations.Add("sellman_newclient",ds.Tables["Sellman"].Columns["SellmanID"],ds.Tables["NewClient"].Columns["AddmanID"],false);
            ds.Relations.Add("sellman_new3client",ds.Tables["Sellman"].Columns["SellmanID"],ds.Tables["New3Client"].Columns["AddmanID"],false);

            dgrd_sellman.DataSource = dt_sellman.DefaultView;
            dgrd_sellman.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();
        }
Exemple #18
0
        //绑定我的协同客户
        private void BindMycooperatorClient()
        {
            TD2.Attributes["background"] = "../../images/maillistbutton2.gif";
            TD1.Attributes["background"] = "../../images/maillistbutton1.gif";
            pnl_ClientInfo.Visible       = false;
            pnl.Visible = false;

            UDS.Components.CM cm = new  UDS.Components.CM();
            DataSet           ds = new DataSet();

            SqlDataReader dr_Client = cm.GetClientInfoBycooperatorID(Int32.Parse(userid));
            DataTable     dt_Client = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Client);

            dt_Client.TableName = "Client";
            ds.Tables.Add(dt_Client);

            SqlDataReader dr_Contact = cm.GetClientContactInfo(0);
            DataTable     dt_Contact = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Contact);

            dt_Contact.TableName = "Contact";
            ds.Tables.Add(dt_Contact);

            SqlDataReader dr_Linkman = cm.GetAllLinkman();
            DataTable     dt_Linkman = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Linkman);

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

            UDS.Components.Staff staff    = new UDS.Components.Staff();
            SqlDataReader        dr_Staff = staff.GetAllStaffs();
            DataTable            dt_Staff = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Staff);

            dt_Staff.TableName = "Staff";
            ds.Tables.Add(dt_Staff);

            ds.Relations.Add("ClientAddMan_Staff", ds.Tables["Client"].Columns["AddManID"], ds.Tables["Staff"].Columns["Staff_ID"], false);
            ds.Relations.Add("ClientLinkmanID_Linkman", ds.Tables["Client"].Columns["ChiefLinkmanID"], ds.Tables["Linkman"].Columns["ID"], false);


            ds.Tables["Client"].DefaultView.Sort = (string)ViewState["SortField"] + " " + ViewState["SortDirect"];
            dgd_Client.DataSource = ds.Tables["Client"].DefaultView;
            dgd_Client.DataBind();
        }
Exemple #19
0
        private void BindData()
        {
            UDS.Components.CM cm = new UDS.Components.CM();

            DataSet ds = new DataSet();

            UDS.Components.Staff staff    = new UDS.Components.Staff();
            SqlDataReader        dr_Staff = staff.GetAllStaffs();
            DataTable            dt_Staff = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Staff);

            dt_Staff.TableName = "Staff";
            ds.Tables.Add(dt_Staff);

            SqlDataReader dr_Linkman = cm.GetAllLinkman();
            DataTable     dt_Linkman = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Linkman);

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

            SqlDataReader dr_client = null;

            dr_client = cm.GetContactedClientBySellmanID(sellmanid, begintime, endtime);
            DataTable dt_client = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_client);

            dt_client.TableName = "Client";
            ds.Tables.Add(dt_client);

            SqlDataReader dr_Fee = cm.GetFeeBySellmanID(sellmanid, begintime, endtime);
            DataTable     dt_Fee = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Fee);

            dt_Fee.TableName = "Fee";
            ds.Tables.Add(dt_Fee);

            ds.Relations.Add("ClientAddMan_Staff", ds.Tables["Client"].Columns["AddManID"], ds.Tables["Staff"].Columns["Staff_ID"], false);
            ds.Relations.Add("ClientLinkman_Staff", ds.Tables["Client"].Columns["ChiefLinkmanID"], ds.Tables["Linkman"].Columns["ID"], false);
            ds.Relations.Add("Client_Fee", ds.Tables["Client"].Columns["ID"], ds.Tables["Fee"].Columns["ClientID"], false);

            dgrd_fee.DataSource = dt_client.DefaultView;
            dgrd_fee.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();
        }
Exemple #21
0
        //���ҵ�Эͬ�ͻ�
        private void BindMycooperatorClient()
        {
            TD2.Attributes["background"] = "../../images/maillistbutton2.gif";
            TD1.Attributes["background"] = "../../images/maillistbutton1.gif";
            pnl_ClientInfo.Visible = false;
            pnl.Visible = false;

            UDS.Components.CM cm = new  UDS.Components.CM();
            DataSet ds = new DataSet();

            SqlDataReader dr_Client = cm.GetClientInfoBycooperatorID(Int32.Parse(userid));
            DataTable dt_Client = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Client);
            dt_Client.TableName = "Client";
            ds.Tables.Add(dt_Client);

            SqlDataReader dr_Contact = cm.GetClientContactInfo(0);
            DataTable dt_Contact = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Contact);
            dt_Contact.TableName = "Contact";
            ds.Tables.Add(dt_Contact);

            SqlDataReader dr_Linkman = cm.GetAllLinkman();
            DataTable dt_Linkman = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Linkman);
            dt_Linkman.TableName = "Linkman";
            ds.Tables.Add(dt_Linkman);

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

            ds.Relations.Add("ClientAddMan_Staff",ds.Tables["Client"].Columns["AddManID"],ds.Tables["Staff"].Columns["Staff_ID"],false);
            ds.Relations.Add("ClientLinkmanID_Linkman",ds.Tables["Client"].Columns["ChiefLinkmanID"],ds.Tables["Linkman"].Columns["ID"],false);

            ds.Tables["Client"].DefaultView.Sort = (string)ViewState["SortField"] + " " + ViewState["SortDirect"];
            dgd_Client.DataSource = ds.Tables["Client"].DefaultView;
            dgd_Client.DataBind();
        }
Exemple #22
0
        //���ҵĿͻ�
        private void BindGrid()
        {
            TD1.Attributes["background"] = "../../images/maillistbutton2.gif";
            TD2.Attributes["background"] = "../../images/maillistbutton1.gif";

            UDS.Components.CM cm = new  UDS.Components.CM();
            DataSet ds = new DataSet();

            SqlDataReader dr_Client = cm.GetMyClients(Int32.Parse(userid));
            DataTable dt_Client = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Client);
            dt_Client.TableName = "Client";
            ds.Tables.Add(dt_Client);

            SqlDataReader dr_Contact = cm.GetClientContactInfo(0);
            DataTable dt_Contact = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Contact);
            dt_Contact.TableName = "Contact";
            ds.Tables.Add(dt_Contact);

            SqlDataReader dr_Linkman = cm.GetAllLinkman();
            DataTable dt_Linkman = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Linkman);
            dt_Linkman.TableName = "Linkman";
            ds.Tables.Add(dt_Linkman);

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

            ds.Relations.Add("ClientAddMan_Staff",ds.Tables["Client"].Columns["AddManID"],ds.Tables["Staff"].Columns["Staff_ID"],false);
            ds.Relations.Add("ClientLinkmanID_Linkman",ds.Tables["Client"].Columns["ChiefLinkmanID"],ds.Tables["Linkman"].Columns["ID"],false);

            ds.Tables["Client"].DefaultView.Sort = (string)ViewState["SortField"] + " " + ViewState["SortDirect"];
            dgd_Client.DataSource = ds.Tables["Client"].DefaultView;
            dgd_Client.DataBind();

            DateTime monthbegin = DateTime.Now.AddMonths(-1);
            DateTime monthend = new DateTime(DateTime.Now.Year,DateTime.Now.Month,DateTime.DaysInMonth(DateTime.Now.Year,DateTime.Now.Month));

            SqlDataReader dr_ContactTimes = cm.GetContactByStaffIDandTime(Int32.Parse(userid),monthbegin,monthend);
            int contacttimes = 0;
            try
            {
                while (dr_ContactTimes.Read())
                {
                    contacttimes++;
                }
            }
            finally
            {
                dr_ContactTimes.Close();
            }

            if(Session["cm_permission"].ToString() == "administrator")
            {
                pnl.Visible = true;
                pnl_ClientInfo.Visible = true;
            }
            else
            {
                pnl.Visible = false;
                pnl_ClientInfo.Visible = false;
            }
            //���û�пͻ����� ��������� ��ϵ�� �� �Ӵ������ ��ť
            if (dgd_Client.Items.Count==0)
            {
                btn_AddLinkman.Visible = false;
                btn_AddContact.Visible = false;
            }
            else
            {
                btn_AddLinkman.Visible = true;
                btn_AddContact.Visible = true;
            }

            ltl_ClientCount.Text = dt_Client.Rows.Count.ToString();
            ltl_ContactTimes.Text = contacttimes.ToString();
        }
Exemple #23
0
        private void btn_OK_Click(object sender, System.EventArgs e)
        {
            UDS.Components.CM      cm      = new UDS.Components.CM();
            UDS.Components.Linkman linkman = new UDS.Components.Linkman();
            linkman.ClientID    = clientid;
            linkman.Address     = tb_Address.Text;
            linkman.Description = tb_Description.Text;
            linkman.Email       = tb_Email.Text;
            linkman.Family      = tb_Family.Text;
            linkman.Gender      = (ddl_Gender.SelectedItem.Value == "1")?true:false;
            linkman.Mobile      = tb_Mobile.Text;
            linkman.Name        = tb_Name.Text;
            linkman.Position    = tb_Position.Text;
            linkman.Telephone   = tb_Telephone.Text;
            linkman.ID          = linkmanid;
            try
            {
                if (linkmanid != 0)              //修改信息
                {
                    if (cb_chief.Checked)
                    {
                        UDS.Components.ClientInfo clientinfo = cm.GetClientAllInfo(clientid);
                        clientinfo.ChiefLinkmanID = linkman.ID;
                        cm.UpdateClient(clientinfo);
                    }
                    else
                    {
                        UDS.Components.ClientInfo clientinfo = cm.GetClientAllInfo(clientid);
                        clientinfo.ChiefLinkmanID = 0;
                        cm.UpdateClient(clientinfo);
                    }
                    cm.UpdateLinkman(linkman);
                }
                else                 //添加联系人
                {
                    //如果选择了客户则添加联系人并且修改该客户的主要联系人
                    if (clientid != 0)
                    {
                        linkman.ID = cm.AddLinkman(linkman);
                        if (cb_chief.Checked)
                        {
                            UDS.Components.ClientInfo clientinfo = cm.GetClientAllInfo(clientid);
                            clientinfo.ChiefLinkmanID = linkman.ID;
                            cm.UpdateClient(clientinfo);
                        }

                        Response.Write("<script>if(opener!=null) opener.location.href=opener.location.href;</script>");
                    }
                    else                    //如果没有选择客户则联系人保存为临时状态即id=0
                    {
                        string strlinkmanid = cm.AddLinkman(linkman).ToString();
                        Session["tmplinkmanid"] += strlinkmanid + ",";
                        if (cb_chief.Checked)
                        {
                            Session["tmpchief"] = strlinkmanid;
                        }
                        Response.Write("<script>if(opener!=null) opener.location.href=opener.location.href;</script>");
                    }
                    Response.Write("<script>window.close();</script>");
                }
            }
            catch (Exception ex)
            {
                UDS.Components.Error.Log(ex.Message);
                Server.Transfer("../Error.aspx");
            }
        }
Exemple #24
0
        private void btn_OK_Click(object sender, System.EventArgs e)
        {
            if(lbx_search.Items.Count>0)
            {
                string searchstring = "";
                string tmp = "";
                DateTime begintime = new DateTime();
                DateTime endtime = DateTime.Now;
                foreach(ListItem lt in lbx_search.Items)
                {
                    string [] searcharr = new string[2];
                    searcharr = lt.Value.Split(':');
                    switch(searcharr[0].Trim())
                    {
                        case "������Ա����":
                            UDS.Components.Staff staff = new UDS.Components.Staff();
                            SqlDataReader dr_staffid = staff.GetStaffIDByRealName(searcharr[1]);
                            tmp = "UDS_CM_ClientContact.MarketmanID='";
                            while(dr_staffid.Read())
                            {
                                tmp +=  dr_staffid["staff_id"] + "' or UDS_CM_ClientContact.MarketmanID='";
                            }
                            dr_staffid.Close();
                            if(tmp=="UDS_CM_ContactInfo.MarketmanID='")
                                searchstring = "1=2";
                            else
                            {
                                tmp = tmp.Substring(0,tmp.Length-37);
                                searchstring += "(" + tmp + ") and ";
                            }
                            break;

                        case "�ͻ�����":
                            UDS.Components.CM cm = new UDS.Components.CM();
                            SqlDataReader dr_clientid = cm.GetClientIDByName(searcharr[1]);
                            tmp = "UDS_CM_ClientContact.ClientID='";
                            while(dr_clientid.Read())
                            {
                                tmp +=  dr_clientid["ID"] + "' or UDS_CM_ClientContact.ClientID='";
                            }
                            dr_clientid.Close();
                            if(tmp=="UDS_CM_ClientContact.ClientID='")
                                searchstring = "1=2";
                            else
                            {
                                tmp = tmp.Substring(0,tmp.Length-34);
                                searchstring += "(" + tmp + ") and ";
                            }
                            break;
                        case "�ͻ����":
                            searchstring += "UDS_CM_ClientContact.ClientID=" + searcharr[1] + " and ";
                            break;
                        case "���۽׶�":
                        switch(searcharr[1])
                        {
                            case "����":
                                searchstring += "patindex('%trace%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                                break;
                            case "���":
                                searchstring += "patindex('%boot%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                                break;
                            case "��Ʒ�Ƽ�":
                                searchstring += "patindex('%commend%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                                break;
                            case "������":
                                searchstring += "patindex('%requirement%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                                break;
                            case "�����ύ":
                                searchstring += "patindex('%submit%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                                break;
                            case "����̸��":
                                searchstring += "patindex('%negotiate%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                                break;
                            case "��Ŀʵʩ":
                                searchstring += "patindex('%actualize%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                                break;
                            case "���ٷ���":
                                searchstring += "patindex('%traceservice%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                                break;
                            case "���":
                                searchstring += "patindex('%last%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                                break;
                        }
                            break;
                        case "�ɽ�Ԥ��":
                            searchstring += "UDS_CM_ClientContact.BargainPrognosis='" + searcharr[1] + "' and ";
                            break;
                        case "�ѽ�Ǣ����":
                            searchstring += "UDS_CM_ClientContact.ContactTimes=" + searcharr[1] + " and ";
                            break;
                        case "��Ǣ����ְ��":
                            searchstring += "UDS_CM_Linkman.[Position]='" + searcharr[1] + "' and ";
                            break;
                        case "�״ν�Ǣʱ��":
                            searchstring += "UDS_CM_ClientInfo.FirstContactTime='" + searcharr[1] + "' and ";
                            break;
                        case "���һ�ν�Ǣʱ��":
                            searchstring += "UDS_CM_ClientInfo.ContactTime='" + searcharr[1] + "' and ";
                            break;
                        case "�´�Լ��ʱ��":
                            searchstring += "UDS_CM_ClientInfo.NextContactTime='" + searcharr[1] + "' and ";
                            break;
                        case "����������¼":
                            //�õ�������ʼ��(��һ -- ����)
                            begintime = DateTime.Now;
                        switch((int)DateTime.Now.DayOfWeek)
                        {
                            case 0:
                                begintime = begintime.AddDays(-6);
                                break;
                            default:
                                begintime = begintime.AddDays(1-(int)DateTime.Now.DayOfWeek);
                                break;
                        }
                            searchstring += "(UDS_CM_ClientContact.updatetime between '" + begintime.ToShortDateString() + "' and '" + endtime.ToShortDateString() + "') and ";
                            break;
                        case "����������¼":
                            //�õ�������ʼ��
                            begintime = DateTime.Now;
                            begintime = begintime.AddDays(1-DateTime.Now.Day);
                            searchstring += "(UDS_CM_ClientContact.updatetime between '" + begintime.ToShortDateString() + "' and '" + endtime.ToShortDateString() + "') and ";
                            break;

                    }
                }

                searchstring = "select * from UDS_CM_ClientInfo where ID IN (select UDS_CM_ClientInfo.ID from UDS_CM_ClientContact left join UDS_CM_ClientContact_Linkman ON UDS_CM_ClientContact.ID=UDS_CM_ClientContact_Linkman.ContactID left join UDS_CM_Linkman ON UDS_CM_ClientContact_Linkman.LinkmanID=UDS_CM_ClientContact_Linkman.id,UDS_CM_ClientInfo where UDS_CM_ClientContact.clientid=UDS_CM_ClientInfo.id and " + searchstring;
                if(searchstring.EndsWith("and "))
                {
                    searchstring = searchstring.Substring(0,searchstring.Length-4);
                }
                searchstring += " group by UDS_CM_ClientInfo.ID)";

                DataSet ds = new DataSet();
                UDS.Components.Staff staff1 = new UDS.Components.Staff();
                SqlDataReader dr_Staff = staff1.GetAllStaffs();
                DataTable dt_Staff = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Staff);
                dt_Staff.TableName = "Staff";
                ds.Tables.Add(dt_Staff);

                UDS.Components.Database db = new UDS.Components.Database();
                SqlParameter[] prams = {
                                           db.MakeInParam("@SQL",SqlDbType.NText,5000,searchstring)
                                       };
                SqlDataReader dr = null;
                db.RunProc("sp_RunSql",prams,out dr);
                DataTable dt = UDS.Components.Tools.ConvertDataReaderToDataTable(dr);
                dt.TableName = "Client";
                ds.Tables.Add(dt);

                ltl_Client.Text = dt.Rows.Count.ToString();

                ds.Relations.Add("ClientAddMan_Staff",ds.Tables["Client"].Columns["AddManID"],ds.Tables["Staff"].Columns["Staff_ID"],false);

                dgrd_ContactList.DataSource = dt.DefaultView;
                dgrd_ContactList.DataBind();

            }
        }
Exemple #25
0
        private void btn_OK_Click(object sender, System.EventArgs e)
        {
            UDS.Components.CM cm = new UDS.Components.CM();
            DataSet           ds = new DataSet();

            DateTime begintime = DateTime.Parse(tbx_begintime.Text);
            DateTime endtime   = DateTime.Parse(tbx_endtime.Text);

            SqlDataReader dr_sellman = cm.GetSellman(begintime, endtime);
            DataTable     dt_sellman = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_sellman);

            dt_sellman.TableName = "Sellman";
            ds.Tables.Add(dt_sellman);
            ltl_AddContactSellman.Text = dt_sellman.Rows.Count.ToString();

            SqlDataReader dr_contact = cm.GetContactInfo(begintime, endtime);
            DataTable     dt_contact = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_contact);

            dt_contact.TableName = "Contact";
            ds.Tables.Add(dt_contact);
            ltl_Contact.Text = dt_contact.Rows.Count.ToString();

            SqlDataReader dr_callincontact = cm.GetCallinContactInfo(begintime, endtime);
            DataTable     dt_callincontact = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_callincontact);

            dt_callincontact.TableName = "CallinContact";
            ds.Tables.Add(dt_callincontact);
            ltl_CallinContact.Text = dt_callincontact.Rows.Count.ToString();

            SqlDataReader dr_newclient = cm.GetNewClient(begintime, endtime);
            DataTable     dt_newclient = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_newclient);

            dt_newclient.TableName = "NewClient";
            ds.Tables.Add(dt_newclient);
            ltl_NewClient.Text = dt_newclient.Rows.Count.ToString();

            SqlDataReader dr_neoclient = cm.GetNegotiateClient();
            DataTable     dt_neoclient = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_neoclient);

            dt_neoclient.TableName = "NeoClient";
            ds.Tables.Add(dt_neoclient);
            ltl_NegotiateClient_Total.Text = dt_neoclient.Rows.Count.ToString();

            SqlDataReader dr_neonewclient = cm.GetNewNegotiateClient(begintime, endtime);
            DataTable     dt_neonewclient = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_neonewclient);

            dt_neonewclient.TableName = "NeoNewClient";
            ds.Tables.Add(dt_neonewclient);
            ltl_NegotiateClient_New.Text = dt_neonewclient.Rows.Count.ToString();

            SqlDataReader dr_new3client = cm.GetNew3StarClient(begintime, endtime);
            DataTable     dt_new3client = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_new3client);

            dt_new3client.TableName = "New3Client";
            ds.Tables.Add(dt_new3client);
            ltl_New3Client_New.Text = dt_new3client.Rows.Count.ToString();


            SqlDataReader dr_3client = cm.Get3StarClient();
            DataTable     dt_3client = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_3client);

            dt_3client.TableName = "3Client";
            ds.Tables.Add(dt_3client);
            ltl_New3Client_Total.Text = dt_3client.Rows.Count.ToString();

            int fee      = 0;
            int feetimes = 0;

            foreach (DataRow row in dt_contact.Rows)
            {
                if (row["Fee"].ToString() != "0")
                {
                    fee += Int32.Parse(row["fee"].ToString());
                    feetimes++;
                }
            }
            ltl_Fee.Text      = fee.ToString();
            ltl_FeeTimes.Text = feetimes.ToString();

            SqlDataReader dr_feeclient = cm.GetFeeBySellmanID(0, begintime, endtime);
            DataTable     dt_feeclient = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_feeclient);

            dt_feeclient.TableName = "FeeClient";
            ds.Tables.Add(dt_feeclient);

            ltl_FeeClient.Text = dt_feeclient.Rows.Count.ToString();
            dt_sellman.DefaultView.RowFilter = "Fee>0";
            ltl_FeeSellman.Text = dt_sellman.DefaultView.Count.ToString();
        }
Exemple #26
0
        private void btn_OK_Click(object sender, System.EventArgs e)
        {
            UDS.Components.CM cm = new UDS.Components.CM();
            UDS.Components.Linkman linkman = new UDS.Components.Linkman();
            linkman.ClientID = clientid;
            linkman.Address = tb_Address.Text;
            linkman.Description = tb_Description.Text;
            linkman.Email = tb_Email.Text;
            linkman.Family = tb_Family.Text;
            linkman.Gender = (ddl_Gender.SelectedItem.Value=="1")?true:false;
            linkman.Mobile = tb_Mobile.Text;
            linkman.Name = tb_Name.Text;
            linkman.Position = tb_Position.Text;
            linkman.Telephone = tb_Telephone.Text;
            linkman.ID = linkmanid;
            try
            {
                if(linkmanid!=0) //�޸���Ϣ
                {
                    if(cb_chief.Checked)
                    {
                        UDS.Components.ClientInfo clientinfo = cm.GetClientAllInfo(clientid);
                        clientinfo.ChiefLinkmanID = linkman.ID;
                        cm.UpdateClient(clientinfo);
                    }
                    else
                    {
                        UDS.Components.ClientInfo clientinfo = cm.GetClientAllInfo(clientid);
                        clientinfo.ChiefLinkmanID = 0;
                        cm.UpdateClient(clientinfo);
                    }
                    cm.UpdateLinkman(linkman);
                }
                else //�����ϵ��
                {
                    //���ѡ���˿ͻ��������ϵ�˲����޸ĸÿͻ�����Ҫ��ϵ��
                    if(clientid!=0)
                    {
                        linkman.ID = cm.AddLinkman(linkman);
                        if(cb_chief.Checked)
                        {
                            UDS.Components.ClientInfo clientinfo = cm.GetClientAllInfo(clientid);
                            clientinfo.ChiefLinkmanID = linkman.ID;
                            cm.UpdateClient(clientinfo);
                        }

                        Response.Write("<script>if(opener!=null) opener.location.href=opener.location.href;</script>");
                    }
                    else//���û��ѡ��ͻ�����ϵ�˱���Ϊ��ʱ״̬��id=0
                    {
                        string strlinkmanid = cm.AddLinkman(linkman).ToString();
                        Session["tmplinkmanid"] += strlinkmanid + ",";
                        if(cb_chief.Checked)	Session["tmpchief"] = strlinkmanid;
                        Response.Write("<script>if(opener!=null) opener.location.href=opener.location.href;</script>");
                    }
                    Response.Write("<script>window.close();</script>");
                }

            }
            catch(Exception ex)
            {
                UDS.Components.Error.Log(ex.Message);
                Server.Transfer("../Error.aspx");
            }
        }
Exemple #27
0
        private void BindData(string type)
        {
            begintime = DateTime.Parse(tbx_begintime.Text);
            endtime   = DateTime.Parse(tbx_endtime.Text);

            UDS.Components.CM cm = new UDS.Components.CM();
            DataSet ds = new DataSet();
            UDS.Components.Staff staff = new UDS.Components.Staff();

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

            SqlDataReader dr_client = cm.GetContactedClientBySellmanID(0,begintime,endtime);
            DataTable dt_client = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_client);
            dt_client.TableName = "Client";
            ds.Tables.Add(dt_client);

            ltl_Client.Text = dt_client.Rows.Count.ToString();

            if(type=="client")//���ͻ�����
            {
                dgrd_clientfee.Visible = true;
                dgrd_sellmanfee.Visible = false;

                SqlDataReader dr_contact = cm.GetContactInfo(begintime,endtime);
                DataTable dt_contact = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_contact);
                dt_contact.TableName = "Contact";
                ds.Tables.Add(dt_contact);

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

                ds.Relations.Add("ClientAddMan_Staff",ds.Tables["Client"].Columns["AddManID"],ds.Tables["Staff"].Columns["Staff_ID"],false);
                ds.Relations.Add("ClientLinkman_Staff",ds.Tables["Client"].Columns["ChiefLinkmanID"],ds.Tables["Linkman"].Columns["ID"],false);
                ds.Relations.Add("Client_Contact",ds.Tables["Client"].Columns["ID"],ds.Tables["Contact"].Columns["ClientID"],false);

                dgrd_clientfee.DataSource = dt_client.DefaultView;
                dgrd_clientfee.DataBind();

                ltl_Fee.Text = totalfee.ToString();
            }
            else if(type=="sellman")
            {
                dgrd_clientfee.Visible = false;
                dgrd_sellmanfee.Visible = true;

                SqlDataReader dr_sellman = cm.GetSellman(begintime,endtime);
                DataTable dt_sellman = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_sellman);
                dt_sellman.TableName = "Sellman";
                ds.Tables.Add(dt_sellman);

                foreach(DataRow row in dt_sellman.Rows)
                {
                    totalfee += Int32.Parse(row["fee"].ToString());
                }

                ds.Relations.Add("StaffID_RealName",ds.Tables["Sellman"].Columns["Staff_Name"],ds.Tables["Staff"].Columns["Staff_Name"],false);

                dgrd_sellmanfee.DataSource = dt_sellman.DefaultView;
                dgrd_sellmanfee.DataBind();

                ltl_Fee.Text = totalfee.ToString();
            }
        }
Exemple #28
0
        //绑定我的客户
        private void BindGrid()
        {
            TD1.Attributes["background"] = "../../images/maillistbutton2.gif";
            TD2.Attributes["background"] = "../../images/maillistbutton1.gif";

            UDS.Components.CM cm = new  UDS.Components.CM();
            DataSet           ds = new DataSet();

            SqlDataReader dr_Client = cm.GetMyClients(Int32.Parse(userid));
            DataTable     dt_Client = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Client);

            dt_Client.TableName = "Client";
            ds.Tables.Add(dt_Client);

            SqlDataReader dr_Contact = cm.GetClientContactInfo(0);
            DataTable     dt_Contact = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Contact);

            dt_Contact.TableName = "Contact";
            ds.Tables.Add(dt_Contact);

            SqlDataReader dr_Linkman = cm.GetAllLinkman();
            DataTable     dt_Linkman = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Linkman);

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

            UDS.Components.Staff staff    = new UDS.Components.Staff();
            SqlDataReader        dr_Staff = staff.GetAllStaffs();
            DataTable            dt_Staff = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Staff);

            dt_Staff.TableName = "Staff";
            ds.Tables.Add(dt_Staff);

            ds.Relations.Add("ClientAddMan_Staff", ds.Tables["Client"].Columns["AddManID"], ds.Tables["Staff"].Columns["Staff_ID"], false);
            ds.Relations.Add("ClientLinkmanID_Linkman", ds.Tables["Client"].Columns["ChiefLinkmanID"], ds.Tables["Linkman"].Columns["ID"], false);


            ds.Tables["Client"].DefaultView.Sort = (string)ViewState["SortField"] + " " + ViewState["SortDirect"];
            dgd_Client.DataSource = ds.Tables["Client"].DefaultView;
            dgd_Client.DataBind();

            DateTime monthbegin = DateTime.Now.AddMonths(-1);
            DateTime monthend   = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month));

            SqlDataReader dr_ContactTimes = cm.GetContactByStaffIDandTime(Int32.Parse(userid), monthbegin, monthend);
            int           contacttimes    = 0;

            while (dr_ContactTimes.Read())
            {
                contacttimes++;
            }
            dr_ContactTimes.Close();

            if (Session["cm_permission"].ToString() == "administrator")
            {
                pnl.Visible            = true;
                pnl_ClientInfo.Visible = true;
            }
            else
            {
                pnl.Visible            = false;
                pnl_ClientInfo.Visible = false;
            }
            //如果没有客户,则 不出现添加 联系人 和 接触情况的 按钮
            if (dgd_Client.Items.Count == 0)
            {
                btn_AddLinkman.Visible = false;
                btn_AddContact.Visible = false;
            }
            else
            {
                btn_AddLinkman.Visible = true;
                btn_AddContact.Visible = true;
            }

            ltl_ClientCount.Text  = dt_Client.Rows.Count.ToString();
            ltl_ContactTimes.Text = contacttimes.ToString();
        }
Exemple #29
0
        private void BindData(string type)
        {
            begintime = DateTime.Parse(tbx_begintime.Text);
            endtime   = DateTime.Parse(tbx_endtime.Text);

            UDS.Components.CM cm = new UDS.Components.CM();
            DataSet           ds = new DataSet();

            UDS.Components.Staff staff = new UDS.Components.Staff();

            SqlDataReader dr_staff = staff.GetAllStaffs();
            DataTable     dt_staff = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_staff);

            dt_staff.TableName = "Staff";
            ds.Tables.Add(dt_staff);

            SqlDataReader dr_client = cm.GetContactedClientBySellmanID(0, begintime, endtime);
            DataTable     dt_client = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_client);

            dt_client.TableName = "Client";
            ds.Tables.Add(dt_client);

            ltl_Client.Text = dt_client.Rows.Count.ToString();

            if (type == "client")         //按客户排列
            {
                dgrd_clientfee.Visible  = true;
                dgrd_sellmanfee.Visible = false;

                SqlDataReader dr_contact = cm.GetContactInfo(begintime, endtime);
                DataTable     dt_contact = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_contact);
                dt_contact.TableName = "Contact";
                ds.Tables.Add(dt_contact);

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

                ds.Relations.Add("ClientAddMan_Staff", ds.Tables["Client"].Columns["AddManID"], ds.Tables["Staff"].Columns["Staff_ID"], false);
                ds.Relations.Add("ClientLinkman_Staff", ds.Tables["Client"].Columns["ChiefLinkmanID"], ds.Tables["Linkman"].Columns["ID"], false);
                ds.Relations.Add("Client_Contact", ds.Tables["Client"].Columns["ID"], ds.Tables["Contact"].Columns["ClientID"], false);

                dgrd_clientfee.DataSource = dt_client.DefaultView;
                dgrd_clientfee.DataBind();

                ltl_Fee.Text = totalfee.ToString();
            }
            else if (type == "sellman")
            {
                dgrd_clientfee.Visible  = false;
                dgrd_sellmanfee.Visible = true;

                SqlDataReader dr_sellman = cm.GetSellman(begintime, endtime);
                DataTable     dt_sellman = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_sellman);
                dt_sellman.TableName = "Sellman";
                ds.Tables.Add(dt_sellman);

                foreach (DataRow row in dt_sellman.Rows)
                {
                    totalfee += Int32.Parse(row["fee"].ToString());
                }

                ds.Relations.Add("StaffID_RealName", ds.Tables["Sellman"].Columns["Staff_Name"], ds.Tables["Staff"].Columns["Staff_Name"], false);

                dgrd_sellmanfee.DataSource = dt_sellman.DefaultView;
                dgrd_sellmanfee.DataBind();

                ltl_Fee.Text = totalfee.ToString();
            }
        }
Exemple #30
0
 private void btn_Del_Click(object sender, System.EventArgs e)
 {
     UDS.Components.CM cm = new UDS.Components.CM();
     UDS.Components.Linkman linkman = new UDS.Components.Linkman();
     linkman.ID = linkmanid;
     if(cm.DelLinkman(linkman))
     {
         Response.Write("<script>if(opener!=null) opener.location.href=opener.location.href;alert('ɾ���ɹ�!');window.close();</script>");
     }
 }
Exemple #31
0
        private void btn_OK_Click(object sender, System.EventArgs e)
        {
            if (lbx_search.Items.Count > 0)
            {
                string   searchstring = "";
                string   tmp          = "";
                DateTime begintime    = new DateTime();
                DateTime endtime      = DateTime.Now;
                foreach (ListItem lt in lbx_search.Items)
                {
                    string [] searcharr = new string[2];
                    searcharr = lt.Value.Split(':');
                    switch (searcharr[0].Trim())
                    {
                    case "销售人员姓名":
                        UDS.Components.Staff staff      = new UDS.Components.Staff();
                        SqlDataReader        dr_staffid = staff.GetStaffIDByRealName(searcharr[1]);
                        tmp = "UDS_CM_ClientContact.MarketmanID='";
                        while (dr_staffid.Read())
                        {
                            tmp += dr_staffid["staff_id"] + "' or UDS_CM_ClientContact.MarketmanID='";
                        }
                        dr_staffid.Close();
                        if (tmp == "UDS_CM_ContactInfo.MarketmanID='")
                        {
                            searchstring = "1=2";
                        }
                        else
                        {
                            tmp           = tmp.Substring(0, tmp.Length - 37);
                            searchstring += "(" + tmp + ") and ";
                        }
                        break;

                    case "客户名称":
                        UDS.Components.CM cm          = new UDS.Components.CM();
                        SqlDataReader     dr_clientid = cm.GetClientIDByName(searcharr[1]);
                        tmp = "UDS_CM_ClientContact.ClientID='";
                        while (dr_clientid.Read())
                        {
                            tmp += dr_clientid["ID"] + "' or UDS_CM_ClientContact.ClientID='";
                        }
                        dr_clientid.Close();
                        if (tmp == "UDS_CM_ClientContact.ClientID='")
                        {
                            searchstring = "1=2";
                        }
                        else
                        {
                            tmp           = tmp.Substring(0, tmp.Length - 34);
                            searchstring += "(" + tmp + ") and ";
                        }
                        break;

                    case "客户编号":
                        searchstring += "UDS_CM_ClientContact.ClientID=" + searcharr[1] + " and ";
                        break;

                    case "销售阶段":
                        switch (searcharr[1])
                        {
                        case "跟踪":
                            searchstring += "patindex('%trace%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                            break;

                        case "启动":
                            searchstring += "patindex('%boot%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                            break;

                        case "产品推荐":
                            searchstring += "patindex('%commend%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                            break;

                        case "需求定义":
                            searchstring += "patindex('%requirement%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                            break;

                        case "方案提交":
                            searchstring += "patindex('%submit%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                            break;

                        case "商务谈判":
                            searchstring += "patindex('%negotiate%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                            break;

                        case "项目实施":
                            searchstring += "patindex('%actualize%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                            break;

                        case "跟踪服务":
                            searchstring += "patindex('%traceservice%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                            break;

                        case "收尾款":
                            searchstring += "patindex('%last%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                            break;
                        }
                        break;

                    case "成交预估":
                        searchstring += "UDS_CM_ClientContact.BargainPrognosis='" + searcharr[1] + "' and ";
                        break;

                    case "已接洽次数":
                        searchstring += "UDS_CM_ClientContact.ContactTimes=" + searcharr[1] + " and ";
                        break;

                    case "接洽对象职务":
                        searchstring += "UDS_CM_Linkman.[Position]='" + searcharr[1] + "' and ";
                        break;

                    case "首次接洽时间":
                        searchstring += "UDS_CM_ClientInfo.FirstContactTime='" + searcharr[1] + "' and ";
                        break;

                    case "最后一次接洽时间":
                        searchstring += "UDS_CM_ClientInfo.ContactTime='" + searcharr[1] + "' and ";
                        break;

                    case "下次约见时间":
                        searchstring += "UDS_CM_ClientInfo.NextContactTime='" + searcharr[1] + "' and ";
                        break;

                    case "本周新增记录":
                        //得到本周起始日(周一 -- 周日)
                        begintime = DateTime.Now;
                        switch ((int)DateTime.Now.DayOfWeek)
                        {
                        case 0:
                            begintime = begintime.AddDays(-6);
                            break;

                        default:
                            begintime = begintime.AddDays(1 - (int)DateTime.Now.DayOfWeek);
                            break;
                        }
                        searchstring += "(UDS_CM_ClientContact.updatetime between '" + begintime.ToShortDateString() + "' and '" + endtime.ToShortDateString() + "') and ";
                        break;

                    case "本月新增记录":
                        //得到本月起始日
                        begintime     = DateTime.Now;
                        begintime     = begintime.AddDays(1 - DateTime.Now.Day);
                        searchstring += "(UDS_CM_ClientContact.updatetime between '" + begintime.ToShortDateString() + "' and '" + endtime.ToShortDateString() + "') and ";
                        break;
                    }
                }

                searchstring = "select * from UDS_CM_ClientInfo where ID IN (select UDS_CM_ClientInfo.ID from UDS_CM_ClientContact left join UDS_CM_ClientContact_Linkman ON UDS_CM_ClientContact.ID=UDS_CM_ClientContact_Linkman.ContactID left join UDS_CM_Linkman ON UDS_CM_ClientContact_Linkman.LinkmanID=UDS_CM_ClientContact_Linkman.id,UDS_CM_ClientInfo where UDS_CM_ClientContact.clientid=UDS_CM_ClientInfo.id and " + searchstring;
                if (searchstring.EndsWith("and "))
                {
                    searchstring = searchstring.Substring(0, searchstring.Length - 4);
                }
                searchstring += " group by UDS_CM_ClientInfo.ID)";

                DataSet ds = new DataSet();
                UDS.Components.Staff staff1   = new UDS.Components.Staff();
                SqlDataReader        dr_Staff = staff1.GetAllStaffs();
                DataTable            dt_Staff = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Staff);
                dt_Staff.TableName = "Staff";
                ds.Tables.Add(dt_Staff);

                UDS.Components.Database db    = new UDS.Components.Database();
                SqlParameter[]          prams =
                {
                    db.MakeInParam("@SQL", SqlDbType.NText, 5000, searchstring)
                };
                SqlDataReader dr = null;
                db.RunProc("sp_RunSql", prams, out dr);
                DataTable dt = UDS.Components.Tools.ConvertDataReaderToDataTable(dr);
                dt.TableName = "Client";
                ds.Tables.Add(dt);

                ltl_Client.Text = dt.Rows.Count.ToString();

                ds.Relations.Add("ClientAddMan_Staff", ds.Tables["Client"].Columns["AddManID"], ds.Tables["Staff"].Columns["Staff_ID"], false);

                dgrd_ContactList.DataSource = dt.DefaultView;
                dgrd_ContactList.DataBind();
            }
        }
Exemple #32
0
        private void BindData(string type)
        {
            UDS.Components.CM cm = new UDS.Components.CM();
            DataSet           ds = new DataSet();

            switch (type)
            {
            case "ac":
                SqlDataReader dr_contactedclient = cm.GetContactedClientBySellmanID(0, begintime, endtime);
                DataTable     dt_contactedclient = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_contactedclient);
                dt_contactedclient.TableName = "Client";
                ds.Tables.Add(dt_contactedclient);
                break;

            case "cc":
                SqlDataReader dr_contactedcallinclient = cm.GetCallinClientBySellmanID(0, begintime, endtime);
                DataTable     dt_contactedcallinclient = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_contactedcallinclient);
                dt_contactedcallinclient.TableName = "Client";
                ds.Tables.Add(dt_contactedcallinclient);
                break;

            case "nc":
                SqlDataReader dr_newclient = cm.GetCallinClientBySellmanID(0, begintime, endtime);
                DataTable     dt_newclient = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_newclient);
                dt_newclient.TableName = "Client";
                ds.Tables.Add(dt_newclient);
                break;

            case "neoc":
                SqlDataReader dr_neoclient = cm.GetNegotiateClient();
                DataTable     dt_neoclient = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_neoclient);
                dt_neoclient.TableName = "Client";
                ds.Tables.Add(dt_neoclient);
                break;

            case "neonc":
                SqlDataReader dr_neonewclient = cm.GetNewNegotiateClient(begintime, endtime);
                DataTable     dt_neonewclient = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_neonewclient);
                dt_neonewclient.TableName = "Client";
                ds.Tables.Add(dt_neonewclient);
                break;

            case "n3c":
                SqlDataReader dr_new3client = cm.GetNew3StarClient(begintime, endtime);
                DataTable     dt_new3client = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_new3client);
                dt_new3client.TableName = "Client";
                ds.Tables.Add(dt_new3client);
                break;

            case "3c":
                SqlDataReader dr_3client = cm.Get3StarClient();
                DataTable     dt_3client = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_3client);
                dt_3client.TableName = "Client";
                ds.Tables.Add(dt_3client);
                break;
            }

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

            dt_staff.TableName = "Staff";
            ds.Tables.Add(dt_staff);

            ds.Relations.Add("StaffID_Staff", ds.Tables["Client"].Columns["AddmanID"], ds.Tables["Staff"].Columns["Staff_ID"], false);

            ltl_Client.Text = ds.Tables["Client"].Rows.Count.ToString();

            dgrd_Client.DataSource = ds.Tables["Client"].DefaultView;
            dgrd_Client.DataBind();
        }
Exemple #33
0
        private void btn_OK_Click(object sender, System.EventArgs e)
        {
            UDS.Components.CM cm = new UDS.Components.CM();
            DataSet ds = new DataSet();

            DateTime begintime = DateTime.Parse(tbx_begintime.Text);
            DateTime endtime   = DateTime.Parse(tbx_endtime.Text);

            SqlDataReader dr_sellman = cm.GetSellman(begintime,endtime);
            DataTable dt_sellman = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_sellman);
            dt_sellman.TableName = "Sellman";
            ds.Tables.Add(dt_sellman);
            ltl_AddContactSellman.Text = dt_sellman.Rows.Count.ToString();

            SqlDataReader dr_contact = cm.GetContactInfo(begintime,endtime);
            DataTable dt_contact = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_contact);
            dt_contact.TableName = "Contact";
            ds.Tables.Add(dt_contact);
            ltl_Contact.Text = dt_contact.Rows.Count.ToString();

            SqlDataReader dr_callincontact = cm.GetCallinContactInfo(begintime,endtime);
            DataTable dt_callincontact = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_callincontact);
            dt_callincontact.TableName = "CallinContact";
            ds.Tables.Add(dt_callincontact);
            ltl_CallinContact.Text = dt_callincontact.Rows.Count.ToString();

            SqlDataReader dr_newclient = cm.GetNewClient(begintime,endtime);
            DataTable dt_newclient = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_newclient);
            dt_newclient.TableName = "NewClient";
            ds.Tables.Add(dt_newclient);
            ltl_NewClient.Text = dt_newclient.Rows.Count.ToString();

            SqlDataReader dr_neoclient = cm.GetNegotiateClient();
            DataTable dt_neoclient = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_neoclient);
            dt_neoclient.TableName = "NeoClient";
            ds.Tables.Add(dt_neoclient);
            ltl_NegotiateClient_Total.Text = dt_neoclient.Rows.Count.ToString();

            SqlDataReader dr_neonewclient = cm.GetNewNegotiateClient(begintime,endtime);
            DataTable dt_neonewclient = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_neonewclient);
            dt_neonewclient.TableName = "NeoNewClient";
            ds.Tables.Add(dt_neonewclient);
            ltl_NegotiateClient_New.Text = dt_neonewclient.Rows.Count.ToString();

            SqlDataReader dr_new3client = cm.GetNew3StarClient(begintime,endtime);
            DataTable dt_new3client = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_new3client);
            dt_new3client.TableName = "New3Client";
            ds.Tables.Add(dt_new3client);
            ltl_New3Client_New.Text = dt_new3client.Rows.Count.ToString();

            SqlDataReader dr_3client = cm.Get3StarClient();
            DataTable dt_3client = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_3client);
            dt_3client.TableName = "3Client";
            ds.Tables.Add(dt_3client);
            ltl_New3Client_Total.Text = dt_3client.Rows.Count.ToString();

            int fee = 0;
            int feetimes = 0;
            foreach(DataRow row in dt_contact.Rows)
            {
                if(row["Fee"].ToString()!="0")
                {
                    fee += Int32.Parse(row["fee"].ToString());
                    feetimes++;
                }
            }
            ltl_Fee.Text = fee.ToString();
            ltl_FeeTimes.Text = feetimes.ToString();

            SqlDataReader dr_feeclient = cm.GetFeeBySellmanID(0,begintime,endtime);
            DataTable dt_feeclient = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_feeclient);
            dt_feeclient.TableName = "FeeClient";
            ds.Tables.Add(dt_feeclient);

            ltl_FeeClient.Text = dt_feeclient.Rows.Count.ToString();
            dt_sellman.DefaultView.RowFilter = "Fee>0";
            ltl_FeeSellman.Text = dt_sellman.DefaultView.Count.ToString();
        }
Exemple #34
0
        private void BindData()
        {
            UDS.Components.CM         cm      = new UDS.Components.CM();
            UDS.Components.ClientInfo client  = new UDS.Components.ClientInfo();
            UDS.Components.Linkman    linkman = new UDS.Components.Linkman();

            if (linkmanid != 0)
            {
                linkman  = cm.GetLinkmanStructByID(linkmanid.ToString());
                clientid = linkman.ClientID;
            }
            else
            {
            }

            SqlDataReader dr = null;

            //dr = cm.GetClientInfo(clientid);
            dr     = cm.GetMyClients(Int32.Parse(Request.Cookies["UserID"].Value));
            client = cm.GetClientAllInfo(clientid);
            //绑定客户下拉列表
            ddl_ClientName.DataSource     = dr;
            ddl_ClientName.DataTextField  = "Name";
            ddl_ClientName.DataValueField = "id";
            ddl_ClientName.DataBind();

            dr.Close();
            if ((clientid == 0) && (from) != "ClientList")
            {
                ddl_ClientName.Items.Insert(0, new ListItem("当前客户", "0"));
            }
            else
            {
                //使传入的clientid处于选中状态
                foreach (ListItem lt in ddl_ClientName.Items)
                {
                    if (lt.Value == clientid.ToString())
                    {
                        lt.Selected = true;
                    }
                }
            }


            dr.Close();
            if (linkmanid == client.ChiefLinkmanID)
            {
                cb_chief.Checked = true;
            }
            //填充联系人信息
            dr = cm.GetLinkmanByID(linkmanid.ToString());
            while (dr.Read())
            {
                tb_Name.Text      = dr["Name"].ToString();
                tb_Mobile.Text    = dr["Mobile"].ToString();
                tb_Telephone.Text = dr["Telephone"].ToString();
                tb_Position.Text  = dr["Position"].ToString();
                tb_Email.Text     = dr["Email"].ToString();
                //填充性别
                if (Convert.ToBoolean(dr["gender"]) == true)
                {
                    ddl_Gender.Items[0].Selected = true;
                    ddl_Gender.Items[1].Selected = false;
                }
                else
                {
                    ddl_Gender.Items[0].Selected = false;
                    ddl_Gender.Items[1].Selected = true;
                }

                tb_Description.Text = dr["description"].ToString();
                tb_Address.Text     = dr["address"].ToString();
                tb_Family.Text      = dr["family"].ToString();
            }
        }
Exemple #35
0
        private void BindData(string type)
        {
            UDS.Components.CM cm = new UDS.Components.CM();
            DataSet ds = new DataSet();

            switch(type)
            {
                case "ac":
                    SqlDataReader dr_contactedclient = cm.GetContactedClientBySellmanID(0,begintime,endtime);
                    DataTable dt_contactedclient = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_contactedclient);
                    dt_contactedclient.TableName = "Client";
                    ds.Tables.Add(dt_contactedclient);
                    break;
                case "cc":
                    SqlDataReader dr_contactedcallinclient = cm.GetCallinClientBySellmanID(0,begintime,endtime);
                    DataTable dt_contactedcallinclient = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_contactedcallinclient);
                    dt_contactedcallinclient.TableName = "Client";
                    ds.Tables.Add(dt_contactedcallinclient);
                    break;
                case "nc":
                    SqlDataReader dr_newclient = cm.GetCallinClientBySellmanID(0,begintime,endtime);
                    DataTable dt_newclient = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_newclient);
                    dt_newclient.TableName = "Client";
                    ds.Tables.Add(dt_newclient);
                    break;
                case "neoc":
                    SqlDataReader dr_neoclient = cm.GetNegotiateClient();
                    DataTable dt_neoclient = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_neoclient);
                    dt_neoclient.TableName = "Client";
                    ds.Tables.Add(dt_neoclient);
                    break;
                case "neonc":
                    SqlDataReader dr_neonewclient = cm.GetNewNegotiateClient(begintime,endtime);
                    DataTable dt_neonewclient = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_neonewclient);
                    dt_neonewclient.TableName = "Client";
                    ds.Tables.Add(dt_neonewclient);
                    break;
                case "n3c":
                    SqlDataReader dr_new3client = cm.GetNew3StarClient(begintime,endtime);
                    DataTable dt_new3client = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_new3client);
                    dt_new3client.TableName = "Client";
                    ds.Tables.Add(dt_new3client);
                    break;
                case "3c":
                    SqlDataReader dr_3client = cm.Get3StarClient();
                    DataTable dt_3client = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_3client);
                    dt_3client.TableName = "Client";
                    ds.Tables.Add(dt_3client);
                    break;

            }

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

            ds.Relations.Add("StaffID_Staff",ds.Tables["Client"].Columns["AddmanID"],ds.Tables["Staff"].Columns["Staff_ID"],false);

            ltl_Client.Text = ds.Tables["Client"].Rows.Count.ToString();

            dgrd_Client.DataSource = ds.Tables["Client"].DefaultView;
            dgrd_Client.DataBind();
        }
Exemple #36
0
        private void BindData()
        {
            UDS.Components.CM cm = new UDS.Components.CM();
            UDS.Components.ClientInfo client = new UDS.Components.ClientInfo();
            UDS.Components.Linkman linkman = new UDS.Components.Linkman();

            if(linkmanid!=0)
            {
                linkman = cm.GetLinkmanStructByID(linkmanid.ToString());
                clientid = linkman.ClientID;
            }
            else
            {

            }

            SqlDataReader dr = null;
            //dr = cm.GetClientInfo(clientid);
            dr = cm.GetMyClients(Int32.Parse(Request.Cookies["UserID"].Value));
            client = cm.GetClientAllInfo(clientid);
            //�󶨿ͻ������б�
            ddl_ClientName.DataSource = dr;
            ddl_ClientName.DataTextField = "Name";
            ddl_ClientName.DataValueField = "id";
            ddl_ClientName.DataBind();

            dr.Close();
            if((clientid==0)&&(from)!="ClientList")
                ddl_ClientName.Items.Insert(0,new ListItem("��ǰ�ͻ�","0"));
            else
            {
                //ʹ�����clientid����ѡ��״̬
                foreach(ListItem lt in ddl_ClientName.Items)
                {
                    if(lt.Value==clientid.ToString())
                    {
                        lt.Selected = true;
                    }
                }
            }

            dr.Close();
            if(linkmanid==client.ChiefLinkmanID) cb_chief.Checked = true;
            //�����ϵ����Ϣ
            dr = cm.GetLinkmanByID(linkmanid.ToString());
            while(dr.Read())
            {
                tb_Name.Text = dr["Name"].ToString();
                tb_Mobile.Text = dr["Mobile"].ToString();
                tb_Telephone.Text = dr["Telephone"].ToString();
                tb_Position.Text = dr["Position"].ToString();
                tb_Email.Text = dr["Email"].ToString();
                //����Ա�
                if(Convert.ToBoolean(dr["gender"])==true)
                {
                    ddl_Gender.Items[0].Selected = true;
                    ddl_Gender.Items[1].Selected = false;
                }
                else
                {
                    ddl_Gender.Items[0].Selected = false;
                    ddl_Gender.Items[1].Selected = true;
                }

                tb_Description.Text = dr["description"].ToString();
                tb_Address.Text = dr["address"].ToString();
                tb_Family.Text = dr["family"].ToString();

            }
        }