public ActionResult CustomerDetails(int id) { DPAservice.ClearFromSession(); customerService.SessionInfo.CustomerId = id; // customerService.AddToDBLog_Viewed(id); return(Redirect(Url.ProcessNextStep())); }
public ActionResult DPAVerificationflow(string error) { CustomerModel Custmodel = new CustomerModel(); Custmodel.InjectFrom(customerService.SessionInfo); CustCheckWorkFlowModel flowmodel = new CustCheckWorkFlowModel(); flowmodel.SelectedCustAplId = BookService.SessionInfo.SelectedCustAplid; ViewBag.SelectedApplianceId = flowmodel.SelectedCustAplId; if (DPAservice.SessionInfo.custCheckWorkFlow.Count == 0) { flowmodel.custCheckWorkFlow = DPAservice.GetCustCheckWorkFlow(storeService.StoreId); } else { flowmodel.custCheckWorkFlow = DPAservice.SessionInfo.custCheckWorkFlow; } foreach (var item in DPAservice.SessionInfo.ProdInfo) { Product_InfoModel prodinfo = new Product_InfoModel(); prodinfo.InjectFrom(item); prodinfo.CustaplId = item.CustAplId; flowmodel.ProdInfo.Add(prodinfo); } flowmodel.CurrentFlowQOrderID = DPAservice.SessionInfo.CurrentFlowQOrderID == 0 ? 2 : DPAservice.SessionInfo.CurrentFlowQOrderID; flowmodel.customerModel = Custmodel; DPAservice.SessionInfo.InjectFrom(flowmodel); DPAservice.SessionInfo.custCheckWorkFlow.InjectFrom(flowmodel.custCheckWorkFlow); if (flowmodel.SelectedCustAplId != 0 && BookService.SessionInfo.SelectedCustAplid != 0) { // var itemToRemove = flowmodel.ProdInfo.FindAll(x => x.CustaplId != flowmodel.SelectedCustAplId).OfType<Product_InfoModel>().ToList(); flowmodel.ProdInfo.RemoveAll(x => x.CustaplId != flowmodel.SelectedCustAplId); } if (error != "") { ViewBag.Error = error; } return(View(flowmodel)); }
public ActionResult DPAVerification(bool?success = false) { if (DPAservice.SessionInfo.DPAWorkflowSuccess) { return(RedirectToAction("VerificationResult")); } CustomerModel Custmodel = new CustomerModel(); var model = customerService.GetCustomerInfo(customerService.SessionInfo.CustomerId); customerService.SessionInfo.InjectFrom(model); Custmodel.InjectFrom(customerService.SessionInfo); CustCheckWorkFlowModel flowmodel = new CustCheckWorkFlowModel(); flowmodel.custCheckWorkFlow = DPAservice.GetCustCheckWorkFlow(storeService.StoreId); flowmodel.ProdInfo = model.ProductInfoModel; flowmodel.customerModel = Custmodel; DPAservice.SessionInfo.InjectFrom(model); DPAservice.SessionInfo.ProdInfo.Clear(); foreach (var item in model.ProductInfoModel) { CustomerProduct_SessionModel prod = new CustomerProduct_SessionModel(); prod.InjectFrom(item); if (prod.PolicyNumber != null) { prod.ApplianceSelected = prod.PolicyNumber.ToUpper() == customerService.SessionInfo.SearchCriteria.ToUpper(); } prod.CustAplId = item.CustaplId; DPAservice.SessionInfo.ProdInfo.Add(prod); if (prod.ApplianceSelected) { BookService.SessionInfo.SelectedCustAplid = item.CustaplId; } } ViewBag.DPASuccess = success.Value; return(View(flowmodel)); }
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)); }