/// <summary> /// 数据初始化 /// </summary> protected void Init() { #region 加载科室 Neusoft.HISFC.BizLogic.Manager.Department deptManager = new Neusoft.HISFC.BizLogic.Manager.Department(); ArrayList alDept = deptManager.GetDeptmentAll(); if (alDept == null) { MessageBox.Show("获取科室列表出错" + deptManager.Err); return; } this.cmbDept.AddItems(alDept); this.cmbNoticeDept.AddItems(alDept); #endregion #region 加载功能组 Neusoft.HISFC.BizLogic.Manager.SysGroup sysGroupManager = new Neusoft.HISFC.BizLogic.Manager.SysGroup(); //ArrayList alSysGroup = sysGroupManager.GetList(); //if (alSysGroup == null) //{ // MessageBox.Show("获取功能组列表出错" + sysGroupManager.Err); // return; //} //this.cmbSysGroup.AddItems(alSysGroup); #endregion }
/// <summary> /// 刷新列表 /// </summary> private void RefreshGroupList() { Neusoft.HISFC.BizLogic.Manager.SysGroup sysGroupManager = new Neusoft.HISFC.BizLogic.Manager.SysGroup(); //{1D7BC020-92AC-431b-B27B-1BFBEB0E566B} 根据操作员是否为管理员权限 决定SysGroup列表显示 Neusoft.HISFC.Models.Base.Employee person = (Neusoft.HISFC.Models.Base.Employee)Neusoft.FrameWork.Management.Connection.Operator; ArrayList al = new ArrayList(); if (person.IsManager) { al = sysGroupManager.GetList(); this.chkManager.Visible = true; this.chkPWD.Visible = true; this.lblEmployee.Visible = true; this.txtLoginID.Enabled = true; } else { al = person.PermissionGroup; this.txtLoginID.Enabled = false; this.chkManager.Visible = false; this.chkPWD.Visible = false; this.lblEmployee.Visible = false; } this.tvGroup1.Nodes[0].Nodes.Clear(); foreach (Neusoft.HISFC.Models.Admin.SysGroup obj in al) { TreeNode node = new TreeNode(obj.Name); node.ImageIndex = 2; node.SelectedImageIndex = 2; node.Tag = obj; this.tvGroup1.Nodes[0].Nodes.Add(node); } foreach (TreeNode node in this.tvGroup1.Nodes[0].Nodes) { TreeNode pNode = null; SearchParentNode(this.tvGroup1.Nodes[0], node.Tag, ref pNode); if (pNode != null) { node.Parent.Nodes.Remove(node); pNode.Nodes.Add(node); } } this.tvGroup1.ExpandAll(); }
public tvGroup() { if (DesignMode == false) { try { sysGroupManager = new Neusoft.HISFC.BizLogic.Manager.SysGroup(); this.Init(); this.RefreshGroupList(); } catch (Exception ex) { MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("创建组列表出错!") + ex.Message); } } }
/// <summary> /// 显示列表 /// </summary> public void ShowList() { //清空列表 this.tvList.Nodes.Clear(); this.tvList.ImageList = this.tvList.groupImageList; //显示根节点 Neusoft.HISFC.Models.Admin.SysModelFunction obj = new Neusoft.HISFC.Models.Admin.SysModelFunction(); obj.ID = ""; //显示所有数据 TreeNode node = new TreeNode(); node.Text = "常数维护"; node.ImageIndex = 0; node.SelectedImageIndex = node.ImageIndex; //node.Tag = obj; this.tvList.Nodes.Add(node); //取当前用户组中可以维护的常数 Neusoft.HISFC.BizLogic.Manager.SysGroup group = new Neusoft.HISFC.BizLogic.Manager.SysGroup(); // // I don't think this is a good idea to save the info in this class // Robin 2006-11-14 Neusoft.HISFC.Models.Base.Employee user = Neusoft.FrameWork.Management.Connection.Operator as Neusoft.HISFC.Models.Base.Employee; ArrayList al = group.GetConstByGroup(user.CurrentGroup.ID); if (al == null) { MessageBox.Show("没有可以维护的常数,请在系统管理中设置常数维护项"); return; } //显示常数维护数据 foreach (Neusoft.HISFC.Models.Admin.SysModelFunction info in al) { node = new TreeNode(); node.Text = info.Name; node.ImageIndex = 3; node.SelectedImageIndex = 4; node.Tag = info; this.tvList.Nodes[0].Nodes.Add(node); } this.tvList.Nodes[0].ExpandAll(); }