Exemplo n.º 1
0
        /// <summary>
        /// 根据权限人员编码/科室编码/二级权限码 获取所拥有的三级权限集合
        /// </summary>
        /// <param name="userCode">权限人员编码</param>
        /// <param name="deptCode">科室编码</param>
        /// <param name="class2Code">二级权限编码</param>
        /// <returns>成功返回所拥有的权限1 失败返回0</returns>
        public virtual int GetUserPriv(string userCode, string deptCode, string class2Code)
        {
            Neusoft.HISFC.BizLogic.Manager.UserPowerDetailManager privManager = new Neusoft.HISFC.BizLogic.Manager.UserPowerDetailManager();
            List <Neusoft.FrameWork.Models.NeuObject>             alPriv      = privManager.QueryUserPrivCollection(userCode, class2Code, deptCode);

            if (alPriv == null)
            {
                MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("获取三级权限集合失败"));
                return(0);
            }
            this.SetPriv(alPriv, false);

            return(1);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 初始化出库类别列表
        /// </summary>
        private void InitCmb()
        {
            Neusoft.HISFC.BizLogic.Manager.UserPowerDetailManager userPower = new Neusoft.HISFC.BizLogic.Manager.UserPowerDetailManager();
            List <Neusoft.FrameWork.Models.NeuObject>             list      = userPower.QueryUserPrivCollection(this.employee.ID, "0320", this.employee.Dept.ID);

            if (list != null)
            {
                this.cmbOutType.AddItems(new ArrayList(list));
                if (list.Count > 0)
                {
                    this.cmbOutType.SelectedIndex = 0;
                }
            }
        }
Exemplo n.º 3
0
 private void frmFinPassWord_Load(object sender, EventArgs e)
 {
     #region 权限设置
     Neusoft.HISFC.BizLogic.Manager.UserPowerDetailManager user = new Neusoft.HISFC.BizLogic.Manager.UserPowerDetailManager();
     NeuObject dept = (user.Operator as HISFC.Models.Base.Employee).Dept;
     //判断是否存在注销密码权限
     bool blpri = user.JudgeUserPriv(user.Operator.ID, dept.ID, "5101", "01");
     if (!blpri)
     {
         MessageBox.Show("您不存在注销帐户密码权限!");
         this.ucFindAccountPassWord1.Enabled = false;
     }
     #endregion
 }
Exemplo n.º 4
0
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            //取操作员权限科室(暂时以所在科室代替 )
            this.privDept = ((Neusoft.HISFC.Models.Base.Employee) this.drugStoreManager.Operator).Dept;

            //判断是否有模版维护权限
            Neusoft.HISFC.BizLogic.Manager.UserPowerDetailManager userManager  = new Neusoft.HISFC.BizLogic.Manager.UserPowerDetailManager( );
            List <Neusoft.FrameWork.Models.NeuObject>             alPrivDetail = userManager.QueryUserPrivCollection(this.drugStoreManager.Operator.ID, "0350", this.privDept.ID);

            if (alPrivDetail != null)
            {
                foreach (Neusoft.FrameWork.Models.NeuObject privInfo in alPrivDetail)
                {
                    //门诊终端维护权限
                    if (privInfo.ID == "01")
                    {
                        this.isPrivilegeEdit = true;
                        break;
                    }
                }
            }
            else
            {
                this.isPrivilegeEdit = true;
            }

            this.IsEdit = this.isPrivilegeEdit;

            this.ShowAdjustType( );
            this.ShowTerminalInfo( );

            //改变FarPoint的回车事件,使回车转到下一行当前列
            FarPoint.Win.Spread.InputMap im;
            im = this.neuSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused);
            im.Put(new FarPoint.Win.Spread.Keystroke(Keys.Enter, Keys.None), FarPoint.Win.Spread.SpreadActions.MoveToNextRow);

            this.neuSpread1.EditModeReplace = true;

            Neusoft.FrameWork.WinForms.Classes.MarkCellType.NumCellType markNumCell = new Neusoft.FrameWork.WinForms.Classes.MarkCellType.NumCellType();
            markNumCell.DecimalPlaces = 0;
            markNumCell.MinimumValue  = 0;
            markNumCell.MaximumValue  = 9999;

            this.neuSpread1_Sheet1.Columns[3].CellType = markNumCell;
            this.neuSpread1_Sheet1.Columns[4].CellType = markNumCell;
            this.neuSpread1_Sheet1.Columns[5].CellType = markNumCell;

            base.OnLoad(e);
        }
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            //取操作员权限科室(暂时以所在科室代替 )
            this.privDept = ((Neusoft.HISFC.Models.Base.Employee) this.drugStore.Operator).Dept;

            //判断是否有模版维护权限
            Neusoft.HISFC.BizLogic.Manager.UserPowerDetailManager userManager  = new Neusoft.HISFC.BizLogic.Manager.UserPowerDetailManager( );
            List <Neusoft.FrameWork.Models.NeuObject>             alPrivDetail = userManager.QueryUserPrivCollection(this.drugStore.Operator.ID, "0350", this.privDept.ID);

            if (alPrivDetail != null)
            {
                this.isPrivilegeEdit = false;
                foreach (Neusoft.FrameWork.Models.NeuObject privInfo in alPrivDetail)
                {
                    //门诊终端维护权限
                    if (privInfo.ID == "01")
                    {
                        this.isPrivilegeEdit = true;
                        break;
                    }
                }
            }
            else
            {
                this.isPrivilegeEdit = true;
            }

            this.IsEdit = this.isPrivilegeEdit;

            Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm(Language.Msg("正在加载门诊终端信息...."));
            Application.DoEvents( );

            //初始化科室终端数据
            this.ucDrugTerminalList1.InitDeptTerminal(this.privDept.ID);
            //初始化模板列表
            this.ShowTemplateList( );

            Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm( );

            base.OnLoad(e);
        }
