Exemple #1
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            BLL.v_failure_tree vftBll   = new BLL.v_failure_tree();
            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 += " ft_keywd like '%" + keyWdsArr[i] + "%' or " + " ft_caseid like '%" + keyWdsArr[i] + "%' or ";
                }
                sqlWhere = sqlWhere.Substring(0, sqlWhere.Length - 3) + ")";
            }
            sqlWhere += " order by ft_id desc ";
            vftList   = vftBll.GetModelList(sqlWhere);
            ListViewLoadData();
        }
Exemple #2
0
        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;
            }
            if (picBxTree.Image == null)
            {
                MessageBox.Show("事件序列图不能为空!");
                return;
            }
            if (picBxGrid.Image == null)
            {
                MessageBox.Show("事件代号不能为空!");
                return;
            }
            DateTime now = DateTime.Now;

            BLL.failure_tree   ftBll      = new BLL.failure_tree();
            Model.failure_tree addFhModel = new Model.failure_tree();
            addFhModel.ft_addtime = now;
            addFhModel.ft_adduser = constants.currentUser.user_id;
            addFhModel.ft_caseid  = ftBll.createCaseID(ftBll.getMaxCaseID());
            addFhModel.ft_keywd   = txtKeyWds.Text.Trim();
            addFhModel.ft_pic     = getImgToByte(picBxTree.Image);
            addFhModel.ft_grid    = getImgToByte(picBxGrid.Image);
            addFhModel.ptype_id   = plnTypIdLst[cmbPlaneType.SelectedIndex];
            addFhModel.system_id  = flSysIdLst[cmbFailSystem.SelectedIndex];
            addFhModel.tpoint_id  = tmPntIdLst[cmbTimePoint.SelectedIndex];

            if (rchTxtExperience.Text == "添加时删除此说明:请用换行符分隔多个经验内容。")
            {
                addFhModel.experience = "";
            }
            else
            {
                addFhModel.experience = rchTxtExperience.Text.Trim();
            }


            ftBll.Add(addFhModel);
            MessageBox.Show("添加成功!");
            BLL.v_failure_tree vftBll = new BLL.v_failure_tree();
            father.vftList = vftBll.GetModelList("ft_addtime='" + now.ToString("yyyy-MM-dd HH:mm:ss") + "'");
            father.ListViewLoadData();
            this.Close();
        }
Exemple #3
0
        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.failure_tree   ftBll       = new BLL.failure_tree();
            Model.failure_tree editFtModel = new Model.failure_tree();
            editFtModel.ft_id      = editModel.ft_id;
            editFtModel.ft_adduser = editModel.ft_adduser;
            editFtModel.ft_caseid  = editModel.ft_caseid;
            editFtModel.ft_addtime = editModel.ft_addtime;
            editFtModel.ft_keywd   = txtKeyWds.Text.Trim();
            editFtModel.ptype_id   = plnTypIdLst[cmbPlaneType.SelectedIndex];
            editFtModel.system_id  = flSysIdLst[cmbFailSystem.SelectedIndex];
            editFtModel.tpoint_id  = tmPntIdLst[cmbTimePoint.SelectedIndex];
            editFtModel.experience = rchTxtExperience.Text;
            if (picTreeChanged)
            {
                editFtModel.ft_pic = getImgToByte(picBxTree.Image);
            }
            else
            {
                editFtModel.ft_pic = editModel.ft_pic;
            }
            if (picGridChanged)
            {
                editFtModel.ft_grid = getImgToByte(picBxGrid.Image);
            }
            else
            {
                editFtModel.ft_grid = editModel.ft_grid;
            }

            ftBll.Update(editFtModel);
            MessageBox.Show("修改成功!");
            BLL.v_failure_tree vftBll = new BLL.v_failure_tree();
            father.vftList = vftBll.GetModelList("ft_id=" + editFtModel.ft_id);
            father.ListViewLoadData();
            this.Close();
        }