private void tree_AfterSelect(object sender, TreeViewEventArgs e)
        {
            try
            {
                Neusoft.HISFC.Models.Base.Department obj;
                //得到node的Tag
                obj = (Neusoft.HISFC.Models.Base.Department)e.Node.Tag;
                if (obj == null)
                {
                    return;
                }
                ArrayList al = new ArrayList();

                Neusoft.HISFC.BizLogic.Manager.Person      manager  = new Neusoft.HISFC.BizLogic.Manager.Person();
                Neusoft.HISFC.BizLogic.Manager.UserManager manager1 = new Neusoft.HISFC.BizLogic.Manager.UserManager();
                //科室人员
                al = manager.GetEmployee(obj.ID);
                this.neuSpread1_Sheet1.Rows.Count = 0;
                //加载人员信息
                foreach (Neusoft.HISFC.Models.Base.Employee objPerson1 in al)
                {
                    Neusoft.HISFC.Models.Base.Employee objPerson = new Neusoft.HISFC.Models.Base.Employee();
                    objPerson = manager1.GetPerson(objPerson1.ID);
                    this.neuSpread1_Sheet1.Rows.Add(0, 1);
                    this.neuSpread1_Sheet1.Cells[0, 0].Text = objPerson.Name;
                    this.neuSpread1_Sheet1.Cells[0, 1].Text = objPerson.EmployeeType.Name;
                    this.neuSpread1_Sheet1.Cells[0, 2].Text = objPerson.Memo;
                    this.neuSpread1_Sheet1.Rows[0].Tag      = objPerson;

                    if (objPerson.PermissionGroup == null || objPerson.PermissionGroup.Count == 0)
                    {
                        this.neuSpread1_Sheet1.Rows[0].BackColor = Color.Gray;
                    }
                }
            }
            catch
            {
                MessageBox.Show("显示数据失败!", "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="userid"></param>
        /// <param name="currentGroup"></param>
        /// <param name="loginDept"></param>
        public static void SetLoginUser(User currentUser, Neusoft.FrameWork.Models.NeuObject currentGroup, string loginDeptId)
        {
            Neusoft.HISFC.Models.Base.Employee         user        = new Neusoft.HISFC.Models.Base.Employee();
            Neusoft.HISFC.BizLogic.Manager.Department  manager     = new Neusoft.HISFC.BizLogic.Manager.Department();
            Neusoft.HISFC.BizLogic.Manager.UserManager userManager = new Neusoft.HISFC.BizLogic.Manager.UserManager();

            //Neusoft.FrameWork.Public.ObjectHelper helper = new Neusoft.FrameWork.Public.ObjectHelper(manager.QueryValidDept());
            Neusoft.HISFC.Models.Base.Department dept = null;
            if (currentUser.Id.Trim().ToLower() == "admin")
            {
                user.ID        = "admin";
                user.Name      = "manager";
                user.IsManager = true;
            }
            else
            {
                user = userManager.GetPerson(currentUser.PersonId);
                if (user == null)
                {
                    MessageBox.Show("系统中已经没有该用户!");
                    Application.Exit();
                    return;
                }
                if (user.ValidState == Neusoft.HISFC.Models.Base.EnumValidState.Invalid)
                {
                    MessageBox.Show("该用户已经停用!");
                    Application.Exit();
                    return;
                }
                if (user.ValidState == Neusoft.HISFC.Models.Base.EnumValidState.Ignore)
                {
                    MessageBox.Show("该用户已经作废!");
                    Application.Exit();
                    return;
                }
                dept = manager.GetDeptmentById(loginDeptId);
                if (dept == null)
                {
                    MessageBox.Show("获得登录科室信息失败!");
                    Application.Exit();
                    return;
                }

                //if(manager.GetNurseStationFromDept(user.Dept).Count>0)
                //user.Nurse = manager.GetNurseStationFromDept(user.Dept)[0] as Neusoft.FrameWork.Models.NeuObject;
            }
            //user.IsManager = true;

            user.CurrentGroup = currentGroup;

            if (dept != null)
            {
                user.Dept = dept;
                if (dept.DeptType.ID.ToString() == "N")
                {
                    user.Nurse = dept;
                }
                else
                {
                    System.Collections.ArrayList al = manager.GetNurseStationFromDept(dept);
                    if (al != null && al.Count > 0)
                    {
                        user.Nurse = al[0] as Neusoft.FrameWork.Models.NeuObject;
                    }
                    else
                    {
                        user.Nurse = dept;
                    }
                }
            }

            //user.Dept = helper.GetObjectFromID(loginDeptId);
            //if (user.Dept == null)
            //    user.Dept = new Neusoft.FrameWork.Models.NeuObject();

            user.User01 = currentUser.Account;
            ////{D515E09B-E299-47e0-BF19-EDFDB6E4C775}
            //user.Password =Neusoft.HisDecrypt.Decrypt( currentUser.Password);
            user.Password = Neusoft.HisCrypto.DESCryptoService.DESDecrypt(currentUser.Password, Neusoft.FrameWork.Management.Connection.DESKey);
            Neusoft.FrameWork.Management.Connection.Operator = user;

            // #region 电子申请单初始化 addby zhangkj {A93EE0CA-F50E-4142-8477-761E257AC974}
            //// Neusoft.ApplyInterface.HisInterface applyInter = new Neusoft.ApplyInterface.HisInterface();
            // List<Neusoft.FrameWork.Models.NeuObject> parmsApply = new List<Neusoft.FrameWork.Models.NeuObject>();
            // NeuObject obj1 = new NeuObject();
            // obj1.ID = user.ID;
            // obj1.Name = user.Name;
            // parmsApply.Add(obj1);
            // parmsApply.Add(user.Dept);
            // parmsApply.Add(user.CurrentGroup);
            // //applyInter.InitHis50(parmsApply);
            // #endregion
            Neusoft.HISFC.Components.Manager.Classes.Function.HISMonitor();
        }