// GET: ResortLocator
        public ActionResult Resort()
        {
            DebugUtils.StartLogEvent("ResortController.Resort");

            var model = GetLayoutItem <ResortDetails>();

            //Save background image URL to be used on the home page
            if (model.HomePageBackgroundImage != null)
            {
                ResortUtils.SaveResortImageBackground(model.HomePageBackgroundImage.ImageFullUrl());
                ResortUtils.SaveResortBackgroundCaption(model.HomePageBackgroundImage.BuildResortCaption());
            }
            DebugUtils.EndLogEvent("ResortController.Resort");
            return(View(model));
        }
Exemple #2
0
        private void AddBackgroundImage(IndexSearch model)
        {
            model.UseBackgroundImageUrl  = ResortUtils.GetResortImageBackground();
            model.BackgroundImageCaption = ResortUtils.GetResortBackgroundCaption();

            if (string.IsNullOrEmpty(model.UseBackgroundImageUrl))
            {
                if (model.RandomBackgroundImageList != null && model.RandomBackgroundImageList.Count() > 0)
                {
                    Random rnd        = new Random();
                    int    imageCount = rnd.Next(model.RandomBackgroundImageList.Count());
                    var    bgImage    = model.RandomBackgroundImageList.ElementAt(imageCount);
                    model.UseBackgroundImageUrl  = bgImage.ImageFullUrl();
                    model.BackgroundImageCaption = bgImage.BuildResortCaption();
                }
            }
        }
