Exemple #1
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();
        }
        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 #3
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 #4
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();
        }