Esempio n. 1
0
 public ActionResult CustomerDetails(int id)
 {
     DPAservice.ClearFromSession();
     customerService.SessionInfo.CustomerId = id;
     // customerService.AddToDBLog_Viewed(id);
     return(Redirect(Url.ProcessNextStep()));
 }
Esempio n. 2
0
        public ActionResult Search(int?page)
        {
            DPAservice.ClearFromSession();
            if (page == null)
            {
                page = customerService.SessionInfo.PageNumber;
            }
            customerService.SessionInfo.PageNumber = page ?? 1;

            var model = customerService.GetCustomersList(customerService.SessionInfo.SearchCriteria, customerService.SessionInfo.PageNumber);

            // If only one product finded, redirect to details
            if (model.TotalRecords == 1)
            {
                // Checking if user push back button on ShowDetails
                if (customerService.IsBackButtonPressed)
                {
                    return(View(model));
                }
                return(RedirectToAction("CustomerDetails", new { id = model.SearchResults[0].CustomerId }));
            }
            ViewBag.OnePageOfJobs = new StaticPagedList <Customer_SearchResult>(model.SearchResults, customerService.SessionInfo.PageNumber, Settings.Default.JobSearchPageSize, model.TotalRecords);
            return(View(model));
        }