Exemplo n.º 6
0
 /// <summary>
 /// 将树型控件当前被选中节点的儿子节点(用户)显示在listView中
 /// </summary>
 private void ShowListUser()
 {
     Neusoft.HISFC.BizLogic.Manager.UserPowerDetailManager userManager = new Neusoft.HISFC.BizLogic.Manager.UserPowerDetailManager();
     Neusoft.HISFC.Models.Base.DepartmentStat dept = new Neusoft.HISFC.Models.Base.DepartmentStat();
     ParentNodeStat(this.tvDepartmentLevelTree1.SelectedNode, ref dept);
     System.Collections.ArrayList al = userManager.LoadUser(dept.StatCode, dept.PardepCode);
     foreach (Neusoft.HISFC.Models.Admin.UserPowerDetail info in al)
     {
         ListViewItem item = this.neuListView1.Items.Add(info.User.Name);
         item.Tag = info;
         if (info.User01 == "F")
         {
             item.ImageIndex      = 3;
             item.StateImageIndex = 3;
         }
         else
         {
             item.ImageIndex      = 2;
             item.StateImageIndex = 2;
         }
     }
 }
Exemplo n.º 7
0
        /// <summary>
        /// 根据权限码获取权限信息
        /// </summary>
        /// <param name="userCode">权限人员编码</param>
        /// <param name="class2Code">二级权限码</param>
        /// <param name="class3Code">三级权限码 如不需判断三级权限 则传入null</param>
        /// <returns>成功返回拥有1 失败返回0</returns>
        public virtual int GetPrivDept(string userCode, string class2Code, string class3Code)
        {
            Neusoft.HISFC.BizLogic.Manager.UserPowerDetailManager privManager = new Neusoft.HISFC.BizLogic.Manager.UserPowerDetailManager();

            List <Neusoft.FrameWork.Models.NeuObject> alPrivDept = new List <Neusoft.FrameWork.Models.NeuObject>();

            if (class3Code != null && class3Code != "")         //取操作员拥有权限的科室
            {
                alPrivDept = privManager.QueryUserPriv(userCode, class2Code, class3Code);
            }
            else
            {
                alPrivDept = privManager.QueryUserPriv(userCode, class2Code);
            }

            if (alPrivDept == null)
            {
                MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("获取权限科室集合失败"));
                return(0);
            }
            this.SetPriv(alPrivDept, true);
            return(1);
        }
