public bool Add_Consequence(Conqeq Consequence) { bool IsSuccess = false; string sql = "insert into tb_Conseq values(@ConseqText,@IntrodrucerID,@Type)"; SqlParameter[] spm = { new SqlParameter("@ConseqText", System.Data.SqlDbType.VarChar), new SqlParameter("@IntrodrucerID", System.Data.SqlDbType.Int), new SqlParameter("@Type", System.Data.SqlDbType.Int), }; spm[0].Value = Consequence.ConseqText; spm[1].Value = Consequence.Introdrucer; spm[2].Value = Consequence.Type; if (SqlHelper.ExecuteNonQuery(sql, spm) > 0) { IsSuccess = true; } return(IsSuccess); }
/// <summary> /// 添加到个人经验库 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAnalyInputAdd_Click(object sender, EventArgs e) { if (this.Text == "后果录入界面") { ConsequenceBLL bll = new ConsequenceBLL(); Conqeq conseq = new Conqeq(); conseq.ConseqText = this.rtbAnaInputInterface.Text.Trim(); conseq.Type = 2; conseq.Introdrucer = Convert.ToInt32(ReceiveSelectedTreeNode.Tag); bll.Add_Consequence(conseq); this.rtbAnaInputInterface.Text = String.Empty; ConsequenceDataBind(); } if (this.Text == "原因录入界面") { ReasonBLL bll = new ReasonBLL(); DisplayReasons reason = new DisplayReasons(); reason.ReasonText = this.rtbAnaInputInterface.Text.Trim(); reason.Type = 2; reason.IntroducerId = Convert.ToInt32(ReceiveSelectedTreeNode.Tag); bll.Add_Reason(reason); this.rtbAnaInputInterface.Text = String.Empty; ReasonDataBind(); } if (this.Text == "措施录入界面") { MeasureBLL bll = new MeasureBLL(); Messure messure = new Messure(); messure.MessureText = this.rtbAnaInputInterface.Text.Trim(); messure.Type = 2; messure.IntroducerId = Convert.ToInt32(ReceiveSelectedTreeNode.Tag); bll.Add_Messure(messure); this.rtbAnaInputInterface.Text = String.Empty; MeasureDataBind(); } }
public bool Add_Consequence(Conqeq Consequence) { return(dal.Add_Consequence(Consequence)); }