private void LoadFollowupResults() { List <FollowupResult> elements = FollowupResultLogic.GetInstance().GetAllFollowupResults(); comboBox1.Items.Clear(); foreach (FollowupResult element in elements) { comboBox1.Items.Add(element); } dataGridView1.DataSource = FollowupResultLogic.GetInstance().GetFollowupResults(string.Empty); }
private void LoadFollowupResults() { List <FollowupResult> elements = FollowupResultLogic.GetInstance().GetAllFollowupResults(); comboBox4.Items.Clear(); comboBox4.Items.Add("--不限--"); comboBox7.Items.Clear(); foreach (FollowupResult element in elements) { comboBox4.Items.Add(element); comboBox7.Items.Add(element); } comboBox4.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(FollowupResultLogic.GetInstance().GetFollowupResults(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) { FollowupResult followupResult = (FollowupResult)comboBox1.SelectedItem; if (FollowupResultLogic.GetInstance().DeleteFollowupResult(followupResult)) { LoadFollowupResults(); } } } 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) { FollowupResult followupResult = (FollowupResult)comboBox1.SelectedItem; followupResult.结果 = textBox1.Text.Trim(); followupResult.备注 = textBox2.Text.Trim(); followupResult.Flag = checkBox1.Checked; FollowupResultLogic al = FollowupResultLogic.GetInstance(); if (al.ExistsNameOther(followupResult.结果, followupResult.ID)) { if (MessageBox.Show("系统中已经存在该跟进结果,确定还要继续保存么?", "重名提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.OK) { if (al.UpdateFollowupResult(followupResult)) { LoadFollowupResults(); MessageBox.Show("修改成功!"); } } else { textBox1.Focus(); textBox1.SelectAll(); } } else { if (al.UpdateFollowupResult(followupResult)) { LoadFollowupResults(); MessageBox.Show("修改成功!"); } } } else { MessageBox.Show("先选定要修改的跟进结果!"); } }
private void button1_Click(object sender, EventArgs e) { FollowupResult followupResult = new FollowupResult(); followupResult.结果 = textBox1.Text.Trim(); followupResult.备注 = textBox2.Text.Trim(); followupResult.Flag = checkBox1.Checked; FollowupResultLogic al = FollowupResultLogic.GetInstance(); if (al.ExistsName(followupResult.结果)) { if (MessageBox.Show("系统中已经存在该跟进结果,确定还要继续保存么?", "重名提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.OK) { int id = al.AddFollowupResult(followupResult); if (id > 0) { followupResult.ID = id; LoadFollowupResults(); MessageBox.Show("添加成功!"); } } else { textBox1.Focus(); textBox1.SelectAll(); } } else { int id = al.AddFollowupResult(followupResult); if (id > 0) { followupResult.ID = id; LoadFollowupResults(); 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); }