Example #1
0
        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));
        }
Example #2
0
        public ActionResult 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.ProdInfo      = model.ProductInfoModel;
            flowmodel.customerModel = Custmodel;


            DPAservice.SessionInfo.InjectFrom(model);
            DPAservice.SessionInfo.DPAWorkflowSuccess = true;

            flowmodel.ProdInfo.Where(w => w.CustaplId == BookService.SessionInfo.SelectedCustAplid).ToList().ForEach(s => s.ApplianceSelected = true);

            return(View(flowmodel));
        }
Example #3
0
        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));
        }
Example #4
0
        public ActionResult DPAVerification(CustCheckWorkFlowModel model, string comments, string SubmitClick)
        {
            CustomerModel Custmodel = new CustomerModel();

            Custmodel.InjectFrom(customerService.SessionInfo);

            model.customerModel.InjectFrom(Custmodel);
            BookService.SessionInfo.SelectedCustAplid = model.SelectedCustAplId;
            var DPAsessionmodel = DPAservice.SessionInfo.custCheckWorkFlow;

            model.custCheckWorkFlow = (DPAsessionmodel);
            foreach (var item in DPAservice.SessionInfo.ProdInfo)
            {
                Product_InfoModel prodinfo = new Product_InfoModel();
                prodinfo.InjectFrom(item);
                prodinfo.CustaplId         = item.CustAplId;
                prodinfo.ApplianceSelected = (prodinfo.CustaplId == model.SelectedCustAplId);
                model.customerModel.ProductInfoModel.Add(prodinfo);
            }
            var    currentWF             = model.custCheckWorkFlow.Where(y => y.FlowQOrderID == DPAservice.SessionInfo.CurrentFlowQOrderID);
            var    v                     = currentWF.Select(x => x.FieldName).First();
            string CurrentInputFieldName = string.IsNullOrEmpty(currentWF.Select(x => x.FieldName).First()) ? string.Empty: currentWF.Select(x => x.FieldName).First().Trim().ToUpper();

            if (comments != string.Empty && CurrentInputFieldName.Length > 0 && CurrentInputFieldName == "CUSTOMERNOTES")
            {
                // NeedCustomerNote = true;
                comments = DateTime.Now.ToString() + " Main account holder granted the permission ." + comments;
                onlineBookingService.AddCustomerNote(Custmodel.CustomerId, storeService.UserId, comments);
                // BookService.CreateCustomer(Custmodel,comments);//todo:
            }
            if (SubmitClick == "YES")
            {
                if (!model.customerModel.ProductInfoModel.Exists(x => x.ApplianceSelected) && ((currentWF.First().FieldName == null) ? "N/A" :currentWF.First().FieldName.ToUpper()) == "APPLIANCE")
                {  // model.CurrentFlowQOrderID
                    ViewBag.Error = "Please select Appliance. If you dont find the appliance information, please select NO.";
                    int?nextflowid = currentWF.Select(x => x.FlowQNoOrderID).First();
                    ViewBag.DPASuccess = !nextflowid.HasValue;
                }
                else
                {
                    int?nextflowid = currentWF.Select(x => x.FlowQYesOrderID).First();
                    if (nextflowid.HasValue)
                    {
                        model.CurrentFlowQOrderID = nextflowid.Value;
                    }


                    ViewBag.DPASuccess = !nextflowid.HasValue;
                }
            }
            else if (SubmitClick == "OK")
            {
                string page    = currentWF.Select(x => x.FlowQYesPage).First();
                string comment = currentWF.Select(x => x.Message).First();
                DPAFail(DPAservice.SessionInfo.CurrentFlowQOrderID, comment);
                //ViewBag.DPASuccess
                ViewBag.returnUrl = "/Home/Index";
            }
            else if (SubmitClick == "NO")
            {
                int?nextflowid = currentWF.Select(x => x.FlowQNoOrderID).First();
                if (nextflowid.HasValue)
                {
                    model.CurrentFlowQOrderID = nextflowid.Value;
                }


                ViewBag.DPASuccess = !nextflowid.HasValue;
            }
            else
            {
                int?nextflowid = currentWF.Select(x => x.FlowQNoOrderID).First();
                model.CurrentFlowQOrderID = DPAservice.SessionInfo.CurrentFlowQOrderID;
                ViewBag.DPASuccess        = !nextflowid.HasValue;
            }

            DPAservice.SessionInfo.CurrentFlowQOrderID = model.CurrentFlowQOrderID;


            return(View(model));
        }
Example #5
0
 public ActionResult VerificationResult(CustCheckWorkFlowModel model)
 {
     return(Redirect(Url.ProcessNextStep()));
 }