Exemplo n.º 8
0
        /// <summary>
        /// 初始化
        /// </summary>
        public void Init()
        {
            this.ImageList = this.groupImageList;

            this.Nodes.Clear();

            Neusoft.FrameWork.Models.NeuObject tempObject;
            //按权限初始化
            Neusoft.HISFC.BizLogic.Manager.UserPowerDetailManager privManager = new Neusoft.HISFC.BizLogic.Manager.UserPowerDetailManager();
            List <Neusoft.FrameWork.Models.NeuObject>             alPriv      = null;

            #region 显示入库节点

            alPriv = privManager.QueryUserPriv(privManager.Operator.ID, "0310");
            if (alPriv == null)
            {
                System.Windows.Forms.MessageBox.Show(Language.Msg("获取入库权限发生错误" + privManager.Err));
                return;
            }
            if (alPriv.Count > 0)
            {
                tempObject      = new Neusoft.FrameWork.Models.NeuObject();
                tempObject.Name = "入库单";
                tempObject.ID   = "I";
                tempObject.Memo = "Bill";

                System.Windows.Forms.TreeNode inParentNode = new System.Windows.Forms.TreeNode();
                inParentNode.Text = tempObject.Name;

                inParentNode.ImageIndex         = 0;
                inParentNode.SelectedImageIndex = 0;

                inParentNode.Tag = tempObject;
                this.Nodes.Add(inParentNode);
                foreach (Neusoft.FrameWork.Models.NeuObject obj in alPriv)
                {
                    //{32C46091-AE5F-44b0-BE40-4CF31D307C7C}  放开对药房的限制
                    if (obj.Memo == "PI" || obj.Memo == "P")
                    {
                        System.Windows.Forms.TreeNode nod = new System.Windows.Forms.TreeNode();
                        nod.Text = obj.Name;

                        nod.ImageIndex         = 2;
                        nod.SelectedImageIndex = 4;

                        nod.Tag = obj;
                        inParentNode.Nodes.Add(nod);
                    }
                }
            }

            #endregion

            #region 显示出库节点

            alPriv = privManager.QueryUserPriv(privManager.Operator.ID, "0320");
            if (alPriv == null)
            {
                System.Windows.Forms.MessageBox.Show(Language.Msg("加载出库权限列表发生错误" + privManager.Err));
                return;
            }
            if (alPriv.Count > 0)
            {
                tempObject      = new Neusoft.FrameWork.Models.NeuObject();
                tempObject.Name = "出库单";
                tempObject.ID   = "O";
                tempObject.Memo = "Bill";

                if (this.isShowAttempBill)
                {
                    #region 显示调拨单

                    System.Windows.Forms.TreeNode outParentNode = new System.Windows.Forms.TreeNode();
                    outParentNode.Text = tempObject.Name;

                    outParentNode.ImageIndex         = 0;
                    outParentNode.SelectedImageIndex = 0;

                    outParentNode.Tag = tempObject;
                    this.Nodes.Add(outParentNode);
                    foreach (Neusoft.FrameWork.Models.NeuObject obj in alPriv)
                    {
                        if (obj.Memo == "PI")
                        {
                            System.Windows.Forms.TreeNode nod = new System.Windows.Forms.TreeNode();
                            nod.Text = obj.Name;

                            nod.ImageIndex         = 2;
                            nod.SelectedImageIndex = 4;

                            nod.Tag = obj;
                            outParentNode.Nodes.Add(nod);
                        }
                    }
                    tempObject      = new Neusoft.FrameWork.Models.NeuObject();
                    tempObject.Name = "调拨单";
                    tempObject.ID   = "D";
                    tempObject.Memo = "Bill";

                    System.Windows.Forms.TreeNode attempNode = new System.Windows.Forms.TreeNode();
                    attempNode.Text = tempObject.Name;

                    attempNode.ImageIndex         = 0;
                    attempNode.SelectedImageIndex = 0;

                    attempNode.Tag = tempObject;
                    this.Nodes.Add(attempNode);
                    foreach (Neusoft.FrameWork.Models.NeuObject obj in alPriv)
                    {
                        if (obj.Memo == "P")
                        {
                            System.Windows.Forms.TreeNode nod = new System.Windows.Forms.TreeNode();
                            nod.Text = obj.Name;

                            nod.ImageIndex         = 2;
                            nod.SelectedImageIndex = 4;

                            nod.Tag = obj;
                            attempNode.Nodes.Add(nod);
                        }
                    }

                    #endregion
                }
                else
                {
                    System.Windows.Forms.TreeNode outParentNode = new System.Windows.Forms.TreeNode();

                    outParentNode.Text = tempObject.Name;
                    outParentNode.Tag  = tempObject;

                    this.Nodes.Add(outParentNode);
                    foreach (Neusoft.FrameWork.Models.NeuObject obj in alPriv)
                    {
                        if (obj.Memo == "PI" || obj.Memo == "P")
                        {
                            System.Windows.Forms.TreeNode nod = new System.Windows.Forms.TreeNode();
                            nod.Text = obj.Name;
                            nod.Tag  = obj;

                            nod.ImageIndex         = 2;
                            nod.SelectedImageIndex = 4;

                            outParentNode.Nodes.Add(nod);
                        }
                    }
                }
            }

            #endregion

            if (this.Nodes.Count == 0)
            {
                System.Windows.Forms.TreeNode noPrivNode = new System.Windows.Forms.TreeNode("无权限");
                noPrivNode.Tag = null;
                this.Nodes.Add(noPrivNode);
            }

            this.ExpandAll();
        }
