Ejemplo n.º 1
0
 /// <summary>
 /// 操作病案首页评分标准表
 /// </summary>
 /// <returns>iem_mainpage_qc首页评分标准表</returns>
 public static DataTable OperIemMainPageQC(IemMainpageQC qc, OperType opertype)
 {
     SqlParameter[] sqlParam = new SqlParameter[]
     {
         new SqlParameter("@OPERTYPE", SqlDbType.VarChar),
         new SqlParameter("@ID", SqlDbType.VarChar),
         new SqlParameter("@TABLETYPE", SqlDbType.VarChar),
         new SqlParameter("@FIELDS", SqlDbType.VarChar),
         new SqlParameter("@FIELDSVALUE", SqlDbType.VarChar),
         new SqlParameter("@CONDITIONTABLETYPE", SqlDbType.VarChar),
         new SqlParameter("@CONDITIONFIELDS", SqlDbType.VarChar),
         new SqlParameter("@CONDITIONFIELDSVALUE", SqlDbType.VarChar),
         new SqlParameter("@REDUCTSCORE", SqlDbType.VarChar),
         new SqlParameter("@REDUCTREASON", SqlDbType.VarChar),
         new SqlParameter("@VALIDE", SqlDbType.VarChar)
     };
     sqlParam[0].Value  = ((int)opertype).ToString();
     sqlParam[1].Value  = qc.ID;
     sqlParam[2].Value  = qc.TableType;
     sqlParam[3].Value  = qc.Fields;
     sqlParam[4].Value  = qc.FieldsValue;
     sqlParam[5].Value  = qc.ConditionTableType;
     sqlParam[6].Value  = qc.ConditionFields;
     sqlParam[7].Value  = qc.ConditionValues;
     sqlParam[8].Value  = qc.ReductScore.ToString();
     sqlParam[9].Value  = qc.ReductReason;
     sqlParam[10].Value = qc.Valide.ToString();
     return(m_SqlHelper.ExecuteDataTable("iem_main_page.usp_operiem_mainpage_qc", sqlParam, CommandType.StoredProcedure));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 删除 edit by 王冀 2012 12 19
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnDel_Click(object sender, EventArgs e)
 {
     try
     {
         if (DialogResult.OK == m_app.CustomMessageBox.MessageShow("确定要删除标准?", DrectSoft.Core.CustomMessageBoxKind.QuestionOkCancel))
         {
             if (this.textEditID.Text == "")
             {
                 m_app.CustomMessageBox.MessageShow("请选择一条删除标准");
                 return;
             }
             m_opertype = OperType.DEL;
             this.FreshOperView();
             IemMainpageQC qc = this.GetQCFromView();
             if (qc == null)
             {
                 return;
             }
             DataAccess.OperIemMainPageQC(qc, m_opertype);
             //DataTable dtMainpageQC = DataAccess.OperIemMainPageQC(qc, OperType.QUERY);
             //this.gridControlConfig.DataSource = dtMainpageQC;
             m_app.CustomMessageBox.MessageShow("删除成功");
             m_opertype = OperType.QUERY;
             this.FreshOperView();
             refreshData();
         }
     }
     catch (Exception ex)
     {
         m_app.CustomMessageBox.MessageShow(ex.Message);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 保存 edit by 王冀 2012 12 19
 /// Modify by xlb 2013-06-18
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (m_opertype == OperType.ADD)
         {
             qc = this.GetQCFromView();
             if (qc == null)
             {
                 return;
             }
             qc.ID = Guid.NewGuid().ToString().Substring(16, 16);
             DataAccess.OperIemMainPageQC(qc, m_opertype);
             m_app.CustomMessageBox.MessageShow("新增成功");
             m_opertype = OperType.QUERY;
             this.FreshOperView();
             refreshData();
         }
         else if (m_opertype == OperType.EDIT)
         {
             int rh = gViewConfig.FocusedRowHandle;
             qc = this.GetQCFromView();
             if (qc == null)
             {
                 return;
             }
             DataAccess.OperIemMainPageQC(qc, m_opertype);
             m_app.CustomMessageBox.MessageShow("修改成功");
             m_opertype = OperType.QUERY;
             this.FreshOperView();
             refreshData();
             gViewConfig.FocusedRowHandle = rh;
         }
     }
     catch (Exception ex)
     {
         m_app.CustomMessageBox.MessageShow(ex.Message);
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 将编辑区的值传给实体  edit by 王冀 2012 12 19
        /// </summary>
        /// <returns></returns>
        private IemMainpageQC GetQCFromView()
        {
            try
            {
                if (comboBoxEditTableType.SelectedIndex == -1)
                {
                    m_app.CustomMessageBox.MessageShow("表类型不能为空");
                    this.comboBoxEditTableType.Focus();
                    return(null);
                }
                if (textEditFields.Text.Trim() == "")
                {
                    m_app.CustomMessageBox.MessageShow("校验字段不能为空");
                    this.textEditFields.Focus();
                    return(null);
                }
                if (rbValues.Checked && this.textEditValues.Text.Trim() == "")
                {
                    m_app.CustomMessageBox.MessageShow("校验值不能为空");
                    this.textEditValues.Focus();
                    return(null);
                }
                if (chkHaveCondition.Checked)
                {
                    if (comboBoxEditConditionTable.SelectedIndex == -1)
                    {
                        m_app.CustomMessageBox.MessageShow("条件表类型不能为空");
                        this.comboBoxEditConditionTable.Focus();
                        return(null);
                    }
                    if (textEditConditionFields.Text.Trim() == "")
                    {
                        m_app.CustomMessageBox.MessageShow("条件校验字段不能为空");
                        this.textEditConditionFields.Focus();
                        return(null);
                    }
                    if (rbConditionValues.Checked && this.textEditConditionValues.Text.Trim() == "")
                    {
                        m_app.CustomMessageBox.MessageShow("条件值不能为空");
                        this.textEditConditionValues.Focus();
                        return(null);
                    }
                }
                if (textEditReductScore.Text.Trim() == "")
                {
                    m_app.CustomMessageBox.MessageShow("扣分值不能为空");
                    this.textEditReductScore.Focus();
                    return(null);
                }
                if (textEditReductReason.Text.Trim() == "")
                {
                    m_app.CustomMessageBox.MessageShow("扣分原因不能为空");
                    this.textEditReductReason.Focus();
                    return(null);
                }
                if (this.cmbValid.SelectedIndex == -1)
                {
                    m_app.CustomMessageBox.MessageShow("有效性不能为空");
                    this.cmbValid.Focus();
                    return(null);
                }
                IemMainpageQC qc = new IemMainpageQC();
                qc.ID        = textEditID.Text.Trim();
                qc.TableType = comboBoxEditTableType.SelectedIndex.ToString();
                qc.Fields    = textEditFields.Text.Trim();
                if (rbNotNull.Checked)
                {
                    qc.FieldsValue = "不为空";
                }
                else
                {
                    qc.FieldsValue = textEditValues.Text.Trim();
                }
                if (chkHaveCondition.Checked)
                {
                    qc.ConditionTableType = comboBoxEditTableType.SelectedIndex.ToString();
                    qc.ConditionFields    = textEditConditionFields.Text.Trim();
                    if (rbConditionNotNull.Checked)
                    {
                        qc.ConditionValues = "不为空";
                    }
                    else
                    {
                        qc.ConditionValues = textEditConditionValues.Text.Trim();
                    }
                }
                try
                {
                    qc.ReductScore = float.Parse(textEditReductScore.Text.Trim());
                }
                catch (Exception)
                {
                    m_app.CustomMessageBox.MessageShow("分数为无效数字");
                    this.textEditReductScore.Focus();
                    return(null);
                }

                qc.ReductReason = textEditReductReason.Text.Trim();
                qc.Valide       = cmbValid.SelectedIndex;
                return(qc);
            }
            catch (Exception)
            {
                return(null);

                throw;
            }
        }