Ejemplo n.º 1
0
        private void PopulateAllReservations(ReservationListModel model)
        {
            BGO.ResortsService.ReservationHistory       history          = new BGO.ResortsService.ReservationHistory();
            BGO.ResortsService.ReservationHistoryList   historyResult    = new BGO.ResortsService.ReservationHistoryList();
            BGO.ResortsService.ResortsServiceClient     reservationAS400 = new BGO.ResortsService.ResortsServiceClient();
            BGO.ResortsService.ReservationHistoryItem[] histories        = null;
            BGO.ResortsService.OwnerID owner = new BGO.ResortsService.OwnerID();

            try
            {
                history.OwnerID           = null;
                owner.OwnerVacationNumber = BXGOwner.Arvact;
                history.OwnerID           = owner;
                history.SiteName          = BGO.ResortsService.Sites.OnlinePoints;
                history.EffectiveDate     = DateTime.Now;

                history.SearchHistoryBy = BGO.ResortsService.ReservationHistoryType.Future;

                if (ViewData["myPendingHistoryBind"] == null)
                {
                    historyResult = reservationAS400.GetReservationsHistory(history);

                    if (historyResult.Success)
                    {
                        histories = historyResult.ReservationHistoryItem;
                        model.PendingReservations = PopulateReservationsList(histories, BGO.ResortsService.ReservationHistoryType.Future);
                        //ViewData["myPendingHistoryBind"] = histories;
                    }
                }

                if (ViewData["myPastHistoryBind"] == null)
                {
                    history.SearchHistoryBy = BGO.ResortsService.ReservationHistoryType.Past;
                    historyResult           = reservationAS400.GetReservationsHistory(history);

                    if (historyResult.Success)
                    {
                        histories = historyResult.ReservationHistoryItem;
                        model.PastReservations = PopulateReservationsList(histories, BGO.ResortsService.ReservationHistoryType.Past);
                        //ViewData["myPastHistoryBind"] = histories;
                    }
                }

                if (reservationAS400.State != System.ServiceModel.CommunicationState.Faulted)
                {
                    reservationAS400.Close();
                }
            }
            catch (Exception ex)
            {
                if (reservationAS400.State != System.ServiceModel.CommunicationState.Faulted)
                {
                    reservationAS400.Close();
                }

                StringBuilder errMsg = new StringBuilder();
                errMsg.Append("Error happened fetching Reservations List"); errMsg.Append(ex.Message);
                sendMail.sendMessage("*****@*****.**", "", "Exception Error - Getting Reservation List", errMsg);
            }
        }
Ejemplo n.º 2
0
        public void PopulateReservationInfo(MyReservationsDetailsModel detailsModel)
        {
            BXGOwner = (BGO.OwnerWS.Owner)Session["BXGOwner"];

            BGO.ResortsService.ReservationHistory       history          = new BGO.ResortsService.ReservationHistory();
            BGO.ResortsService.ReservationHistoryList   historyResult    = new BGO.ResortsService.ReservationHistoryList();
            BGO.ResortsService.ResortsServiceClient     reservationAS400 = new BGO.ResortsService.ResortsServiceClient();
            BGO.ResortsService.ReservationHistoryItem[] histories        = null;
            BGO.ResortsService.OwnerID owner = new BGO.ResortsService.OwnerID();

            try
            {
                history.OwnerID           = null;
                owner.OwnerVacationNumber = BXGOwner.Arvact;
                history.OwnerID           = owner;
                history.SiteName          = BGO.ResortsService.Sites.OnlinePoints;
                history.EffectiveDate     = DateTime.Now;

                history.SearchHistoryBy = BGO.ResortsService.ReservationHistoryType.Both;
                historyResult           = reservationAS400.GetReservationsHistory(history);
                if (historyResult.Success)
                {
                    histories = historyResult.ReservationHistoryItem;
                    foreach (BGO.ResortsService.ReservationHistoryItem reservationItem in histories)
                    {
                        if (reservationItem._ReservationNumber == detailsModel.ReservationNo)
                        {
                            detailsModel.GuestName        = reservationItem._GuestFullName;
                            detailsModel.MaxOccupancy     = reservationItem._MaximumOccupancy;
                            detailsModel.ReservationType  = reservationItem._ReservationType;
                            detailsModel.NumberOfNights   = Convert.ToInt32(reservationItem._NumberOfNights);
                            detailsModel.NumberOfAdults   = reservationItem._NumberOfAdults;
                            detailsModel.PolicyStatus     = reservationItem._PolicyStatus;
                            detailsModel.ConfirmationDate = Convert.ToDateTime(reservationItem._DateConfirmed).ToString();
                            detailsModel.CheckIn          = Convert.ToDateTime(reservationItem._CheckInDate).ToString();
                            //detailsModel.ConfirmationDate = String.Format("{0:M/d/yyyy}", Convert.ToDateTime(reservationItem._DateConfirmed));
                            //detailsModel.CheckIn = String.Format("{0:M/d/yyyy}", Convert.ToDateTime(reservationItem._CheckInDate));
                            //detailsModel.CheckOut = reservationItem.  TODO: WHERE DOES THIS COME FROM
                            detailsModel.Amount = Convert.ToDouble(reservationItem._Amount); //TO DO:  IS THIS hfAmount?????????

                            if (detailsModel.ReservationType == "PSE")
                            {
                                detailsModel.ResortNo = "85";
                            }

                            if (reservationItem._Points == "")
                            {
                                detailsModel.Points = "0";
                            }
                            else
                            {
                                detailsModel.Points = String.Format("{0:#,###}", reservationItem._Points.Trim());
                            }

                            //Tax calculations are used for points
                            double tax = Convert.ToDouble(Utilities.getResortInfo(Convert.ToInt32(reservationItem._ProjectStay)).TaxRate);
                            if (detailsModel.NumberOfNights == 1)
                            {
                                detailsModel.NumberOfNights = 2;
                            }

                            tax = tax * Convert.ToDouble(detailsModel.Amount / detailsModel.NumberOfNights); //The tax charge daily
                            tax = Math.Round(tax, 2, MidpointRounding.AwayFromZero);                         //Round up tax charge to a penny.
                            double total = tax * detailsModel.NumberOfNights + detailsModel.Amount;

                            if (detailsModel.ReservationType == "Bonus Time")
                            {
                                detailsModel.PayType = "Amount:";
                                detailsModel.Points  = String.Format("{0:c}", total); //TODO: locate difference between Me.controls and controls.  Just means this instance right???
                                detailsModel.Points  = detailsModel.Amount.ToString();
                            }
                            else if (detailsModel.ReservationType == "Flex")
                            {
                                detailsModel.PayType = "Nights:";
                                detailsModel.Points  = detailsModel.NumberOfNights.ToString();
                            }
                            else
                            {
                                detailsModel.PayType = "Points:";
                            }


                            //TODO: Get Villa Description and Handicap accessible, checkout
                        }
                    }
                }

                if (reservationAS400.State != System.ServiceModel.CommunicationState.Faulted)
                {
                    reservationAS400.Close();
                }
            }
            catch (Exception ex)
            {
                if (reservationAS400.State != System.ServiceModel.CommunicationState.Faulted)
                {
                    reservationAS400.Close();
                }

                StringBuilder errMsg = new StringBuilder();
                errMsg.Append("Error happened fetching Reservations List");
                errMsg.Append(ex.Message);
                sendMail.sendMessage("*****@*****.**", "", "Exception Error - Getting Reservation List", errMsg);
            }

            //BGO.ResortsService.ReservationHistoryItem =
        }
