protected override void OnLoad(EventArgs e) { person = Neusoft.FrameWork.Management.Connection.Operator as Neusoft.HISFC.Models.Base.Employee; if (person.PermissionGroup == null) { return; } this.lvGroup.Items.Clear(); foreach (Neusoft.FrameWork.Models.NeuObject obj in person.PermissionGroup) { if (obj.Name.Trim() != "") { ListViewItem item = new ListViewItem(obj.Name, 0); item.Text = obj.Name; item.ImageIndex = 0; item.Tag = obj; this.lvGroup.Items.Add(item); } } Neusoft.HISFC.BizLogic.Manager.DepartmentStatManager manager = new Neusoft.HISFC.BizLogic.Manager.DepartmentStatManager(); //System.Collections.ArrayList alDepts = manager.GetMultiDept(person.ID); System.Collections.ArrayList alDepts = manager.GetMultiDeptNew(person.ID); this.cmbDept.AddItems(alDepts); this.cmbDept.Tag = person.Dept.ID; this.lvGroup.Items[0].Selected = true; if (person.PermissionGroup.Count <= 1 && alDepts.Count <= 1) { isEnterToLogin = true; } base.OnLoad(e); this.SetCurrentGroup(person.CurrentGroup, person.Dept); }
public void Init() { this.ImageList = this.deptImageList; this.Nodes.Clear(); #region 显示各个权限科室 Neusoft.HISFC.BizLogic.Manager.DepartmentStatManager deptMagr = new Neusoft.HISFC.BizLogic.Manager.DepartmentStatManager(); Neusoft.HISFC.BizLogic.Manager.Department depts = new Neusoft.HISFC.BizLogic.Manager.Department(); ArrayList deptList = new ArrayList(); TreeNode root = new TreeNode(); root.Text = "所有科室"; root.Tag = "ALL"; root.ImageIndex = 1; this.Nodes.Add(root); TreeNode node; if (this.isAllDept == false) { deptList = deptMagr.GetMultiDeptNew(deptMagr.Operator.ID); foreach (Neusoft.HISFC.Models.Base.DepartmentStat dept in deptList) { node = new TreeNode(); node.Text = dept.Name; node.Tag = dept.ID; node.ImageIndex = 0; root.Nodes.Add(node); } } else { deptList = depts.GetInHosDepartment(); foreach (Neusoft.HISFC.Models.Base.Department dept in deptList) { node = new TreeNode(); node.Text = dept.Name; node.Tag = dept.ID; node.ImageIndex = 0; root.Nodes.Add(node); } } root.ExpandAll(); #endregion }
private void Init(User user) { this.nTreeView1.NodeMouseDoubleClick += new TreeNodeMouseClickEventHandler(nTreeView1_NodeMouseDoubleClick); foreach (Role _role in _roles) { TreeNode _node = new TreeNode(_role.Name); _node.ImageIndex = 0; _node.Tag = _role; this.nTreeView1.Nodes.Add(_node); } this.nTreeView1.ExpandAll(); //初始化科室信息,只通过人员信息判断其能登录的科室。 Neusoft.HISFC.BizLogic.Manager.DepartmentStatManager manager = new Neusoft.HISFC.BizLogic.Manager.DepartmentStatManager(); //System.Collections.ArrayList alDepts = manager.GetMultiDeptNew(currentUser.PersonId); System.Collections.ArrayList alDepts = null; //{36DEFA19-3650-443f-A173-E2A355FA00C2} Neusoft.HISFC.BizLogic.Manager.Person p = new Neusoft.HISFC.BizLogic.Manager.Person(); Neusoft.HISFC.Models.Base.Employee empl = p.GetPersonByID(user.PersonId); ////{A4ED7668-8B4C-441f-9A0D-7029EA040B14} //if (empl.EmployeeType.ID.ToString() == "N") //{ // alDepts = manager.GetMultiDeptNewForNurser(currentUser.PersonId); //} //else //{ // alDepts = manager.GetMultiDeptNew(currentUser.PersonId); //} alDepts = manager.GetMultiDeptNew(currentUser.PersonId); //如果是管理员,默认科室信息。 if (currentUser.Id == "admin") { Neusoft.FrameWork.Models.NeuObject obj = new Neusoft.FrameWork.Models.NeuObject(); obj.ID = "admin"; obj.Name = "admin"; ArrayList list = new ArrayList(); list.Add(obj); this.cmbDept.AddItems(list); } else { this.cmbDept.AddItems(alDepts); } if (alDepts != null) { this.cmbDept.SelectedIndex = 0; } //#region 默认上次登录信息 ////{9DF35C63-1468-4fa5-BBEA-5D00197C0994} yangw 20100831 //Neusoft.HISFC.BizLogic.Manager.UserManager userMgr = new Neusoft.HISFC.BizLogic.Manager.UserManager(); //Neusoft.FrameWork.Models.NeuObject lastLoginInfo = userMgr.GetLastLoginInfo(currentUser.operId, 10); //if (lastLoginInfo != null) //{ // //登录科室 // foreach (Neusoft.FrameWork.Models.NeuObject o in cmbDept.alItems) // { // if (o.ID == lastLoginInfo.ID) // { // cmbDept.Tag = lastLoginInfo.ID; // break; // } // } // //登录模块 // foreach (TreeNode n in nTreeView1.Nodes) // { // if (n.Text == lastLoginInfo.Name) // { // nTreeView1.SelectedNode = n; // break; // } // } //} //#endregion }