private void btnSearch_Click(object sender, EventArgs e) { BLL.v_fail_history vfhBll = new BLL.v_fail_history(); string sqlWhere = " 1+1 "; if (cmbFailSystem.SelectedIndex != -1) { sqlWhere += "and system_id=" + flSysIdLst[cmbFailSystem.SelectedIndex]; } if (cmbPlaneType.SelectedIndex != -1) { sqlWhere += " and ptype_id= " + plnTypIdLst[cmbPlaneType.SelectedIndex]; } if (cmbTimePoint.SelectedIndex != -1) { sqlWhere += " and tpoint_id= " + tmPntIdLst[cmbTimePoint.SelectedIndex]; } if (txtPhenomenon.Text.Trim() != "") { string[] keyWdsArr = txtPhenomenon.Text.Trim().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); sqlWhere += " and ( "; for (int i = 0; i < keyWdsArr.Length; i++) { sqlWhere += " fh_keywd like '%" + keyWdsArr[i] + "%' or " + " fh_caseid like '%" + keyWdsArr[i] + "%' or "; } sqlWhere = sqlWhere.Substring(0, sqlWhere.Length - 3) + ")"; } sqlWhere += " order by fh_id desc "; vfhList = vfhBll.GetModelList(sqlWhere); ListViewLoadData(); }
private void btnOK_Click(object sender, EventArgs e) { if (cmbPlaneType.SelectedIndex == -1) { MessageBox.Show("请选择飞机型号!"); return; } if (cmbFailSystem.SelectedIndex == -1) { MessageBox.Show("请选择故障系统!"); return; } if (cmbTimePoint.SelectedIndex == -1) { MessageBox.Show("请选择故障时机!"); return; } BLL.fault_history fhBll = new BLL.fault_history(); Model.fault_history editFhModel = new Model.fault_history(); editFhModel.fh_id = editModel.fh_id; editFhModel.fh_adduser = editModel.fh_adduser; editFhModel.fh_addtime = editModel.fh_addtime; editFhModel.fh_caseid = editModel.fh_caseid; editFhModel.fh_cause = rchCause.Text; editFhModel.fh_description = rchtxtDescription.Text; editFhModel.fh_experience = rchTxtExperiance.Text; editFhModel.fh_explain = rchTxtExplain.Text; editFhModel.fh_keywd = txtKeyWds.Text.Trim(); editFhModel.fh_phenomenon = rchTxtPhnmn.Text; editFhModel.fh_reference = rchTxtReferance.Text; editFhModel.fh_suggest = rchTxtSuggest.Text; editFhModel.fh_title = txtTtl.Text; editFhModel.ptype_id = plnTypIdLst[cmbPlaneType.SelectedIndex]; editFhModel.system_id = flSysIdLst[cmbFailSystem.SelectedIndex]; editFhModel.tpoint_id = tmPntIdLst[cmbTimePoint.SelectedIndex]; fhBll.Update(editFhModel); MessageBox.Show("修改成功!"); BLL.v_fail_history vfhBll = new BLL.v_fail_history(); father.vfhList = vfhBll.GetModelList("fh_id=" + editFhModel.fh_id); father.ListViewLoadData(); this.Close(); }
private void btnOK_Click(object sender, EventArgs e) { if (cmbPlaneType.SelectedIndex == -1) { MessageBox.Show("请选择飞机型号!"); return; } if (cmbFailSystem.SelectedIndex == -1) { MessageBox.Show("请选择故障系统!"); return; } if (cmbTimePoint.SelectedIndex == -1) { MessageBox.Show("请选择故障时机!"); return; } BLL.fault_history fhBll = new BLL.fault_history(); Model.fault_history addFhModel = new Model.fault_history(); addFhModel.fh_addtime = DateTime.Now; addFhModel.fh_adduser = constants.currentUser.user_id; addFhModel.fh_caseid = fhBll.createCaseID(fhBll.getMaxCaseID()); addFhModel.fh_cause = rchCause.Text; addFhModel.fh_description = rchtxtDescription.Text; addFhModel.fh_experience = rchTxtExperiance.Text; addFhModel.fh_explain = rchTxtExplain.Text; addFhModel.fh_keywd = txtKeyWds.Text.Trim(); addFhModel.fh_phenomenon = rchTxtPhnmn.Text; addFhModel.fh_reference = rchTxtReferance.Text; addFhModel.fh_suggest = rchTxtSuggest.Text; addFhModel.fh_title = txtTtl.Text; addFhModel.ptype_id = plnTypIdLst[cmbPlaneType.SelectedIndex]; addFhModel.system_id = flSysIdLst[cmbFailSystem.SelectedIndex]; addFhModel.tpoint_id = tmPntIdLst[cmbTimePoint.SelectedIndex]; fhBll.Add(addFhModel); MessageBox.Show("添加成功!"); BLL.v_fail_history vfhBll = new BLL.v_fail_history(); father.vfhList = vfhBll.GetModelList("fh_phenomenon='" + addFhModel.fh_phenomenon + "' and fh_caseid='" + addFhModel.fh_caseid + "'"); father.ListViewLoadData(); this.Close(); }