Пример #1
0
 /// <summary>
 /// 将grid中的值赋值给实体
 ///  edit by 王冀 2012-11-9
 ///  edit by 王冀 2012-11-29
 /// </summary>
 /// <param name="foucesRow"></param>
 /// <returns></returns>
 private ConfigReduction SetReductEntityByRow(DataRow foucesRow)
 {
     try
     {
         if (foucesRow == null)
         {
             return(null);
         }
         ConfigReduction myReduction = new ConfigReduction();
         myReduction.REDUCEPOINT     = foucesRow["REDUCEPOINT"].ToString();
         myReduction.PROBLEMDESC     = foucesRow["PROBLEM_DESC"].ToString();
         myReduction.Valid           = foucesRow["VALID"].ToString();
         myReduction.ID              = foucesRow["ID"].ToString();
         myReduction.ParentsCode     = foucesRow["ccode"].ToString();
         myReduction.Parents         = foucesRow["CNAME"].ToString();
         myReduction.Child           = foucesRow["CHILDNAME"].ToString();
         myReduction.ChildCode       = foucesRow["childcode"].ToString();
         myReduction.Isauto          = foucesRow["ISAUTO"].ToString();
         myReduction.Selectcondition = foucesRow["Selectcondition"].ToString();
         return(myReduction);
     }
     catch (Exception ex)
     {
         DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
         throw;
     }
 }
Пример #2
0
 /// <summary>
 /// 将实体值赋给页面元素
 /// edit by 王冀 2012-11-9
 /// edit by 王冀 2012-11-29
 /// </summary>
 /// <param name="configEmrPoint"></param>
 private void SetReductPageValue(ConfigReduction configReduction)
 {
     try
     {
         if (configReduction == null)
         {
             return;
         }
         txtPoint.Text = configReduction.REDUCEPOINT;
         cmbValidName.SelectedIndex = Int32.Parse(configReduction.Valid);
         memoDESC.Text = configReduction.PROBLEMDESC;
         lookUpEditParents.EditValue = configReduction.ParentsCode;
         lookUpEditChild.EditValue   = configReduction.ChildCode;
         if (configReduction.Isauto == "0" || configReduction.Isauto == "1")
         {
             comboBoxEdit1.SelectedIndex = Int32.Parse(configReduction.Isauto);
         }
         else
         {
             comboBoxEdit1.SelectedIndex = -1;
         }
         textEdit2.Text = configReduction.Selectcondition;
     }
     catch (Exception ex)
     {
         DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
     }
 }
Пример #3
0
 /// <summary>
 ///  将页面值加到实体里(评分类别配置里的实体)
 ///  edit by 王冀 2012-11-9
 ///  edit by 王冀 2012-11-29
 /// </summary>
 /// <returns></returns>
 private ConfigReduction SetEntityReduction()
 {
     try
     {
         ConfigReduction ReductionInfo = new ConfigReduction();
         //ReductionInfo.CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
         ReductionInfo.CreateTime      = string.Format("{0:yyyy-MM-dd HH:mm:ss}", DateTime.Now);
         ReductionInfo.CreateUserID    = m_app.User.Id;
         ReductionInfo.CreateUserName  = m_app.User.Name;
         ReductionInfo.PROBLEMDESC     = memoDESC.Text.ToString().Trim();
         ReductionInfo.REDUCEPOINT     = txtPoint.Text.ToString();
         ReductionInfo.Valid           = "1";
         ReductionInfo.ChildCode       = lookUpEditChild.EditValue.ToString();
         ReductionInfo.ParentsCode     = lookUpEditParents.EditValue.ToString();
         ReductionInfo.Isauto          = comboBoxEdit1.Text.ToString() == "" ? "" : comboBoxEdit1.SelectedIndex.ToString();
         ReductionInfo.Selectcondition = textEdit2.Text;
         DataRow foucesRow = gridView4.GetDataRow(gridView4.FocusedRowHandle);
         if (foucesRow != null)
         {
             ReductionInfo.ID = foucesRow["id"].ToString();
         }
         return(ReductionInfo);
     }
     catch (Exception ex)
     {
         DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
         throw;
     }
 }
Пример #4
0
 /// <summary>
 /// 将实体值赋给页面元素
 /// </summary>
 /// <param name="configEmrPoint"></param>
 private void SetReductPageValue(ConfigReduction configReduction)
 {
     if (configReduction == null)
     {
         return;
     }
     txtPoint.Text = configReduction.REDUCEPOINT;
     cmbValidName.SelectedIndex = Int32.Parse(configReduction.Valid);
     memoDESC.Text            = configReduction.PROBLEMDESC;
     cboUserType.SelectedItem = configReduction.Usertype;
 }
