private void btn_del_Click(object sender, EventArgs e) { if (this.textBox1.Text == "") { Msg.Box.Show("请输入完整信息", "错误提示", Msg.Box.Ico.Warining); return; } Entity.Department Dp = new Entity.Department(); try { Dp.depID = int.Parse(this.listBox1.SelectedValue.ToString()); bool IsTrue = BLL.DepBLL.DDL(Dp); if (IsTrue == true) { Msg.Box.Show("恭喜您,修改成功!", "成功提示", Msg.Box.Ico.Info); gx(); } } catch { Msg.Box.Show("该部门下存在岗位,请先清空岗位信息!", "系统警告", Msg.Box.Ico.Warining); return; } }
private void btn_find_Click(object sender, EventArgs e) { Entity.Work wr = new Entity.Work(); Entity.Department dp = new Entity.Department(); Entity.Person pr = new Entity.Person(); if (radioButton1.Checked) { wr.wTime = this.dateTimePicker1.Value; dataGridView1.DataSource = BLL.WorkBLL.work5(wr, this.dateTimePicker2.Value); int i = this.dataGridView1.Rows.Count; if (i == 0) { Msg.Box.Show("未查找到您所要的信息!"); } } else if (radioButton2.Checked) { dp.depID = int.Parse(this.comboBox1.SelectedValue.ToString()); dataGridView1.DataSource = BLL.WorkBLL.work2(dp); int i = this.dataGridView1.Rows.Count; if (i == 0) { Msg.Box.Show("未查找到您所要的信息"); } } else { Msg.Box.Show("您还未勾选查询方式!"); return; } }
private void btn_find_Click(object sender, EventArgs e) { Entity.Leave le = new Entity.Leave(); Entity.Department dp = new Entity.Department(); try { if (this.radioButton1.Checked) { le.pID = int.Parse(this.textBox1.Text); dataGridView1.DataSource = BLL.LeaveBLL.LeavePID(le); int i = this.dataGridView1.Rows.Count; if (i == 0) { Msg.Box.Show("未查找到您所要的信息!"); } } else if (this.radioButton2.Checked) { dp.depID = int.Parse(this.comboBox1.SelectedValue.ToString()); dataGridView1.DataSource = BLL.LeaveBLL.LeaveDep(dp); int i = this.dataGridView1.Rows.Count; if (i == 0) { Msg.Box.Show("未查找到您所要的信息!"); } } else if (this.radioButton3.Checked) { string name = this.textBox2.Text; dataGridView1.DataSource = BLL.LeaveBLL.LeavePName(le, name); int i = this.dataGridView1.Rows.Count; if (i == 0) { Msg.Box.Show("未查找到您所要的信息!"); } } else if (this.radioButton4.Checked) { le.lStart = this.dateTimePicker1.Value; dataGridView1.DataSource = BLL.LeaveBLL.LeaveLstart(le); int i = this.dataGridView1.Rows.Count; if (i == 0) { Msg.Box.Show("未查找到您所要的信息!"); } } else { Msg.Box.Show("您还未勾选查询方式"); return; } } catch (Exception ex) { Msg.Box.Show(ex.Message); return; } }
private void btn_add_Click(object sender, EventArgs e) { if (this.textBox1.Text == "") { Msg.Box.Show("请输入完整信息", "错误提示", Msg.Box.Ico.Warining); return; } Entity.Department Dp = new Entity.Department(); Dp.depName = this.textBox1.Text; bool IsTrue = BLL.DepBLL.ADL(Dp); if (IsTrue == true) { Msg.Box.Show("修改成功!", "成功提示", Msg.Box.Ico.Info); gx(); } }
private void btn_change_Click(object sender, EventArgs e) { if (this.textBox1.Text == "") { Msg.Box.Show("请输入完整信息", "错误提示", Msg.Box.Ico.Warining); return; } Entity.Department Dp = new Entity.Department(); Dp.depID = int.Parse(this.listBox1.SelectedValue.ToString()); Dp.depName = this.textBox1.Text; bool IsTrue = BLL.DepBLL.CDL(Dp); if (IsTrue == true) { Msg.Box.Show("修改成功!", "成功提示", Msg.Box.Ico.Info); gx(); } }
//按所属部门查询 public static DataTable LeaveDep(Entity.Department dp) { return(DAL.LeaveDAL.LeaveDep(dp)); }
public void WriteDepartmentInfoToConsole(Entity.Department department) { Console.WriteLine(string.Format(" DepartmentId: {0} \n DepartmentName: {1} \n SectionId: {2}", department.Id, department.Name, department.SectionId)); }
//按部门查询 public static DataTable work2(Entity.Department dp) { return(DAL.WorkDAL.Work2(dp)); }
/// <summary> /// 传递删除的方法 /// </summary> /// <param name="DDDP"></param> /// <returns></returns> public static bool DDL(Entity.Department DDDP) { return(DAL.DepDAL.DDPL(DDDP)); }
/// <summary> /// 传递新增的方法 /// </summary> /// <param name="CDP"></param> /// <returns></returns> public static bool ADL(Entity.Department ADP) { return(DAL.DepDAL.ADPL(ADP)); }
}/// <summary> /// 传递修改部门的方法 /// </summary> /// <param name="CDP"></param> /// <returns></returns> public static bool CDL(Entity.Department CDP) { return(DAL.DepDAL.DPL(CDP)); }