コード例 #1
0
ファイル: ConfigPoint.cs プロジェクト: xuanximoming/key
 /// <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);
     }
 }
コード例 #2
0
ファイル: ConfigPoint.cs プロジェクト: xuanximoming/key
 /// <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;
     }
 }
コード例 #3
0
ファイル: ConfigPoint.cs プロジェクト: xuanximoming/key
 /// <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
ファイル: ConfigPoint.cs プロジェクト: xuanximoming/key
 /// <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);
     }
 }