private void LoadFollowupTypes() { List <FollowupType> elements = FollowupTypeLogic.GetInstance().GetAllFollowupTypes(); comboBox1.Items.Clear(); foreach (FollowupType element in elements) { comboBox1.Items.Add(element); } dataGridView1.DataSource = FollowupTypeLogic.GetInstance().GetFollowupTypes(string.Empty); }
private void LoadFollowupTypes() { List <FollowupType> elements = FollowupTypeLogic.GetInstance().GetAllFollowupTypes(); comboBox3.Items.Clear(); comboBox5.Items.Clear(); comboBox5.Items.Add("--不限--"); foreach (FollowupType element in elements) { comboBox3.Items.Add(element); comboBox5.Items.Add(element); } comboBox5.SelectedIndex = 0; }
private DataTable Search(string name = null, int flag = 0) { string nm = ""; if (!string.IsNullOrEmpty(name) && name.Trim() != "") { nm = " and 方式 like '%" + name + "%'"; } string jy = ""; if (flag > 0) { jy = " and Flag=" + flag; } string where = "(1=1)" + nm + jy; return(FollowupTypeLogic.GetInstance().GetFollowupTypes(where)); }
private void button3_Click(object sender, EventArgs e) { if (comboBox1.SelectedIndex > -1) { if (MessageBox.Show("确定要删除该回访方式?", "删除提醒", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.OK) { FollowupType followupType = (FollowupType)comboBox1.SelectedItem; if (FollowupTypeLogic.GetInstance().DeleteFollowupType(followupType)) { LoadFollowupTypes(); } } } else { MessageBox.Show("先选定要删除的回访方式!"); } }
public Followup GetFollowup(int id) { string sql = "select * from TF_Followup where ID=" + id; DataTable dt = sqlHelper.Query(sql); if (dt != null && dt.Rows.Count > 0) { Followup element = new Followup(); element.ID = id; element.Member = MemberLogic.GetInstance().GetMember(Convert.ToInt32(dt.Rows[0]["MemberID"])); element.回访方式 = FollowupTypeLogic.GetInstance().GetFollowupType(Convert.ToInt32(dt.Rows[0]["跟进方式"])); element.跟进结果 = FollowupResultLogic.GetInstance().GetFollowupResult(Convert.ToInt32(dt.Rows[0]["跟进结果"])); element.跟进时间 = Convert.ToDateTime(dt.Rows[0]["跟进时间"]); element.跟进人 = StaffLogic.GetInstance().GetStaff(Convert.ToInt32(dt.Rows[0]["跟进人"])); element.备注 = dt.Rows[0]["备注"].ToString(); return(element); } return(null); }
private void button2_Click(object sender, EventArgs e) { if (comboBox1.SelectedIndex > -1) { FollowupType followupType = (FollowupType)comboBox1.SelectedItem; followupType.方式 = textBox1.Text.Trim(); followupType.备注 = textBox2.Text.Trim(); followupType.Flag = checkBox1.Checked; FollowupTypeLogic al = FollowupTypeLogic.GetInstance(); if (al.ExistsNameOther(followupType.方式, followupType.ID)) { if (MessageBox.Show("系统中已经存在该回访方式,确定还要继续保存么?", "重名提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.OK) { if (al.UpdateFollowupType(followupType)) { LoadFollowupTypes(); MessageBox.Show("修改成功!"); } } else { textBox1.Focus(); textBox1.SelectAll(); } } else { if (al.UpdateFollowupType(followupType)) { LoadFollowupTypes(); MessageBox.Show("修改成功!"); } } } else { MessageBox.Show("先选定要修改的回访方式!"); } }
private void button1_Click(object sender, EventArgs e) { FollowupType followupType = new FollowupType(); followupType.方式 = textBox1.Text.Trim(); followupType.备注 = textBox2.Text.Trim(); followupType.Flag = checkBox1.Checked; FollowupTypeLogic al = FollowupTypeLogic.GetInstance(); if (al.ExistsName(followupType.方式)) { if (MessageBox.Show("系统中已经存在该回访方式,确定还要继续保存么?", "重名提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.OK) { int id = al.AddFollowupType(followupType); if (id > 0) { followupType.ID = id; LoadFollowupTypes(); MessageBox.Show("添加成功!"); } } else { textBox1.Focus(); textBox1.SelectAll(); } } else { int id = al.AddFollowupType(followupType); if (id > 0) { followupType.ID = id; LoadFollowupTypes(); MessageBox.Show("添加成功!"); } } }
public List <Followup> GetAllFollowups() { List <Followup> elements = new List <Followup>(); string sql = "select * from TF_Followup"; DataTable dt = sqlHelper.Query(sql); if (dt != null && dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { Followup element = new Followup(); element.ID = Convert.ToInt32(dt.Rows[i]["ID"]); element.Member = MemberLogic.GetInstance().GetMember(Convert.ToInt32(dt.Rows[i]["MemberID"])); element.回访方式 = FollowupTypeLogic.GetInstance().GetFollowupType(Convert.ToInt32(dt.Rows[i]["跟进方式"])); element.跟进结果 = FollowupResultLogic.GetInstance().GetFollowupResult(Convert.ToInt32(dt.Rows[i]["跟进结果"])); element.跟进时间 = Convert.ToDateTime(dt.Rows[i]["跟进时间"]); element.跟进人 = StaffLogic.GetInstance().GetStaff(Convert.ToInt32(dt.Rows[i]["跟进人"])); element.备注 = dt.Rows[i]["备注"].ToString(); elements.Add(element); } } return(elements); }