Esempio n. 1
0
 /// <summary>
 /// 将实体值赋给页面元素
 /// </summary>
 /// <param name="configEmrPoint"></param>
 private void SetPageValue(ConfigEmrPoint configEmrPoint)
 {
     if (configEmrPoint == null)
     {
         return;
     }
     txtId.Text             = configEmrPoint.CChildCode;
     txtChildName.Text      = configEmrPoint.CChildName;
     cmbValid.SelectedIndex = Int32.Parse(configEmrPoint.Valid);
     lookUpCCNAME.CodeValue = configEmrPoint.CCODE;
 }
Esempio n. 2
0
        /// <summary>
        /// 将grid中的值赋值给实体
        /// </summary>
        /// <param name="foucesRow"></param>
        /// <returns></returns>
        private ConfigEmrPoint SetEntityByDataRow(DataRow foucesRow)
        {
            if (foucesRow == null)
            {
                return(null);
            }
            ConfigEmrPoint myConfigEmr = new ConfigEmrPoint();

            myConfigEmr.CChildCode = foucesRow["childcode"].ToString();
            myConfigEmr.CChildName = foucesRow["childname"].ToString();
            myConfigEmr.CCODE      = foucesRow["ccode"].ToString();
            myConfigEmr.Valid      = foucesRow["valid"].ToString();
            myConfigEmr.ID         = foucesRow["id"].ToString();
            return(myConfigEmr);
        }
Esempio n. 3
0
        /// <summary>
        ///  将页面值加到实体里(评分类别配置里的实体)
        /// </summary>
        /// <returns></returns>
        private ConfigEmrPoint SetEntityByPage()
        {
            ConfigEmrPoint configemrPoint = new ConfigEmrPoint();

            configemrPoint.CCODE = lookUpCCNAME.CodeValue; //大分类编号
            //edit by wyt 子类编号通过guid自动生成 如果已有编号,则不作变化
            configemrPoint.CChildCode = txtId.Text.Trim(); //小分类编号
            if (configemrPoint.CChildCode == "")
            {
                configemrPoint.CChildCode = Guid.NewGuid().ToString().Substring(0, 16);
            }
            configemrPoint.CChildName = txtChildName.Text.Trim();//小分类名称
            configemrPoint.Valid      = "1";
            DataRow foucesRow = gViewConfigPoint.GetDataRow(gViewConfigPoint.FocusedRowHandle);

            if (foucesRow != null)
            {
                configemrPoint.ID = foucesRow["id"].ToString();
            }
            return(configemrPoint);
        }
Esempio n. 4
0
 /// <summary>
 /// 进行保存操作
 /// </summary>
 /// <param name="configEmrPoint"></param>
 /// <returns></returns>
 private bool SaveData(ConfigEmrPoint configEmrPoint)
 {
     try
     {
         string edittype = "";
         if (m_EditState == EditState.Add)
         {
             edittype = "1";
         }
         else
         {
             edittype = "2";
         }
         m_SqlManager.SaveData(configEmrPoint, edittype);
         lookUpCCNAME.Enabled = false;
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }