Example #1
0
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     if (txtName.Text.Trim() == "")
     {
         MessageBox.Show("故障系统不能为空!");
         return;
     }
     BLL.fail_system Bll = new BLL.fail_system();
     if (Bll.GetModel(txtName.Text.Trim()) != null)
     {
         MessageBox.Show("故障系统已存在!");
         return;
     }
     Model.fail_system addModel = new Model.fail_system();
     addModel.system_name   = txtName.Text.Trim();
     addModel.system_remark = rchTxtRemark.Text;
     Bll.Add(addModel);
     this.Close();
 }
Example #2
0
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     if (txtName.Text.Trim() == "")
     {
         MessageBox.Show("故障系统不能为空!");
         return;
     }
     BLL.fail_system   Bll   = new BLL.fail_system();
     Model.fail_system Model = Bll.GetModel(txtName.Text.Trim());
     if (Model != null && Model.system_id != this.EditModel.system_id)
     {
         MessageBox.Show("故障系统已存在!");
         return;
     }
     EditModel.system_name   = txtName.Text.Trim();
     EditModel.system_remark = rchTxtRemark.Text;
     Bll.Update(EditModel);
     MessageBox.Show("修改成功!");
     this.Close();
 }
Example #3
0
        private void initFaultHistory()
        {
            progressBar1.Value = 90;
            DataSet ds = LoadDataFromExcel(fileName, "故障案例库信息");

            BLL.fault_history   bll   = new BLL.fault_history();
            Model.fault_history model = new Model.fault_history();

            BLL.time_point  tpBll = new BLL.time_point();
            BLL.fail_system fsBll = new BLL.fail_system();
            BLL.plane_type  ptBll = new BLL.plane_type();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                if (dr["案例编号"].ToString() == "")
                {
                    return;
                }
                model.fh_addtime     = DateTime.Now;
                model.fh_adduser     = constants.currentUser.user_id;
                model.fh_caseid      = dr["案例编号"].ToString();
                model.fh_cause       = dr["故障原因"].ToString();
                model.fh_description = dr["相关描述"].ToString();
                model.fh_experience  = dr["经验教训"].ToString();
                model.fh_explain     = dr["解释"].ToString();
                model.fh_keywd       = dr["关键词"].ToString();
                model.fh_phenomenon  = dr["故障现象"].ToString();
                model.fh_reference   = dr["参考资料"].ToString();
                model.fh_suggest     = dr["维修建议"].ToString();
                model.fh_title       = dr["案例标题"].ToString();
                model.ptype_id       = ptBll.GetModel(dr["飞机型号"].ToString()).ptype_id;
                model.system_id      = fsBll.GetModel(dr["故障系统"].ToString()).system_id;
                model.tpoint_id      = tpBll.GetModel(dr["发生时机"].ToString()).tpoint_id;
                bll.Add(model);
            }
        }