public FailureTreeEditFrm(Model.v_failure_tree editModel, FailureTreeFrm father) { InitializeComponent(); this.father = father; this.editModel = editModel; initCntls(); loadEditInfo(editModel); }
public FailureTreeDetailFrm(Model.v_failure_tree detail) { InitializeComponent(); KeyPreview = true; this.detail = detail; picBxTree.SizeMode = PictureBoxSizeMode.StretchImage; picBxGrid.SizeMode = PictureBoxSizeMode.StretchImage; displayDetail(detail); }
private void listView1_DoubleClick(object sender, EventArgs e) { if (listView1.SelectedItems.Count == 0) { return; } Model.v_failure_tree detail = vftList[listView1.SelectedIndices[0]]; FailureTreeDetailFrm viewImageFrm = new FailureTreeDetailFrm(detail); viewImageFrm.ShowDialog(); }
private void btnEdit_Click(object sender, EventArgs e) { if (listView1.SelectedItems.Count == 0) { MessageBox.Show("请选择要修改的项!"); return; } Model.v_failure_tree editModel = vftList[listView1.SelectedIndices[0]]; FailureTreeEditFrm failureTreeDetailFrm = new FailureTreeEditFrm(editModel, this); failureTreeDetailFrm.ShowDialog(); }
private void loadEditInfo(Model.v_failure_tree editModel) { lblUser.Text = editModel.user_name; lblAddTime.Text = editModel.ft_addtime.ToString("yyyy-MM-dd HH:mm"); lblCsID.Text = editModel.ft_caseid; cmbPlaneType.SelectedIndex = plnTypIdLst.IndexOf(editModel.ptype_id); cmbFailSystem.SelectedIndex = flSysIdLst.IndexOf(editModel.system_id); cmbTimePoint.SelectedIndex = tmPntIdLst.IndexOf(editModel.tpoint_id); txtKeyWds.Text = editModel.ft_keywd; picBxTree.Image = getPicFromByteArr(editModel.ft_pic); picBxGrid.Image = getPicFromByteArr(editModel.ft_grid); rchTxtExperience.Text = editModel.experience; }
private void displayDetail(Model.v_failure_tree detail) { lblUser.Text = detail.user_name; lblAddTime.Text = detail.ft_addtime.ToString("yyyy-MM-dd HH:mm"); lblCsID.Text = detail.ft_caseid; lblPlnTyp.Text = detail.ptype_name; lblTPnt.Text = detail.tpoint_value; lblFlSys.Text = detail.system_name; lblKeyWds.Text = detail.ft_keywd; picBxTree.Image = getPicFromByteArr(detail.ft_pic); picBxGrid.Image = getPicFromByteArr(detail.ft_grid); if (detail.experience != null && detail.experience != "") { string[] expArr = detail.experience.Split(new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries); foreach (string str in expArr) { rchTxtExperience.Text += "● " + str + "\r\n"; } } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(fds.Model.v_failure_tree model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(fds.Model.v_failure_tree model) { return(dal.Add(model)); }