Beispiel #1
0
        /// <summary>
        /// 加载字典数据
        /// </summary>
        private void m_mthLoadData()
        {
            long l = 0;

            dtRecord = null;

            if (ParmType == 1)
            {
                clsDcl_Charge objCharge = new clsDcl_Charge();
                l = objCharge.m_lngGetDeptArea(out dtRecord, 2);
            }
            else if (ParmType == 2 || ParmType == 3)
            {
                clsDcl_CommonFind objFind = new clsDcl_CommonFind();
                l = objFind.m_lngGetBedinfo(ParmAreaID, 0, out dtRecord);
            }

            if (l > 0)
            {
                this.m_mthFillArea("1=1");
            }
        }
Beispiel #2
0
        /// <summary>
        /// 建树
        /// </summary>
        /// <param name="dt"></param>
        public void m_mthLoadArea(DataTable dt)
        {
            //根节点id
            string rootId = "root";
            //根节点Text
            string rootName = "病区列表";

            //建根节点
            TreeNode tnRoot = new TreeNode(rootName);

            tnRoot.Tag                = rootId;
            tnRoot.ImageIndex         = 0;
            tnRoot.SelectedImageIndex = 0;
            this.m_objViewer.tvArea.Nodes.Add(tnRoot);

            if (dt.Rows.Count == 0)
            {
                return;
            }
            else
            {
                objSvc.m_lngGetBedinfo("%", 0, out dtRecord);
            }

            //找默认科室(病区)
            ArrayList objDeptID = new ArrayList();

            clsDepartmentVO[] objEmpDeptArr;
            this.m_objComInfo.m_mthGetDepartmentByUserID(this.m_objViewer.LoginInfo.m_strEmpID, out objEmpDeptArr);
            if (objEmpDeptArr != null)
            {
                for (int i = 0; i < objEmpDeptArr.Length; i++)
                {
                    objDeptID.Add(((clsDepartmentVO)objEmpDeptArr[i]).strDeptID);
                }
            }

            //节点id
            string tnId = "";
            //节点Text
            string tnName = "";
            //第一科室
            string FirstDeptID = "";
            //第一节点
            TreeNode FirstTn = null;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string deptid = dt.Rows[i]["deptid_chr"].ToString();

                if (this.m_objViewer.ShowScope == 1)
                {
                    if (objDeptID.IndexOf(deptid) == -1)
                    {
                        continue;
                    }
                }

                tnId   = deptid;
                tnName = "[" + dt.Rows[i]["code_vchr"].ToString().Trim() + "] " + dt.Rows[i]["deptname_vchr"].ToString();
                TreeNode tn = new TreeNode(tnName);
                tn.Tag                = tnId;
                tn.ImageIndex         = 1;
                tn.SelectedImageIndex = 3;
                tnRoot.Nodes.Add(tn);

                if (i == 0)
                {
                    FirstDeptID = deptid;
                    FirstTn     = tn;
                }
            }

            this.m_objViewer.tvArea.ExpandAll();

            if (FirstDeptID != "")
            {
                this.m_objViewer.tvArea.SelectedNode = FirstTn;
                this.m_mthShowBedInfo(FirstDeptID);
            }
        }