Пример #5
0
        /// <summary>
        /// 将grid中的值赋值给实体
        /// </summary>
        /// <param name="foucesRow"></param>
        /// <returns></returns>
        private ConfigReduction SetReductEntityByRow(DataRow foucesRow)
        {
            if (foucesRow == null)
            {
                return(null);
            }
            ConfigReduction myReduction = new ConfigReduction();

            myReduction.REDUCEPOINT = foucesRow["REDUCEPOINT"].ToString();
            myReduction.PROBLEMDESC = foucesRow["PROBLEM_DESC"].ToString();
            myReduction.Valid       = foucesRow["VALID"].ToString();
            myReduction.ID          = foucesRow["ID"].ToString();
            myReduction.Usertype    = foucesRow["USER_TYPE"].ToString();
            return(myReduction);
        }
Пример #6
0
        /// <summary>
        ///  将页面值加到实体里(评分类别配置里的实体)
        /// </summary>
        /// <returns></returns>
        private ConfigReduction SetEntityReduction()
        {
            ConfigReduction ReductionInfo = new ConfigReduction();

            //ReductionInfo.CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            ReductionInfo.CreateTime     = string.Format("{0:yyyy-MM-dd HH:mm:ss}", DateTime.Now);
            ReductionInfo.CreateUserID   = m_app.User.Id;
            ReductionInfo.CreateUserName = m_app.User.Name;
            ReductionInfo.PROBLEMDESC    = memoDESC.Text.ToString().Trim();
            ReductionInfo.REDUCEPOINT    = txtPoint.Text.ToString();
            ReductionInfo.Valid          = cmbValidName.SelectedIndex.ToString();
            ReductionInfo.Usertype       = cboUserType.SelectedItem.ToString();
            DataRow foucesRow = gridView4.GetDataRow(gridView4.FocusedRowHandle);

            if (foucesRow != null)
            {
                ReductionInfo.ID = foucesRow["id"].ToString();
            }
            return(ReductionInfo);
        }
Пример #7
0
 /// <summary>
 /// 进行保存操作
 /// </summary>
 /// <param name="configEmrPoint"></param>
 /// <returns></returns>
 private bool SaveReductionData(ConfigReduction configReduction)
 {
     try
     {
         string edittype = "";
         if (m_EditState == EditState.Add)
         {
             edittype = "1";
         }
         else
         {
             edittype = "2";
         }
         m_SqlManager.SaveReductionData(configReduction, edittype);
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Пример #8
0
 /// <summary>
 /// 保存操作(更新或者新增)(评分配置里的)
 /// </summary>
 /// <param name="configReduction"></param>
 /// <param name="edittype"></param>
 internal string SaveReductionData(ConfigReduction configReduction, string edittype)
 {
     SqlParameter[] sqlParam = new SqlParameter[]
     {
         new SqlParameter("@EditType", SqlDbType.VarChar),
         new SqlParameter("@REDUCEPOINT", SqlDbType.VarChar),  //扣的分数
         new SqlParameter("@PROBLEMDESC", SqlDbType.VarChar),  //扣分理由
         new SqlParameter("@CREATEUSER", SqlDbType.VarChar),   //创建人
         new SqlParameter("@CREATETIME", SqlDbType.VarChar),   //创建时间
         new SqlParameter("@ID", SqlDbType.VarChar),
         new SqlParameter("@Valid", SqlDbType.VarChar),
         new SqlParameter("@UserType", SqlDbType.VarChar)
     };
     sqlParam[0].Value = edittype;
     sqlParam[1].Value = configReduction.REDUCEPOINT;
     sqlParam[2].Value = configReduction.PROBLEMDESC;
     sqlParam[3].Value = configReduction.CreateUserID;
     sqlParam[4].Value = configReduction.CreateTime;
     sqlParam[5].Value = configReduction.ID;
     sqlParam[6].Value = configReduction.Valid;
     sqlParam[7].Value = configReduction.Usertype;
     return(m_app.SqlHelper.ExecuteDataSet("EMRQCMANAGER.usp_Edit_RHConfigReduction", sqlParam, CommandType.StoredProcedure).Tables[0].Rows[0][0].ToString());
 }