/// <summary> /// 删除个人经验库 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAnalyInputDelete_Click(object sender, EventArgs e) { if (this.Text == "后果录入界面") { ConsequenceBLL bll = new ConsequenceBLL(); if (this.dgvTbcPageAnaPersonal.SelectedRows.Count > 0) { bll.DeletePersonalConseqence(Convert.ToInt32(this.dgvTbcPageAnaPersonal.SelectedRows[0].Cells[1].Value)); this.rtbAnaInputInterface.Text = String.Empty; ConsequenceDataBind(); } } if (this.Text == "原因录入界面") { ReasonBLL bll = new ReasonBLL(); if (this.dgvTbcPageAnaPersonal.SelectedRows.Count > 0) { bll.DeletePersonalReason(Convert.ToInt32(this.dgvTbcPageAnaPersonal.SelectedRows[0].Cells[1].Value)); this.rtbAnaInputInterface.Text = String.Empty; ReasonDataBind(); } } if (this.Text == "措施录入界面") { MeasureBLL bll = new MeasureBLL(); if (this.dgvTbcPageAnaPersonal.SelectedRows.Count > 0) { bll.DeletePersonalMeasure(Convert.ToInt32(this.dgvTbcPageAnaPersonal.SelectedRows[0].Cells[1].Value)); this.rtbAnaInputInterface.Text = String.Empty; MeasureDataBind(); } } }
/// <summary> /// 绑定后果数据库 /// </summary> private void ConsequenceDataBind() { ConsequenceBLL consequenceBLL = new ConsequenceBLL(); if (ReceiveSelectedTreeNode != null) { int id = Convert.ToInt32(ReceiveSelectedTreeNode.Tag); List <DisplayConsequence> consequenceList = consequenceBLL.Get_ConsequenceList(id); this.dgvTbcPageAnaExpert.AutoGenerateColumns = false; this.dgvTbcPageAnaExpert.Columns["Records"].DataPropertyName = "ConsquenceText"; this.dgvTbcPageAnaExpert.DataSource = consequenceList; List <DisplayConsequence> personalconsequenceList = consequenceBLL.Get_PersonalConsequence(id); this.dgvTbcPageAnaPersonal.AutoGenerateColumns = false; this.dgvTbcPageAnaPersonal.Columns["RecordPersonal"].DataPropertyName = "ConsquenceText"; this.dgvTbcPageAnaPersonal.DataSource = personalconsequenceList; } }
/// <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(); } }