Exemplo n.º 9
0
        /// <summary>
        /// 根据登陆人的权限,过滤摆药台
        /// </summary>
        /// <param name="al"></param>
        /// <returns></returns>
        private ArrayList FliterControl(ArrayList al)
        {
            //人员权限分配明细管理
            Neusoft.HISFC.BizLogic.Manager.UserPowerDetailManager privManager = new Neusoft.HISFC.BizLogic.Manager.UserPowerDetailManager();

            string operCode = privManager.Operator.ID;
            string deptCode = ((Neusoft.HISFC.Models.Base.Employee)privManager.Operator).Dept.ID;

            //定义药房管理类
            Neusoft.HISFC.BizLogic.Pharmacy.DrugStore drugStoreManager = new Neusoft.HISFC.BizLogic.Pharmacy.DrugStore();

            //取操作员的药房权限
            ArrayList alPriv = privManager.LoadByUserCode(operCode, "03", deptCode);
            string    priv   = "";

            for (int i = 0; i < alPriv.Count; i++)
            {
                Neusoft.HISFC.Models.Admin.UserPowerDetail no = alPriv[i] as Neusoft.HISFC.Models.Admin.UserPowerDetail;
                if (no.PowerLevelClass.Class3Code == "Z1")
                {
                    priv += "B";
                }
                if (no.PowerLevelClass.Class3Code == "Z2")
                {
                    priv += "T";
                }
            }
            if (al == null)
            {
                MessageBox.Show(drugStoreManager.Err);
                return(al);
            }
            if (al.Count == 0)
            {
                MessageBox.Show(Language.Msg("您所在的科室没有设置摆药台,请先设置本科室的摆药台。"));
                return(al);
            }
            Neusoft.HISFC.Models.Pharmacy.DrugControl control;
            Neusoft.HISFC.Models.Pharmacy.DrugControl QuitDrugControl = new Neusoft.HISFC.Models.Pharmacy.DrugControl();
            for (int i = 0; i < al.Count; i++)
            {
                control = al[i] as Neusoft.HISFC.Models.Pharmacy.DrugControl;
                if (control.Name == "退药台")
                {
                    QuitDrugControl = control;
                }
            }
            if (priv.Length == 1)
            {
                if (priv == "B")
                {
                    al.Remove(QuitDrugControl);
                }
                else
                {
                    al.Clear();
                    al.Add(QuitDrugControl);
                }
                return(al);
            }
            else if (priv.Length == 0)
            {
                al.Clear();
                return(al);
            }
            return(al);
        }
