public FaultHistoryEditFrm(FaultHistoryForm father, Model.v_fail_history editModel) { InitializeComponent(); this.father = father; initCntls(); this.editModel = editModel; loadEditInfo(editModel); }
private void listView1_DoubleClick(object sender, EventArgs e) { if (listView1.SelectedItems.Count == 0) { return; } Model.v_fail_history detail = vfhList[listView1.SelectedIndices[0]]; FaultHistoryDetailsFrm faultHistoryDetailsFrm = new FaultHistoryDetailsFrm(detail); faultHistoryDetailsFrm.ShowDialog(); }
private void btnEdit_Click(object sender, EventArgs e) { if (listView1.SelectedItems.Count == 0) { MessageBox.Show("请选择要修改的项!"); return; } Model.v_fail_history editModel = vfhList[listView1.SelectedIndices[0]]; FaultHistoryEditFrm faultHistoryEditFrm = new FaultHistoryEditFrm(this, editModel); faultHistoryEditFrm.ShowDialog(); }
private void displayDetail(Model.v_fail_history detail) { lblUser.Text = detail.user_name; lblAddTime.Text = detail.fh_addtime.ToString("yyyy-MM-dd HH:mm"); lblPlnTyp.Text = detail.ptype_name; lblTPnt.Text = detail.tpoint_value; lblFlSys.Text = detail.system_name; lblFhCsId.Text = detail.fh_caseid; lblFhTtl.Text = detail.fh_title; lblKeyWds.Text = detail.fh_keywd; rchTxtPhnmn.Text = detail.fh_phenomenon; rchtxtDescription.Text = detail.fh_description; rchCause.Text = detail.fh_cause; rchTxtSuggest.Text = detail.fh_suggest; rchTxtExplain.Text = detail.fh_explain; rchTxtExperiance.Text = detail.fh_experience; rchTxtReferance.Text = detail.fh_reference; }
private void loadEditInfo(Model.v_fail_history editModel) { txtTtl.Text = editModel.fh_title; lblCsID.Text = editModel.fh_caseid; lblUser.Text = editModel.user_name; lblAddTime.Text = editModel.fh_addtime.ToString("yyyy-MM-dd HH:mm"); cmbPlaneType.SelectedIndex = plnTypIdLst.IndexOf(editModel.ptype_id); cmbFailSystem.SelectedIndex = flSysIdLst.IndexOf(editModel.system_id); cmbTimePoint.SelectedIndex = tmPntIdLst.IndexOf(editModel.tpoint_id); txtKeyWds.Text = editModel.fh_keywd; rchTxtPhnmn.Text = editModel.fh_phenomenon; rchtxtDescription.Text = editModel.fh_description; rchCause.Text = editModel.fh_cause; rchTxtSuggest.Text = editModel.fh_suggest; rchTxtExplain.Text = editModel.fh_explain; rchTxtExperiance.Text = editModel.fh_experience; rchTxtReferance.Text = editModel.fh_reference; }
public FaultHistoryDetailsFrm(Model.v_fail_history detail) { InitializeComponent(); displayDetail(detail); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(fds.Model.v_fail_history model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(fds.Model.v_fail_history model) { return(dal.Add(model)); }