예제 #1
0
        /// <summary>
        /// 加载参数模板
        /// </summary>
        private void LoadParameterTemplate()
        {
            string      xmlText = Properties.Resources.Parameters;
            XmlDocument xd      = new XmlDocument();

            xd.LoadXml(xmlText);
            htStandardParameters = new Hashtable();
            foreach (object obj in Enum.GetValues(typeof(ParameterCatalog)))
            {
                ParameterCatalog catalog = (ParameterCatalog)obj;

                XmlNodeList xnl = xd.GetElementsByTagName(catalog.ToString());
                if (xnl.Count == 0)
                {
                    throw new Exception("Xml file error!");
                }

                if (catalog != ParameterCatalog.药品管理)
                {
                    List <Parameter> lstParameter = GetStandardParameterList(xnl[0]);
                    htStandardParameters.Add(catalog, lstParameter);
                }
                else
                {
                    List <Parameter> lstParameter = new List <Parameter>();

                    foreach (XmlNode nd in xnl[0].ChildNodes)
                    {
                        List <Parameter> lstTemp = GetStandardParameterList(nd);
                        lstParameter.AddRange(lstTemp);
                    }
                    htStandardParameters.Add(catalog, lstParameter);
                }
            }
        }
예제 #2
0
        /// <summary>
        /// 创建功能分类树
        /// </summary>
        private void CreateCatalogTree()
        {
            TreeNode ndRoot = new TreeNode("功能分类目录", 0, 0);

            tvwModels.Nodes.Add(ndRoot);
            foreach (object obj in Enum.GetValues(typeof(ParameterCatalog)))
            {
                TreeNode         catalogNode = new TreeNode();
                ParameterCatalog catalog     = (ParameterCatalog)obj;
                catalogNode.Text               = catalog.ToString();
                catalogNode.ImageIndex         = 1;
                catalogNode.SelectedImageIndex = 2;
                catalogNode.Tag = catalog;
                catalogNode.Expand();
                ndRoot.Nodes.Add(catalogNode);
            }
            tvwModels.ExpandAll();
        }