예제 #1
0
        // GET: RePos
        public ActionResult List(string filterType = "", string filterValue = "", int page = 1)
        {
            RecruitmentRequestViewModel viewModel = new RecruitmentRequestViewModel();

            try
            {
                InitializeListPage(viewModel);
                int.TryParse(filterValue, out int filterValueID);
                viewModel.PagingInfo = new PagingInfo
                {
                    TotalRecordsCount = reqService.TotalRecordsCount(filterType, filterValueID),
                    RecordsPerPage    = RecordsPerPage,
                    CurentPageNo      = page
                };

                if (viewModel.PagingInfo.TotalRecordsCount > 0)
                {
                    viewModel.Requests = GetAllRequests(filterType, filterValueID, page);
                }
            }
            catch (Exception exp)
            {
                DisplayLoadErrorMessage(exp);
            }

            return(View(viewModel));
        }
예제 #2
0
 private void InitializeListPage(RecruitmentRequestViewModel viewModel)
 {
     viewModel.FilterTypeDropDownItems = new List <SelectListItem>
     {
         new SelectListItem
         {
             Text  = "Project",
             Value = "prj"
         },
         new SelectListItem
         {
             Text  = "Account",
             Value = "acc"
         },
         new SelectListItem
         {
             Text  = "Work Location",
             Value = "wol"
         },
         new SelectListItem
         {
             Text  = "Request Status",
             Value = "sts"
         },
         new SelectListItem
         {
             Text  = "Request Priority",
             Value = "pri"
         },
         new SelectListItem
         {
             Text  = "Aging Band",
             Value = "age"
         },
     };
 }