示例#1
0
        public PartialViewResult QuoteConfirmation(QuoteConfirmationInputModel inputModel)
        {
            if (job == null)
            {
                return PersonalDetails();
            }

            SetJobIdCookie(job.Guid);

            if (ModelState.IsValid)
            {
                job.TermsAgreed = inputModel.TermsAgreed.Value;

                if (!string.IsNullOrEmpty(inputModel.PromotionCode))
                {
                    job.Promotion = promotionService.GetPromotion(inputModel.PromotionCode);
                }

                jobService.RequestQuote(job);

                jobService.SaveJob(job);

                return QuoteComplete();
            }

            var viewModel = new QuoteConfirmationViewModel();
            viewModel.PersonalDetails = PersonalDetails().Model as PersonalDetailsInputModel;
            viewModel.WebsiteDetails = WebsiteDetails().Model as WebsiteDetailsInputModel;
            viewModel.ContentDetails = ContentDetails().Model as ContentDetailsInputModel;
            viewModel.Urgent = Convert.ToBoolean(viewModel.WebsiteDetails.Urgent) ? "Yes" : "No";
            viewModel.TermsAgreed = inputModel.TermsAgreed;
            viewModel.PromotionCode = inputModel.PromotionCode;

            return PartialView("QuoteConfirmation", viewModel);
        }
示例#2
0
        public PartialViewResult QuoteConfirmation()
        {
            if (job == null)
            {
                return PersonalDetails();
            }

            SetJobIdCookie(job.Guid);

            var viewModel = new QuoteConfirmationViewModel();
            viewModel.PersonalDetails = PersonalDetails().Model as PersonalDetailsInputModel;
            viewModel.WebsiteDetails = WebsiteDetails().Model as WebsiteDetailsInputModel;
            viewModel.ContentDetails = ContentDetails().Model as ContentDetailsInputModel;
            viewModel.Urgent = Convert.ToBoolean(viewModel.WebsiteDetails.Urgent) ? "Yes" : "No";
            viewModel.TermsAgreed = job.TermsAgreed;

            if (job.Promotion != null)
            {
                viewModel.PromotionCode = job.Promotion.Code;
            }

            SetQuoteStepCookie(QuoteStep.QuoteConfirmation);
            return PartialView("QuoteConfirmation", viewModel);
        }