Ejemplo n.º 3
0
        public ActionResult ViewPPP(string reservationNo, string resortNo)
        {
            BXGOwner = (BGO.OwnerWS.Owner)Session["BXGOwner"];
            BGO.ResortsService.OwnerID owner = new BGO.ResortsService.OwnerID();

            //searching for the clicked reservation item so that the session can be set for the next page.
            BGO.ResortsService.ReservationHistory       history          = new BGO.ResortsService.ReservationHistory();
            BGO.ResortsService.ReservationHistoryList   historyResult    = new BGO.ResortsService.ReservationHistoryList();
            BGO.ResortsService.ResortsServiceClient     reservationAS400 = new BGO.ResortsService.ResortsServiceClient();
            BGO.ResortsService.ReservationHistoryItem[] histories        = null;

            history.OwnerID           = null;
            owner.OwnerVacationNumber = BXGOwner.Arvact;

            history.OwnerID       = owner;
            history.SiteName      = BGO.ResortsService.Sites.OnlinePoints;
            history.EffectiveDate = DateTime.Now;

            history.SearchHistoryBy = BGO.ResortsService.ReservationHistoryType.Future;
            historyResult           = reservationAS400.GetReservationsHistory(history);
            if (historyResult.Success)
            {
                histories = historyResult.ReservationHistoryItem;
                foreach (BGO.ResortsService.ReservationHistoryItem reservationItem in histories)
                {
                    if (reservationItem._ReservationNumber == reservationNo)
                    {
                        Session["ReservationSelected4Details"] = reservationItem;
                    }
                }
            }
            ResortInfo resortInfo = Utilities.getResortInfo(Convert.ToInt32(resortNo));
            dynamic    ourResorts = null;
            int        ourResortsContentId;
            string     ourResortsContentIdString = ConfigurationManager.AppSettings["ourResortsContentId"];

            if (!string.IsNullOrWhiteSpace(ourResortsContentIdString) && Int32.TryParse(ourResortsContentIdString, out ourResortsContentId))
            {
                ourResorts = Umbraco.TypedContent(ourResortsContentId);
            }

            //Populate the image based on the resorts.
            if (ourResorts != null)
            {
                foreach (IPublishedContent content in ourResorts.Children)
                {
                    if (content.DocumentTypeAlias.Equals("Resort"))
                    {
                        if (resortInfo.ResortID == content.GetPropertyValue <string>("DatabaseId"))
                        {
                            Session["ReservResortImage"] = content.GetPropertyValue <string>("ResortImage");
                            Session["ReservResortUrl"]   = content.Url;
                        }
                    }
                }
            }
            Session["BuyPPPResortNo"] = resortNo;
            Session["resortcity"]     = String.Concat(resortInfo.City, ", ", resortInfo.State, "    ", resortInfo.PostalCode);
            string path   = BGModern.HtmlExtensions.CustomHtmlHelpers.GetParentSitePath(null).ToString();
            string pppUrl = string.Concat(path, "/owner/ptsPurchaseppp.aspx?Origin=myreservation&resno=", reservationNo + "&ResortNo=" + Session["BuyPPPResortNo"]);

            return(Redirect(pppUrl));
        }