Ejemplo n.º 1
0
        protected void PrepareGutterCleanOrderModel(GutterCleanRequestModel model)
        {
            //model.AvailableRoofMaterial=_questionAnswerEntityDataService.

            model.AvailableRoofMaterial=_questionAnswerEntityDataService.RoofMaterialAnswer();
            model.AvailableSquareFootage = _questionAnswerEntityDataService.SquareFootageAnswer();
            model.AvailableStyleOfGutter = _questionAnswerEntityDataService.StyleOfGuttersAnswer();
            model.AvailableYearBuilt = _questionAnswerEntityDataService.YearBuiltAnswer();
            model.AvailableDeliveryTime = _questionAnswerEntityDataService.DeliveryTimeAnswer();
        }
Ejemplo n.º 2
0
        public ActionResult GutterCleanRequest()
        {
            //if ((_workContext.CurrentCustomer.IsGuest()))
            //    return new HttpUnauthorizedResult();

            _dbContext.ExecuteSqlCommand("EXEC dbo.[DeleteGuests]");

            GutterCleanRequestModel model = new GutterCleanRequestModel();
            PrepareGutterCleanOrderModel(model);
            return View(model);
        }
Ejemplo n.º 3
0
        public ActionResult GutterCleanRequest(GutterCleanRequestModel model)
        {
            if (ModelState.IsValid)
            {
                decimal totalAmount = 0;
                totalAmount = _questionAnswerEntityDataService.CalculateCost(model.QuestionSquareFootage, model.QuestionYearBuilt, Convert.ToInt32(model.QuestionStyleOfGutter), model.RoofMaterial, model.QuestionDeliveryTime);
                model.OrderTotal = Math.Round(totalAmount);
                _httpContext.Session["GutterCleanRequestModel"] = model;

                return RedirectToRoute("ProcessPayment");
            }

            PrepareGutterCleanOrderModel(model);
            return View(model);
        }
Ejemplo n.º 4
0
        public ActionResult GenerateQuote(GutterCleanRequestModel model)
        {
            if (ModelState.IsValid)
            {
                decimal totalAmount = 0;
                totalAmount = _questionAnswerEntityDataService.CalculateCost(model.QuestionSquareFootage, model.QuestionYearBuilt, Convert.ToInt32(model.QuestionStyleOfGutter), model.RoofMaterial,model.QuestionDeliveryTime);
                return Json(new { TotalAmount = Math.Round(totalAmount), Success = true, message = string.Empty });
            }

            string message = string.Empty;
            var query = from state in ModelState.Values
                        from error in state.Errors
                        select error.ErrorMessage;

            return Json(new { TotalAmount = 0, Success = false, message = query.ToArray() });
        }