Exemple #3
0
 /// <summary>
 /// Builds up a JSON version of the resorts list for the Explorer filtering
 /// </summary>
 /// <returns></returns>
 public string AllResortsToJson()
 {
     return(ResortUtils.BuildResortsJson(this.AllResorts));
 }
        public ActionResult ReservationConfirmation()
        {
            var model = GetLayoutItem <ReservationConfirmation>();
            BlueGreenContext bgcontext = new BlueGreenContext();
            var reservationNo          = Request.QueryString["reservationNo"];

            if (!string.IsNullOrEmpty(reservationNo))
            {
                var reservationType = Request.QueryString["type"];
                model.ActiveReservation = bgcontext.GetActiveReservation(reservationNo, reservationType);

                model.BxgOwner = bgcontext.bxgOwner;
                if (model.ActiveReservation != null)
                {
                    model.taxTotal = ReservationUtils.CalculateReservationTax(model.ActiveReservation);
                    model.ActiveReservation.Amount = model.taxTotal + model.ActiveReservation.AmountDue;
                    model.Guest_NumberOfGuest      = model.ActiveReservation.NumberOfAdults;

                    string specialCharacter = Sitecore.Configuration.Settings.GetSetting("IdentifierForSpecialRequestFromBGO");
                    model.ActiveReservation.Comments = StringUtils.Between(model.ActiveReservation.Comments, specialCharacter, specialCharacter);

                    Session["ActiveReservation"] = model.ActiveReservation;

                    Session["instanceResort"] = ResortUtils.GetResortInfoDetails(FormatUtils.ConvertStringToInt(model.ActiveReservation.ProjectStay), model.ActiveReservation.MaximumOccupancy);

                    //setup session object requied by the Cancel page
                    ReservationHistoryItem tmp = new ReservationHistoryItem();  //This is the object cancel expect in the session
                    DateTime DateConfirmed     = DateTime.Parse(FormatUtils.GetDate(model.ActiveReservation.DateConfirmed));
                    tmp._DateConfirmed = DateConfirmed.ToString("yyyyMMdd");


                    tmp._Points = model.ActiveReservation.Points;
                    DateTime checkinDate = DateTime.Parse(FormatUtils.GetDate(model.ActiveReservation.CheckInDate));
                    tmp._CheckInDate       = checkinDate.ToString("yyyyMMdd");
                    tmp._ReservationType   = model.ActiveReservation.ReservationType;
                    tmp._NumberOfNights    = model.ActiveReservation.NumberOfNights.ToString();
                    tmp._Amount            = model.ActiveReservation.Amount.ToString();
                    tmp._AmountDue         = model.ActiveReservation.AmountDue.ToString();
                    tmp._ReservationNumber = model.ActiveReservation.ReservationNumber;
                    tmp._ReservationStatus = model.ActiveReservation.ReservationStatus;
                    tmp._GuestFullName     = model.ActiveReservation.Guests[0].FullName;
                    tmp._NumberOfAdults    = model.ActiveReservation.NumberOfAdults;
                    tmp._MaximumOccupancy  = model.ActiveReservation.MaximumOccupancy;
                    tmp._Handicap          = model.ActiveReservation.Handicap;

                    var Room = ResortManager.GetRoom(Convert.ToInt16(model.ActiveReservation.ProjectStay), model.ActiveReservation.AS400UnitType);
                    if (Room != null)
                    {
                        tmp._VillaDescription = Room.ViewTitle;
                    }
                    tmp._PolicyStatus = FormatUtils.PolicyStatus(model.ActiveReservation.PolicyStatus, model.ActiveReservation.EligibleDate, reservationType, model.ActiveReservation.ReservationNumber, model.ActiveReservation.ExchangeCode, model.ActiveReservation.ReservationType);
                    Session["ReservationSelected4Details"] = tmp;


                    Session["PPPStatus"]  = tmp._PolicyStatus;
                    Session["PPPFee"]     = model.ActiveReservation.PolicyPrice;
                    Session["resConfNum"] = model.ActiveReservation.ReservationNumber;

                    //Only get the Guests when reservation is Points
                    if (model.ActiveReservation.ReservationType == "P")
                    {
                        BGSitecore.Services.ResortService resortService = new BGSitecore.Services.ResortService();
                        var allGuest = resortService.OwnerGuestList(bgcontext.OwnerId);
                        if (allGuest != null && allGuest.Guests != null && allGuest.Guests.Count() > 0)
                        {
                            if (model.allGuest == null)
                            {
                                model.allGuest = new List <BGSitecore.Models.ResortService.ScreeningBookReservationResponse.Guest>();
                            }
                            foreach (BGSitecore.Models.ResortService.OwnerGuestList.Guest guest in allGuest.Guests)
                            {
                                if (model.ActiveReservation.Guests != null && model.ActiveReservation.Guests.Count > 0)
                                {
                                    if (guest.GuestID == model.ActiveReservation.Guests[0].GuestID)
                                    {
                                        //Email and phone number are not return with the reservation.  We need to get those values from the list or guests
                                        if (guest.Emails != null && guest.Emails.Count > 0)
                                        {
                                            model.ActiveReservation.Guests[0].Emails = new List <Models.ResortService.ReservationsList.Email>();
                                            Models.ResortService.ReservationsList.Email email = new Models.ResortService.ReservationsList.Email();
                                            email.EmailAddress = guest.Emails[0].EmailAddress;
                                            model.ActiveReservation.Guests[0].Emails.Add(email);
                                        }
                                        if (guest.Phones != null && guest.Phones.Count > 0)
                                        {
                                            model.ActiveReservation.Guests[0].Phones = new List <Models.ResortService.ReservationsList.Phone>();
                                            Models.ResortService.ReservationsList.Phone phone = new Models.ResortService.ReservationsList.Phone();
                                            phone.PhoneNumber = guest.Phones[0].PhoneNumber;
                                            model.ActiveReservation.Guests[0].Phones.Add(phone);
                                        }
                                    }
                                }
                                var findExistingGuest = from existingGuest in model.ActiveReservation.Guests
                                                        where existingGuest.FullName == guest.LastName + " ," + guest.FirstName &&
                                                        existingGuest.GuestID == "0"
                                                        select existingGuest;

                                if (findExistingGuest != null && findExistingGuest.Count() > 0)
                                {
                                    findExistingGuest.First().GuestID = guest.GuestID;
                                }
                                else
                                {
                                    model.allGuest.Add(ReservationUtils.MapOwnerGuestToReservationGuest(guest));
                                }
                            }
                        }
                    }
                }
                return(View(model));
            }
            else
            {
                return(null);
            }
        }