private void toolStripSave_Click(object sender, EventArgs e) { if (this.toolStripAdd.Enabled == false) { HY_Model.HY_ProductionPlanning hypromodel = new HY_Model.HY_ProductionPlanning(); hypromodel.P_DID = this.p_DID.Text.Trim(); hypromodel.P_KID = this.p_KID.Text.Trim(); hypromodel.P_CID = this.p_CID.Text.Trim(); hypromodel.P_Engineering = this.textBoxX2.Text.Trim(); hypromodel.P_Design = this.p_Design.Text.Trim(); HY_BLL.HY_ProductionPlanningBLL hyprobll = new HY_ProductionPlanningBLL(); string sql = "insert into HY_ProductionPlanning(p_DID,p_KID,p_CID,p_Engineering,p_Design) values('" + hypromodel.P_DID + "','" + hypromodel.P_KID + "','" + hypromodel.P_CID + "','" + hypromodel.P_Engineering + "','" + hypromodel.P_Design + "')"; int res = hyprobll.com_HY_ProductionPlanninglist(sql); if (res > 0) { MessageBox.Show("生产排程计划添加成功!"); requistionDate();//自定义绑定数据库 } } }
public HY_ProductionPlanning() { InitializeComponent(); hypromodel = new HY_Model.HY_ProductionPlanning(); hyprod = new HY_ProductionPlanningBLL(); }