public static bool del(Entity.Train a) { if (DAL.CouseDAL.Del(a) > 0) { return(true); } else { return(false); } }
public static bool sss(Entity.Train z) { if (DAL.TrainPlanDAL.pxjh(z) > 0) { return(true); } else { return(false); } }
//添加信息 public static bool adjId(Entity.Train a) { if (DAL.TrainPlanDAL.STCOM(a) > 0) { return(true); } else { return(false); } }
private void button1_Click(object sender, EventArgs e) { Entity.Train ap = new Entity.Train(); try { if (this.radioButton1.Checked) { ap.leID = int.Parse(this.comboBox1.SelectedValue.ToString()); dataGridView1.DataSource = BLL.TrainPlanBLL.cou(ap); clear(); int i = this.dataGridView1.Rows.Count; if (i == 0) { Msg.Box.Show("抱歉,未查找到任何信息!"); return; } } else if (this.radioButton2.Checked) { ap.tpTeacher = this.textBox1.Text; dataGridView1.DataSource = BLL.TrainPlanBLL.lect(ap); clear(); int i = this.dataGridView1.Rows.Count; if (i == 0) { Msg.Box.Show("抱歉,未查找到任何信息!"); return; } } else if (this.radioButton3.Checked) { ap.tpAdr = this.textBox2.Text; dataGridView1.DataSource = BLL.TrainPlanBLL.place(ap); clear(); int i = this.dataGridView1.Rows.Count; if (i == 0) { Msg.Box.Show("抱歉,未查找到任何信息!"); return; } } else { Msg.Box.Show("您还未勾选查询方式!"); return; } } catch { Msg.Box.Show("您的填写有误,请重新填写"); return; } }
private void button2_Click(object sender, EventArgs e) { Entity.Train a = new Entity.Train(); if (this.textBox1.Text == "" || this.textBox2.Text == "" || this.textBox3.Text == "" || this.comboBox3.Text == "") { Msg.Box.Show("请输入完整信息!"); return; } try { a.pID = int.Parse(this.textBox2.Text); a.tpID = int.Parse(this.textBox3.Text); } catch (Exception) { Msg.Box.Show("输入的代号格式有误!"); return; } try { a.nResult = this.comboBox3.Text; a.nTexts = this.textBox1.Text; } catch (Entity.HrmException he) { Msg.Box.Show(he.Message); return; } try { if (BLL.TrainPlanBLL.IsHave(a) == 0) { Msg.Box.Show("您输入的工号不存在!"); return; } if (BLL.TrainPlanBLL.adjId(a) == true) { Msg.Box.Show("恭喜您,成功添加评价!"); this.textBox1.Text = this.textBox2.Text = this.textBox3.Text = ""; } else { Msg.Box.Show("抱歉,添加失败!"); return; } } catch (Exception) { Msg.Box.Show("您输入的计划代号有误!"); return; } this.dataGridView1.DataSource = BLL.TrainPlanBLL.TPNotes(a); }
private void button1_Click(object sender, EventArgs e) { Entity.Train ss = new Entity.Train(); try { ss.leID = int.Parse(this.comboBox1.SelectedValue.ToString()); ss.tpTeacher = this.textBox1.Text; ss.tpAdr = this.textBox2.Text; } catch (Exception he) { Msg.Box.Show(he.Message); return; } int i = 0; try { i = int.Parse(this.textBox3.Text); } catch { Msg.Box.Show("请输入正确的格式!"); return; } ss.tpCount = i; ss.tpStart = dateTimePicker1.Value; ss.tpStop = dateTimePicker2.Value; TimeSpan ts = dateTimePicker2.Value.AddMinutes(5) - dateTimePicker1.Value; if (ts.Seconds <= 0) { Msg.Box.Show("结束时间不可早于开始时间!"); return; } bool isTrue = BLL.TrainPlanBLL.sss(ss); if (isTrue == true) { Msg.Box.Show("恭喜您,添加培训计划成功"); this.textBox1.Clear(); this.textBox2.Clear(); this.textBox3.Clear(); } }
//添加课程 public static int Adt(Entity.Train a) { string s = "insert into lesson values('" + a.leName + "','" + a.leType + "','" + a.leText + "')"; return(DBHelper.GetLine(s)); }
//按培训地点查看 public static DataTable place(Entity.Train a) { string s = "select lename 培训课程,TPTeacher 讲师,tpadr 培训地点,Tpcount 培训人数,tpstart 开始时间,tpstop 结束时间 from lesson,trainplan where trainplan.leid=lesson.leid and TPAdr like '%" + a.tpAdr + "%'"; return(DBHelper.GetDT(s)); }
//查询人员是否存在 public static int IsHave(Entity.Train train) { string s = "select count(*) from Person where PID=" + train.pID + " "; return((int)DBHelper.GetScalar(s)); }
public static System.Data.DataTable ddd(Entity.Train d) { string sql = "select NID 记录编号,PName 人员姓名,LeName 培训课程,NResult 培训效果,NTexts 教员评价 from Tpnotes,Lesson,Person,TrainPlan where Person.PID=Tpnotes.PID and Tpnotes.TPID=TrainPlan.TPID and Lesson.LeID=TrainPlan.LeID and TrainPlan.TPID=" + d.tpID + ""; return(DBHelper.GetDT(sql)); }
//添加人员信息 public static int STCOM(Entity.Train a) { string sql = "insert into Tpnotes values('" + a.pID + "','" + a.tpID + "','" + a.nResult + "','" + a.nTexts + "')"; return(DBHelper.GetLine(sql)); }
public static int pxjh(Entity.Train z) { string s = "insert into trainplan values('" + z.leID + "','" + z.tpTeacher + "','" + z.tpAdr + "','" + z.tpCount + "','" + z.tpStart + "','" + z.tpStop + "')"; return(DBHelper.GetLine(s)); }
//模糊查询 public static System.Data.DataTable TPNotes(Entity.Train d) { return(DAL.TrainPlanDAL.ddd(d)); }
//修改课程 public static int Mod(Entity.Train a) { string s = string.Format("update lesson set leName='{0}',leType='{1}',leText='{2}' where leId='{3}'", a.leName, a.leType, a.leText, a.leID); return(DBHelper.GetLine(s)); }
/// <summary> /// 查询人员是否存在 /// </summary> /// <returns></returns> public static int IsHave(Entity.Train train) { return(DAL.TrainPlanDAL.IsHave(train)); }
//按开始时间查看 public static System.Data.DataTable dte(Entity.Train d) { string sql = "select NID 记录编号,PName 人员姓名,LeName 培训课程,NResult 培训效果,NTexts 教员评价,tpstart 开始时间 from Tpnotes,Lesson,Person,TrainPlan where Person.PID=Tpnotes.PID and Tpnotes.TPID=TrainPlan.TPID and Lesson.LeID=TrainPlan.LeID and Person.PID='" + d.pID + "'and year(TrainPlan.TPStart)=" + d.tpStart.Year + "and month(TrainPlan.TPStart)=" + d.tpStart.Month + "and day(TrainPlan.TPStart)=" + d.tpStart.Day + ""; return(DBHelper.GetDT(sql)); }
public static System.Data.DataTable dt(Entity.Train d) { string sql = "select NID 记录编号,PName 人员姓名,LeName 培训课程,NResult 培训效果,NTexts 教员评价,tpstart 开始时间 from Tpnotes,Lesson,Person,TrainPlan where Person.PID=Tpnotes.PID and Tpnotes.TPID=TrainPlan.TPID and Lesson.LeID=TrainPlan.LeID and Person.PID='" + d.pID + "'and Tpnotes.NResult='" + d.nResult + "'"; return(DBHelper.GetDT(sql)); }
//按地点 public static DataTable place(Entity.Train a) { return(DAL.TrainPlanDAL.place(a)); }
//按讲师 public static DataTable lect(Entity.Train a) { return(DAL.TrainPlanDAL.lect(a)); }
//按课程 public static DataTable cou(Entity.Train a) { return(DAL.TrainPlanDAL.cou(a)); }
public static int Del(Entity.Train a) { string s = string.Format("delete from lesson where LeID='{0}' ", a.leID); return(DBHelper.GetLine(s)); }
public static System.Data.DataTable DTT(Entity.Train d) { return(EDAL.TrainDAL.dte(d)); }