Esempio n. 1
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (comboBox1.SelectedIndex > -1)
     {
         Workplan workplan = new Workplan();
         workplan.ID  = ((Product)comboBox1.SelectedItem).ID;
         workplan.销售  = (selectStaffControl1.SelectedStaffs != null && selectStaffControl1.SelectedStaffs.Count > 0) ? selectStaffControl1.SelectedStaffs[0] : null;
         workplan.日期  = DateTime.Parse(textBox3.Text.Trim());
         workplan.带人数 = (int)numericUpDown1.Value;
         workplan.号码数 = (int)numericUpDown2.Value;
         workplan.成单数 = (int)numericUpDown3.Value;
         workplan.回访数 = (int)numericUpDown4.Value;
         workplan.备注  = textBox6.Text;
         WorkplanLogic rl = WorkplanLogic.GetInstance();
         if (rl.UpdateWorkplan(workplan))
         {
             LoadWorkplans();
             MessageBox.Show("修改成功!");
         }
     }
     else
     {
         MessageBox.Show("先选定要修改的工作计划!");
     }
 }
Esempio n. 2
0
        private DataTable Search(string name, int sex = 0, CardType cardType = null, string cardNo = null, string mobile = null)
        {
            string nm = "";

            if (!string.IsNullOrEmpty(name) && name.Trim() != "")
            {
                nm = " and TF_Member.姓名 like '%" + name + "%'";
            }
            string sx = "";

            if (sex > 0)
            {
                sx = " and TF_Member.性别=" + sex;
            }
            string ct = "";

            if (cardType != null)
            {
                ct = " and TF_Member.卡种=" + cardType.ID;
            }
            string cn = "";

            if (!string.IsNullOrEmpty(cardNo) && cardNo.Trim() != "")
            {
                cn = " and TF_Member.卡号 like '%" + cardNo.Trim() + "%'";
            }
            string mb = "";

            if (!string.IsNullOrEmpty(mobile) && mobile.Trim() != "")
            {
                mb = " and TF_Member.电话 like '%" + mobile.Trim() + "%'";
            }
            string where = nm + sx + ct + cn + mb + " order by TF_Workplan.ID desc";
            return(WorkplanLogic.GetInstance().GetWorkplans(where));
        }
Esempio n. 3
0
        public static WorkplanLogic GetInstance()
        {
            if (instance == null)
            {
                instance = new WorkplanLogic();
            }

            return(instance);
        }
Esempio n. 4
0
        private void LoadWorkplans()
        {
            List <Workplan> elements = WorkplanLogic.GetInstance().GetAllWorkplans();

            comboBox1.Items.Clear();
            foreach (Workplan element in elements)
            {
                comboBox1.Items.Add(element);
            }
        }
Esempio n. 5
0
        private void LoadWorkplans()
        {
            List <Workplan> elements = WorkplanLogic.GetInstance().GetAllWorkplans();

            comboBox1.Items.Clear();
            foreach (Workplan element in elements)
            {
                comboBox1.Items.Add(element);
            }
            dataGridView1.DataSource = WorkplanLogic.GetInstance().GetWorkplans(string.Empty);
        }
Esempio n. 6
0
        private DataTable Search(Staff staff, DateTime start, DateTime end)
        {
            string nm = "";

            if (staff != null)
            {
                nm = " and 销售='" + staff.姓名 + "'";
            }
            string where = "(1=1)" + nm + " and (日期 >= '" + start + "' and 日期 < '" + end.AddDays(1) + "')";
            return(WorkplanLogic.GetInstance().GetWorkplans(where));
        }
Esempio n. 7
0
 private void button3_Click(object sender, EventArgs e)
 {
     if (comboBox1.SelectedIndex > -1)
     {
         if (MessageBox.Show("确定要删除该工作计划?", "删除提醒", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.OK)
         {
             Workplan workplan = (Workplan)comboBox1.SelectedItem;
             if (WorkplanLogic.GetInstance().DeleteWorkplan(workplan))
             {
                 LoadWorkplans();
             }
         }
     }
     else
     {
         MessageBox.Show("先选定要删除的工作计划!");
     }
 }
Esempio n. 8
0
        private void button1_Click(object sender, EventArgs e)
        {
            Workplan workplan = new Workplan();

            workplan.销售  = (selectStaffControl1.SelectedStaffs != null && selectStaffControl1.SelectedStaffs.Count > 0) ? selectStaffControl1.SelectedStaffs[0] : null;
            workplan.日期  = DateTime.Parse(textBox3.Text.Trim());
            workplan.带人数 = (int)numericUpDown1.Value;
            workplan.号码数 = (int)numericUpDown2.Value;
            workplan.成单数 = (int)numericUpDown3.Value;
            workplan.回访数 = (int)numericUpDown4.Value;
            workplan.备注  = textBox6.Text;
            WorkplanLogic rl = WorkplanLogic.GetInstance();
            int           id = rl.AddWorkplan(workplan);

            if (id > 0)
            {
                workplan.ID = id;
                LoadWorkplans();
                MessageBox.Show("添加成功!");
            }
        }