Esempio n. 1
0
        /// <summary>
        /// 设置权限
        /// </summary>
        /// <param name="toolBar"></param>
        public void SetPurview(UserToolBar toolBar)
        {
            FunctionList = _setFunctionList;

            if (toolBar != null)
            {
                toolBar.BtnNewVisible = false;
                toolBar.BtnModifyVisible = false;
                toolBar.BtnDeleteVisible = false;
                toolBar.BtnCardIssuanceVisible = false;
                toolBar.BtnCardReturnVisible = false;
                toolBar.BtnCardMissingVisible = false;
                toolBar.BtnCardRecoveryVisible = false;
                toolBar.BtnCardScrapVisible = false;

                toolBar.BtnDataInputVisible = false;
                toolBar.BtnDataExportVisible = false;
                toolBar.BtnExpCusDataVisible = false;
                toolBar.BtnExportTemplateVisible = false;
                toolBar.BtnExportCardUserPhotoVisible = false;

                toolBar.BtnImportPhotoVisible = false;
                toolBar.BtnGroupPersonVisible = false;

                toolBar.btnImportDataVisible = false;
                toolBar.btnExportDataVisible = false;

                if (this.FunctionList != null && this.FunctionList.Count > 0)
                {
                    for (int i = 0; i < this.FunctionList.Count; i++)
                    {

                        if (this.FunctionList[i].fum_cFunctionNumber.Trim() == DefineConstantValue.Sys_FormFunctionNum.New)
                        {
                            toolBar.BtnNewVisible = true;
                            continue;
                        }
                        if (this.FunctionList[i].fum_cFunctionNumber.Trim() == DefineConstantValue.Sys_FormFunctionNum.Modify)
                        {
                            toolBar.BtnModifyVisible = true;
                            continue;
                        }
                        if (this.FunctionList[i].fum_cFunctionNumber.Trim() == DefineConstantValue.Sys_FormFunctionNum.Delete)
                        {
                            toolBar.BtnDeleteVisible = true;
                            continue;
                        }
                    }
                }

                else if (this.UserInformation != null && this.UserInformation.usm_cUserLoginID == "sa")
                {
                    toolBar.BtnNewVisible = true;
                    toolBar.BtnModifyVisible = true;
                    toolBar.BtnDeleteVisible = true;
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 设置权限
        /// </summary>
        /// <param name="toolBar"></param>
        public void SetPurview(UserToolBar toolBar)
        {
            FunctionList = _setFunctionList;

            if (toolBar != null)
            {
                toolBar.BtnNewVisible = false;
                toolBar.BtnModifyVisible = false;
                toolBar.BtnDeleteVisible = false;

                if (this.FunctionList != null && this.FunctionList.Count > 0)
                {
                    for (int i = 0; i < this.FunctionList.Count; i++)
                    {

                        if (this.FunctionList[i].fum_cFunctionNumber.Trim() == DefineConstantValue.Sys_FormFunctionNum.New)
                        {
                            toolBar.BtnNewVisible = true;
                            continue;
                        }
                        if (this.FunctionList[i].fum_cFunctionNumber.Trim() == DefineConstantValue.Sys_FormFunctionNum.Modify)
                        {
                            toolBar.BtnModifyVisible = true;
                            continue;
                        }
                        if (this.FunctionList[i].fum_cFunctionNumber.Trim() == DefineConstantValue.Sys_FormFunctionNum.Delete)
                        {
                            toolBar.BtnDeleteVisible = true;
                            continue;
                        }
                    }
                }
                else if (this.UserInformation != null && this.UserInformation.usm_cUserLoginID == "sa")
                {
                    toolBar.BtnNewVisible = true;
                    toolBar.BtnModifyVisible = true;
                    toolBar.BtnDeleteVisible = true;
                }
            }
        }