Ejemplo n.º 1
0
    private void DisplayAccounts()
    {
        AccountListQueryParams param = new AccountListQueryParams()
        {
            ListMode = c.qsEmpRange,
            DeptId   = c.qsDeptId,
            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.GetAccountList(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 <EmployeeForBackend> accounts = empAuth.GetAccountList(param);

        if (accounts != null)
        {
            rptAccounts.DataSource = accounts;
            rptAccounts.DataBind();
        }

        if (c.qsPageCode > 1 || c.qsSortField != "")
        {
            ClientScript.RegisterStartupScript(this.GetType(), "isSearchPanelCollapsingAtBeginning", "isSearchPanelCollapsingAtBeginning = true;", true);
        }
    }
Ejemplo n.º 2
0
        /// <summary>
        /// 取得帳號名單
        /// </summary>
        public List <EmployeeForBackend> GetAccountList(AccountListQueryParams param)
        {
            List <EmployeeForBackend> entities = null;

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

            return(entities);
        }