コード例 #1
0
        public ActionResult ConfirmReservationSubmit(ReservationParameters model)
        {
            model.AcceptTermsAndConditions = (HttpContext.Request.Form["confirm_toc"] != null);

            ReservationParameters reservationContext = ReservationUtils.GetContextReservation();

            Session["PPPUiError"] = null;
            ValidationUtils.ClearModelErrors(ModelState);

            reservationContext = ReservationUtils.MapGuestValues(model, reservationContext);
            // var errors = ValidationUtils.GetGuestViolations(model, reservationContext.MaxOccupancy);
            var errors = new List <RuleViolation>();

            if (!ValidationUtils.ErrorsDetected(ModelState, errors))
            {
                Session["ReservationContext"] = reservationContext;
                var reservationResponse = ExecuteBook(reservationContext);

                if (reservationResponse != null && reservationResponse.Errors == null)
                {
                    OwnerUtils.SetContextToReloadPalett();

                    Session["ReservationNumber"] = reservationResponse.ConfirmReservation.ReservationNumber;
                    Response.Redirect("/owner/Points-Protection-Plan", false);
                    return(null);
                }
                else
                {
                    ModelState.AddModelError("", "We're sorry, but since you began your search, that villa type is no longer available. Please select BACK to begin a new search.");
                }
            }

            return(base.Index());
        }
コード例 #2
0
        public ActionResult BuildMenu()
        {
            DebugUtils.StartLogEvent("TopMenuController.BuildMenu");

            OwnerUtils.ReloadPallet();

            //return View();
            var context = new SitecoreContext();
            var model   = context.GetHomeItem <MenuItem>();

            var currentPage            = context.GetCurrentItem <BasePage>();
            BlueGreenContext bgContext = new BlueGreenContext();

            model.ShowMenu = bgContext.IsAuthenticated;

            //model.ShowMenu = currentPage.PageRequireAuth;

            var datasourceModel = GetDataSourceItem <Header>();
            var homePage        = context.GetHomeItem <BasePage>();

            if (datasourceModel == null)
            {
                model.Logo = homePage.HeaderConfiguration.HeaderImage;
            }
            else
            {
                model.Logo = datasourceModel.HeaderImage;
            }

            model.RemoteImageUrl = homePage.SiteSettings.RemoteImageUrl;
            DebugUtils.EndLogEvent("TopMenuController.BuildMenu");

            return(View(model));
        }
コード例 #3
0
ファイル: OwnerController.cs プロジェクト: sivapamanchi/Code
        private Section LoadSubSection(Section model, OwnerSectionCache ownerSectionCache)
        {
            //Evaluate if this section should be displayed
            if (SitecoreUtils.EvaluateRules(model.RestrictionRule, model.InnerItem))
            {
                model.HideSection = false;

                var context  = new SitecoreContext();
                var homePage = context.GetHomeItem <BasePage>();

                BlueGreenContext bgContext = new BlueGreenContext();
                string           ownerId   = bgContext.OwnerId;
                if (model.LazyLoadContent)
                {
                }
                else
                {
                    OwnerUtils.GetSectionTableData(ref model, ownerId, homePage.SiteSettings, ownerSectionCache);
                }
            }
            else
            {
                model.HideSection = true;
            }

            return(model);
        }
コード例 #4
0
        public ActionResult PointsSection()
        {
            DebugUtils.StartLogEvent("RewardsController.PointsSection");
            var model = GetLayoutItem <PointsSummary>();

            model = OwnerUtils.GetPointsSummary(model);
            DebugUtils.EndLogEvent("RewardsController.PointsSection");
            return(View(model));
        }
コード例 #5
0
        public ActionResult SubmitSaveMyPoint(string CCName, string CCNumber, string CVV, string ExpMonth, string ExpYear, string ZipCode, string cctype, bool InternationalZipCode)
        {
            SaveMyPointsResponse response = new SaveMyPointsResponse();

            ReservationParameters model = new ReservationParameters();

            model.CreditCard_ExpDateMonth         = ExpMonth;
            model.CreditCard_ExpDateYear          = ExpYear;
            model.CreditCard_Name                 = CCName;
            model.CreditCard_Number               = CCNumber;
            model.CreditCard_VerificationNumber   = CVV;
            model.CreditCard_ZipCode              = ZipCode;
            model.CreditCard_InternationalZipCode = InternationalZipCode;

            BlueGreenContext bgContext = new BlueGreenContext();

            model.CreditCard_Type = FormatUtils.ConvertCreditCard(cctype);


            var listOfError = ValidationUtils.GetCreditCardViolations(model);

            if (listOfError.Count() <= 0)
            {
                BGSitecore.Models.OwnerService.OwnerSavePointsElectRequest.OwnerSavePointsElectRequest request = new BGSitecore.Models.OwnerService.OwnerSavePointsElectRequest.OwnerSavePointsElectRequest();

                request.Identifier = bgContext.OwnerId;


                request.AgentID = "OWNER";

                request.NameOnCard = model.CreditCard_Name;
                request.Amount     = bgContext.GetSavePointsFee;

                request.CreditCardInfo = new BGSitecore.Models.OwnerService.OwnerSavePointsElectRequest.CreditCardInfo();
                request.CreditCardInfo.CreditCardNumber         = model.CreditCard_Number;
                request.CreditCardInfo.CreditCardExpirationDate = ReservationUtils.GetExpDate(model.CreditCard_ExpDateMonth, model.CreditCard_ExpDateYear);
                request.CreditCardInfo.CreditCardType           = model.CreditCard_Type;
                request.CreditCardInfo.CreditCardCVV            = model.CreditCard_VerificationNumber;

                ProfileService service = new ProfileService();

                var pointResponse = service.OwnerSavePointsElect(request);
                if (pointResponse != null && pointResponse.RetCode == "0")
                {
                    response.RetCode = "0";
                    //TODO move this code
                    bgContext.bxgOwner.AnnualPointsExpiration.SavePointsEligible = false;
                    bgContext.bxgOwner.AnnualPointsExpiration.SavePointsFee      = "0.00";
                    bgContext.bxgOwner.AnnualPointsExpiration.SavePointsMessage  = "";

                    //save owner object with updated annualpoints expiration
                    Session["BXGOwner"]          = bgContext.bxgOwner;
                    response.AuthorizationNumber = pointResponse.AuthorizationNumber;
                    OwnerUtils.SetContextToReloadPalett();
                }
                else
                {
                    response.RetCode = "-1";
                    response.errors  = new List <string>();
                    response.errors.Add("Internal error try again later.");
                }
            }
            else
            {
                response.RetCode = "-1";
                response.errors  = new List <string>();
                foreach (var item in listOfError)
                {
                    response.errors.Add(item.ErrorMessage);
                }

                return(Json(response));
            }

            return(Json(response));
        }