示例#1
0
    private void DisplayRoles()
    {
        RoleListQueryParams param = new RoleListQueryParams()
        {
            Kw = c.qsKw
        };

        param.PagedParams = new PagedListQueryParams()
        {
            BeginNum   = 0,
            EndNum     = 0,
            SortField  = c.qsSortField,
            IsSortDesc = c.qsIsSortDesc
        };

        param.AuthParams = new AuthenticationQueryParams()
        {
            CanReadSubItemOfOthers = empAuth.CanReadSubItemOfOthers(),
            CanReadSubItemOfCrew   = empAuth.CanReadSubItemOfCrew(),
            CanReadSubItemOfSelf   = empAuth.CanReadSubItemOfSelf(),
            MyAccount = c.GetEmpAccount(),
            MyDeptId  = c.GetDeptId()
        };

        // get total of items
        empAuth.GetEmployeeRoleList(param);

        // update pager and get begin end of item numbers
        int itemTotalCount = param.PagedParams.RowCount;

        ucDataPager.Initialize(itemTotalCount, c.qsPageCode);
        if (IsPostBack)
        {
            ucDataPager.RefreshPagerAfterPostBack();
        }

        param.PagedParams = new PagedListQueryParams()
        {
            BeginNum   = ucDataPager.BeginItemNumberOfPage,
            EndNum     = ucDataPager.EndItemNumberOfPage,
            SortField  = c.qsSortField,
            IsSortDesc = c.qsIsSortDesc
        };

        List <EmployeeRoleForBackend> roles = empAuth.GetEmployeeRoleList(param);

        if (roles != null)
        {
            rptRoles.DataSource = roles;
            rptRoles.DataBind();
        }

        if (c.qsPageCode > 1 || c.qsSortField != "")
        {
            ClientScript.RegisterStartupScript(this.GetType(), "isSearchPanelCollapsingAtBeginning", "isSearchPanelCollapsingAtBeginning = true;", true);
        }
    }
示例#2
0
        /// <summary>
        /// 取得員工身分清單
        /// </summary>
        public List <EmployeeRoleForBackend> GetEmployeeRoleList(RoleListQueryParams param)
        {
            List <EmployeeRoleForBackend> entities = null;

            using (EmployeeAuthorityDataAccess empAuthDao = new EmployeeAuthorityDataAccess())
            {
                entities = empAuthDao.GetEmployeeRoleListForBackend(param);
                dbErrMsg = empAuthDao.GetErrMsg();
            }

            return(entities);
        }