Exemplo n.º 10
0
        /// <summary>
        /// 删除当前ListView中选中的科室
        /// </summary>
        public void DelDepartment()
        {
            //取得当前ListView中要修改的科室数据信息
            TreeNode node = this.neuListView1.SelectedItems[0].Tag as TreeNode;

            //只能删除科室数据
            if (node == null)
            {
                return;
            }

            //取要删除的科室信息
            Neusoft.HISFC.Models.Base.DepartmentStat dept = node.Tag as Neusoft.HISFC.Models.Base.DepartmentStat;
            if (dept != null)
            {
                if (dept.Childs.Count > 0)
                {
                    MessageBox.Show("此科室有下级科室,不允许删除。\n请先删除下级科室。", "删除无法进行", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                //取此科室下级人员信息,如果存在人员则不允许删除。
                Neusoft.HISFC.BizLogic.Manager.UserPowerDetailManager userMgr = new Neusoft.HISFC.BizLogic.Manager.UserPowerDetailManager();
                ArrayList al = userMgr.LoadUser(dept.StatCode, dept.DeptCode);
                if (al == null)
                {
                    MessageBox.Show("取人员信息时出错:" + userMgr.Err);
                    return;
                }

                if (al.Count > 0)
                {
                    MessageBox.Show("此科室有下级人员,不允许删除。\n请先删除下级人员。", "删除无法进行", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                if (MessageBox.Show("确定要把科室“" + dept.DeptName + "”删除吗?", "确认科室删除", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }

                //定义管理类,删除科室

                Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();

                Neusoft.HISFC.BizLogic.Manager.DepartmentStatManager deptStatMgr = new Neusoft.HISFC.BizLogic.Manager.DepartmentStatManager();
                //Neusoft.FrameWork.Management.Transaction trans = new Neusoft.FrameWork.Management.Transaction(deptStatMgr.Connection);
                //trans.BeginTransaction();
                //deptStatMgr.SetTrans(trans.Trans);
                try
                {
                    //删除一个科室数据
                    int parm = deptStatMgr.Delete(dept.StatCode, dept.DeptCode);
                    if (parm != 1)
                    {
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();;
                        MessageBox.Show("数据保存失败:" + deptStatMgr.Err);
                        return;
                    }
                }
                catch (Exception e)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();;
                    MessageBox.Show("数据保存失败!" + e.Message, "提示");
                    return;
                }
                Neusoft.FrameWork.Management.PublicTrans.Commit();
                //MessageBox.Show("数据保存失败!" + e.Message,"提示");
            }

            //在TreeView中移除被删掉的节点
            this.tvDepartmentLevelTree1.DelDepartment(node);

            //显示当前TreeView中选中节点的下级内容
            this.ShowList();
        }
Exemplo n.º 11
0
        /// <summary>
        /// 窗口初始化
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            #region 权限判断

            //取操作员权限科室(暂时以所在科室代替 )
            this.privDept = ((Neusoft.HISFC.Models.Base.Employee) this.drugStore.Operator).Dept;

            //判断是否有模版维护权限
            Neusoft.HISFC.BizLogic.Manager.UserPowerDetailManager user         = new Neusoft.HISFC.BizLogic.Manager.UserPowerDetailManager( );
            List <Neusoft.FrameWork.Models.NeuObject>             alPrivDetail = user.QueryUserPrivCollection(this.drugStore.Operator.ID, "0350", this.privDept.ID);
            if (alPrivDetail != null)
            {
                foreach (Neusoft.FrameWork.Models.NeuObject privInfo in alPrivDetail)
                {
                    //门诊终端维护权限
                    if (privInfo.ID == "01")
                    {
                        this.isPrivilegeEdit = true;
                        break;
                    }
                }
            }
            else
            {
                this.isPrivilegeEdit = true;
            }

            this.IsEdit = this.isPrivilegeEdit;

            #endregion

            #region 初始化

            Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm(Language.Msg("正在加载门诊终端信息...."));
            Application.DoEvents( );

            //初始化sheet格式
            this.InitFp( );

            //初始化科室终端数据
            this.ucDrugTerminalList1.InitDeptTerminal(this.privDept.ID);

            ////多线程加载数据
            //System.Threading.ThreadStart start = new System.Threading.ThreadStart( this.InitConstant );
            //System.Threading.Thread thread = new System.Threading.Thread( start );
            //thread.Start( );

            this.InitConstant();

            //默认选择药品
            this.neuSpread1.ActiveSheetIndex = 0;
            this.ShowData(this.neuSpread1.ActiveSheetIndex);

            //改变FarPoint的回车事件,使回车转到下一行当前列
            FarPoint.Win.Spread.InputMap im;
            im = this.neuSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenFocused);
            im.Put(new FarPoint.Win.Spread.Keystroke(Keys.Enter, Keys.None), FarPoint.Win.Spread.SpreadActions.MoveToNextRow);

            //屏蔽挂号级别功能
            if (this.neuSpread1.Sheets.Contains(this.sheetSpeRegLevel))
            {
                this.neuSpread1.Sheets.Remove(this.sheetSpeRegLevel);
            }

            Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm( );

            #endregion

            base.OnLoad(e);
        }