Example #1
0
        public ActionResult ProposalIndex(int?page, Int64?providerId, string vl, string prm = null)
        {
            TempData["providerId"] = providerId;
            ProposalVM         proposalVM         = new ProposalVM();
            ProposalRepository proposalRepository = new ProposalRepository();

            try
            {
                Search search = new Search();
                search            = SetValue(page, vl, prm);
                search.ProviderID = (Int64)providerId;


                int pageSize   = 15;
                int pageNumber = (page ?? 1);

                proposalVM.Search            = search;
                proposalVM.Search.pageSize   = pageSize;
                proposalVM.Search.pageNumber = pageNumber;
                proposalVM.ProviderID        = search.ProviderID;
                proposalVM.RProposalList     = proposalRepository.SW_GePropsals(proposalVM.Search);

                proposalVM.ListCount = proposalRepository.SW_GePropsalssCount(proposalVM.Search);
                int[] pc = new int[proposalVM.ListCount];

                proposalVM.Paging = pc.ToPagedList(pageNumber, pageSize);

                //  viewModel.vehicleId = vehicleId;

                return(Request.IsAjaxRequest()
              ? (ActionResult)PartialView("ProposalPartialIndex", proposalVM)
              : View(proposalVM));
            }
            catch (Exception ex)
            {
                return(View("Error", new HandleErrorInfo(ex, "Error", "Error")));
            }
        }