예제 #1
0
        /// <summary>
        /// 获取选项的默认选项
        /// </summary>
        /// <param name="dataRangeStr"></param>
        /// <returns></returns>
        public static List <BaseDictory> GetDefaultOption(string dataRangeStr)
        {
            List <BaseDictory> baseOptionList = new List <BaseDictory>();

            if (string.IsNullOrEmpty(dataRangeStr))
            {
                return(baseOptionList);
            }
            try
            {
                XmlDocument xmldoc = new XmlDocument();
                xmldoc.LoadXml(dataRangeStr);
                XmlNodeList xmlNodeList = xmldoc.SelectNodes("/ValueRange/Option");
                if (xmlNodeList == null || xmlNodeList.Count == 0)
                {
                    return(baseOptionList);
                }
                foreach (XmlNode item in xmlNodeList)
                {
                    if (item.Attributes["IsDefault"] != null &&
                        item.Attributes["IsDefault"].Value.ToUpper() == "TRUE")
                    {
                        BaseDictory baseOption = new BaseDictory();
                        baseOption.Id   = item.Attributes["Id"].Value;
                        baseOption.Name = item.InnerText;
                        baseOptionList.Add(baseOption);
                    }
                }
                return(baseOptionList);
            }
            catch (Exception ex)
            {
                return(baseOptionList);
            }
        }
예제 #2
0
 //根据配置单中科室和病区状况初始化多选控件选中状态
 private void InitChcomBoxChecked(CheckedListBoxControl chboxList, List <BaseDictory> baseDictoryListChecked)
 {
     try
     {
         if (chboxList.Items == null)
         {
             return;
         }
         foreach (CheckedListBoxItem boxitem in chboxList.Items)
         {
             boxitem.CheckState = CheckState.Unchecked;
             BaseDictory baseDictoryChbox = boxitem.Value as BaseDictory;
             if (baseDictoryListChecked == null)
             {
                 continue;
             }
             foreach (var baseitem in baseDictoryListChecked)
             {
                 if (baseitem.Id == baseDictoryChbox.Id)
                 {
                     boxitem.CheckState = CheckState.Checked;
                     break;
                 }
             }
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }
예제 #3
0
 private void hyLoadType_Click(object sender, EventArgs e)
 {
     try
     {
         BaseDictory baseDictory = cboElementType.SelectedItem as BaseDictory;
         if (baseDictory == null)
         {
             return;
         }
         if (string.IsNullOrEmpty(medOptins.Text))
         {
             if (baseDictory.Id == "S2" || baseDictory.Id == "S3" || baseDictory.Id == "S9")
             {
                 SetS2S3S9Xml();
             }
             else if (baseDictory.Id == "S1" || baseDictory.Id == "S4")
             {
                 SetS1S4Xml();
             }
             else if (baseDictory.Id == "N")
             {
                 SetNXml();
             }
         }
     }
     catch (Exception ex)
     {
         MyMessageBox.Show(1, ex);
     }
 }
예제 #4
0
 //数据元搜索
 private void SearchDateElement()
 {
     try
     {
         DataElementEntity dataElementEntitySearch = new CommonTableConfig.DataElementEntity();
         dataElementEntitySearch.ElementId   = txtElementId.Text.Trim();
         dataElementEntitySearch.ElementName = txtElementName.Text.Trim();
         dataElementEntitySearch.ElementPYM  = txtPYM.Text.Trim();
         BaseDictory baseDictory = cboClass.SelectedItem as BaseDictory;
         if (baseDictory == null || baseDictory.Id == null)
         {
             dataElementEntitySearch.ElementClass = "";
         }
         else
         {
             dataElementEntitySearch.ElementClass = baseDictory.Id;
         }
         List <DataElementEntity> dataElementEntityList = dataElemntBiz.GetDataElement(dataElementEntitySearch);
         gcdDataElement.DataSource = dataElementEntityList;
     }
     catch (Exception e)
     {
         throw e;
     }
 }
예제 #5
0
        public bool SaveDataElement()
        {
            try
            {
                string message   = "";
                bool   valResult = ValidateInfo(ref message);
                if (valResult == false)
                {
                    m_app.CustomMessageBox.MessageShow(message);
                    return(false);
                }
                m_dataElementEntity.ElementId       = txtElementId.Text;
                m_dataElementEntity.ElementName     = txtElementName.Text;
                m_dataElementEntity.ElementForm     = txtElementForm.Text;
                m_dataElementEntity.ElementRange    = medOptins.Text;
                m_dataElementEntity.ElementDescribe = medElementDescribe.Text;

                BaseDictory baseitemType = cboElementType.SelectedItem as BaseDictory;
                m_dataElementEntity.ElementType = baseitemType.Id;

                BaseDictory baseitem = cboElementClass.SelectedItem as BaseDictory;
                m_dataElementEntity.ElementClass = baseitem.Id;
                m_dataElementEntity.IsDataElemet = chboxIsDataElement.Checked == true ? "1" : "0";
                DataElemntBiz dataElemntBiz = new DataElemntBiz(m_app);

                bool result = dataElemntBiz.SaveDataElement(m_dataElementEntity, ref message);
                if (!result)
                {
                    m_app.CustomMessageBox.MessageShow(message);
                }
                else
                {
                    m_app.CustomMessageBox.MessageShow("保存成功");
                }
                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }