コード例 #1
0
        /// <summary>
        /// 取全部科室列表
        /// </summary>
        public void BeforeLoad(string statCode)
        {
            try
            {
                Neusoft.HISFC.BizLogic.Manager.DepartmentStatManager statMgr = new Neusoft.HISFC.BizLogic.Manager.DepartmentStatManager();
                //创建科室分类等级树,返回一级节点列表
                ArrayList depts = statMgr.LoadLevelViewDepartemt(statCode);
                foreach (Neusoft.HISFC.Models.Base.DepartmentStat info in depts)
                {
                    hashTable.Add(info.PkID, info);
                }

                //{31FD985A-A165-4812-8CBE-CA2E2C7B9A7B}  加载科室编码、名称对照字典
                Neusoft.HISFC.BizLogic.Manager.Department deptManager = new Neusoft.HISFC.BizLogic.Manager.Department();
                ArrayList alDept = deptManager.GetDeptAllUserStopDisuse();
                if (alDept != null)
                {
                    this.deptNameDictionary = new Dictionary <string, string>();
                    foreach (Neusoft.HISFC.Models.Base.Department info in alDept)
                    {
                        this.deptNameDictionary.Add(info.ID, info.Name);
                    }
                }

                //在TreeView总显示科室信息
                AddView(statCode);
            }
            catch { }
        }
コード例 #2
0
        /// <summary>
        /// 科室列表数据加载
        /// </summary>
        /// <returns>数据加载成功返回1 加载存在错误返回-1</returns>
        protected virtual int InitDept()
        {
            Neusoft.HISFC.BizLogic.Manager.Department deptManagment = new Neusoft.HISFC.BizLogic.Manager.Department();
            ArrayList deptList = deptManagment.GetDeptmentAll();

            if (deptList == null)
            {
                System.Windows.Forms.MessageBox.Show("获取科室数据发生错误" + deptManagment.Err);
                return(1);
            }

            System.Collections.Hashtable hsDeptList = new Hashtable();

            pList  = new List <Neusoft.HISFC.Models.Base.Department>();
            piList = new List <Neusoft.HISFC.Models.Base.Department>();

            #region  照科室类型加载

            foreach (Neusoft.HISFC.Models.Base.Department dept in deptList)
            {
                hsDeptList.Add(dept.ID, dept);

                if (dept.DeptType.ID.ToString() == Neusoft.HISFC.Models.Base.EnumDepartmentType.P.ToString())
                {
                    pList.Add(dept);
                    continue;
                }
                if (dept.DeptType.ID.ToString() == Neusoft.HISFC.Models.Base.EnumDepartmentType.PI.ToString())
                {
                    piList.Add(dept);
                    continue;
                }
            }

            #endregion

            //使用科室结构树显示时,代码继续执行。否则返回
            if (!this.isUseDeptStruct)
            {
                return(0);
            }


            #region  照科室结构加载

            pList.Clear();
            piList.Clear();

            //创建科室分类等级树,返回一级节点列表
            Neusoft.HISFC.BizLogic.Manager.DepartmentStatManager statMgr = new Neusoft.HISFC.BizLogic.Manager.DepartmentStatManager();
            ArrayList deptStruct = statMgr.LoadLevelViewDepartemt("03");
            if (deptStruct == null)
            {
                System.Windows.Forms.MessageBox.Show("获取科室结构数据发生错误" + deptManagment.Err);
                return(1);
            }
            foreach (Neusoft.HISFC.Models.Base.DepartmentStat info in deptStruct)
            {
                if (info.DeptCode == this.piStatCode)       //加载大类药库
                {
                    foreach (Neusoft.HISFC.Models.Base.DepartmentStat piInfo in info.Childs)
                    {
                        if (hsDeptList.ContainsKey(piInfo.DeptCode))
                        {
                            piList.Add(hsDeptList[piInfo.ID] as Neusoft.HISFC.Models.Base.Department);
                        }
                    }
                }
                if (info.DeptCode == this.pStatCode)        //加载大类药房
                {
                    foreach (Neusoft.HISFC.Models.Base.DepartmentStat pInfo in info.Childs)
                    {
                        if (hsDeptList.ContainsKey(pInfo.DeptCode))
                        {
                            pList.Add(hsDeptList[pInfo.ID] as Neusoft.HISFC.Models.Base.Department);
                        }
                    }
                }
            }

            #endregion

            return(1);
        }