Esempio n. 1
0
        public EmployeeAuthorizationsWithOwnerInfoOfDataExamined InitialAuthorizationResult(bool isTopPageOfOperation, EmployeeAuthorizations authorizations)
        {
            EmployeeAuthorizationsWithOwnerInfoOfDataExamined authAndOwner = new EmployeeAuthorizationsWithOwnerInfoOfDataExamined(authorizations);

            if (!isTopPageOfOperation)
            {
                // get owner info for config-form
                using (EmployeeAuthorityDataAccess empAuthDao = new EmployeeAuthorityDataAccess())
                {
                    string empAccount = empAuthDao.GetEmployeeAccountOfId(qsEmpId);
                    string dbErrMsg   = empAuthDao.GetErrMsg();

                    if (!string.IsNullOrEmpty(empAccount))
                    {
                        accountOfData = empAccount;

                        EmployeeForBackend empData = empAuthDao.GetEmployeeDataForBackend(empAccount);
                        dbErrMsg = empAuthDao.GetErrMsg();

                        if (empData != null)
                        {
                            authAndOwner.OwnerAccountOfDataExamined = empData.OwnerAccount;
                            authAndOwner.OwnerDeptIdOfDataExamined  = empData.OwnerDeptId;
                        }
                    }
                }
            }

            return(authAndOwner);
        }
Esempio n. 2
0
        /// <summary>
        /// 初始化授權結果
        /// </summary>
        protected virtual void InitialAuthorizationResult(bool isTopPageOfOperation)
        {
            this.isTopPageOfOperation = isTopPageOfOperation;

            using (EmployeeAuthorityDataAccess empAuthDao = new EmployeeAuthorityDataAccess())
            {
                //取得指定作業代碼的後端身分可使用權限
                EmployeeRoleOperationsDesc roleOp = empAuthDao.GetEmployeeRoleOperationsDescDataOfOp(roleName, opIdOfPage);

                //從資料集載入身分的授權設定
                LoadRoleAuthorizationsFrom(roleOp);
            }

            if (custEmpAuthResult != null)
            {
                //自訂帳號授權結果
                EmployeeAuthorizationsWithOwnerInfoOfDataExamined authAndOwner = custEmpAuthResult.InitialAuthorizationResult(isTopPageOfOperation, authorizations);
                ownerAccountOfDataExamined = authAndOwner.OwnerAccountOfDataExamined;
                ownerDeptIdOfDataExamined  = authAndOwner.OwnerDeptIdOfDataExamined;
                this.authorizations        = authAndOwner;

                if (authAndOwner.IsTopPageOfOperationChanged)
                {
                    this.isTopPageOfOperation = authAndOwner.IsTopPageOfOperation;
                }

                return;
            }
        }
Esempio n. 3
0
        public EmployeeAuthorizationsWithOwnerInfoOfDataExamined InitialAuthorizationResult(bool isTopPageOfOperation, EmployeeAuthorizations authorizations)
        {
            EmployeeAuthorizationsWithOwnerInfoOfDataExamined authAndOwner = new EmployeeAuthorizationsWithOwnerInfoOfDataExamined(authorizations);

            if (!isTopPageOfOperation)
            {
                // get owner info for config-form
                using (EmployeeAuthorityDataAccess empAuthDao = new EmployeeAuthorityDataAccess())
                {
                    DepartmentForBackend dept = empAuthDao.GetDepartmentDataForBackend(qsId);
                    string dbErrMsg           = empAuthDao.GetErrMsg();

                    if (dept != null)
                    {
                        authAndOwner.OwnerAccountOfDataExamined = dept.PostAccount ?? "";
                        authAndOwner.OwnerDeptIdOfDataExamined  = dept.PostDeptId;
                    }
                }
            }

            return(authAndOwner);
        }
Esempio n. 4
0
        public EmployeeAuthorizationsWithOwnerInfoOfDataExamined InitialAuthorizationResult(bool isTopPageOfOperation, EmployeeAuthorizations authorizations)
        {
            EmployeeAuthorizationsWithOwnerInfoOfDataExamined authAndOwner = new EmployeeAuthorizationsWithOwnerInfoOfDataExamined(authorizations);

            if (!isTopPageOfOperation)
            {
                // get owner info for config-form
                EmployeeRoleForBackend empRole = null;

                using (EmployeeAuthorityDataAccess empAuthDao = new EmployeeAuthorityDataAccess())
                {
                    empRole = empAuthDao.GetEmployeeRoleDataForBackend(qsRoleId);
                    string dbErrMsg = empAuthDao.GetErrMsg();
                }

                if (empRole != null)
                {
                    authAndOwner.OwnerAccountOfDataExamined = empRole.PostAccount;
                    authAndOwner.OwnerDeptIdOfDataExamined  = empRole.PostDeptId.Value;
                }
            }

            return(authAndOwner);
        }