Beispiel #1
0
        public async Task <IActionResult> Index()
        {
            var result = await _authorizationService.AuthorizeAsync(User, FunctionConstant.Role, Operations.Read);

            if (!result.Succeeded)
            {
                return(Redirect(RouteConstant.PageForbidden));
            }
            string strStatus = HttpContext.Request.Query["status"];

            string pageCurrent = HttpContext.Request.Query["page"];

            string pageSize = HttpContext.Request.Query["pageSize"];

            string search = HttpContext.Request.Query["search"];

            string pathUrl = HttpContext.Request.Path;

            string queryString = HttpContext.Request.QueryString.ToString();

            if (string.IsNullOrEmpty(strStatus))
            {
                strStatus = StatusConstant.All;
            }

            var selectListStatus = new SelectList(StatusList.GetListStatusObject(), "Value", "Text", strStatus);

            Status status = StatusConstant.GetStatus(strStatus);

            if (string.IsNullOrEmpty(pageCurrent))
            {
                pageCurrent = "0";
            }
            if (string.IsNullOrEmpty(pageSize))
            {
                pageSize = "10";
            }

            int intPageCurrent = PageHelper.ReturnDefaultValuePageCurrent(int.Parse(pageCurrent));

            int intPageSize = PageHelper.ReturnDefaultValuePageSize(int.Parse(pageSize));

            var roles = _appRoleServiceInterface.GetAll(status, search, intPageCurrent, intPageSize);

            string curentUrlPath = PageHelper.ReturnPageCurrentPagination(pathUrl, queryString);

            var selectListPagination = new SelectList(StatusList.GetListPaginate(), "Value", "Text", intPageSize);

            ViewBag.StatusSelectListItem = selectListStatus;
            ViewBag.PathUrl = curentUrlPath;
            ViewBag.PaginationSelectListItem = selectListPagination;
            ViewBag.Search = search;
            return(View(roles));
        }
Beispiel #2
0
        public void GetMissingDocumentUploaded(ref List <Dictionary <string, string> > MissingDocumentsInLoan, Int64 LoanID)
        {
            using (var db = new DBConnect(TenantSchema))
            {
                foreach (var doc in MissingDocumentsInLoan)
                {
                    doc["DocMissingStatusID"] = "0";

                    Int64 DocID = Convert.ToInt64(doc["DocID"]);

                    AuditLoanMissingDoc auditMissingLoan = db.AuditLoanMissingDoc.AsNoTracking().Where(md => md.LoanID == LoanID && md.DocID == DocID).FirstOrDefault();

                    if (auditMissingLoan != null)
                    {
                        doc["DocMissingStatusID"]          = auditMissingLoan.Status.ToString();
                        doc["DocMissingStatusDescription"] = auditMissingLoan.Status != 0 ? StatusConstant.GetStatusDescription(auditMissingLoan.Status) : string.Empty;
                    }
                }
            }
        }