Exemple #1
0
        async void roomStatusDetails()
        {
            try
            {
                roomStatus roomStatusResult = await roomStatus.roomStatusDetails(Constants.result.RoomNumber);

                if (roomStatusResult != null)
                {
                    Constants.result.RoomStatus      = roomStatusResult.RoomstatusDetail;
                    Constants.result.RoomStatusColor = roomStatusResult.RoomStatusColor;
                    Constants._roomStatus            = roomStatusResult.RoomstatusDetail;

                    RoomNoText.Text      = Constants.result.RoomNumber;
                    RoomNoText.TextColor = serviceDataValidation.validationColor(Constants.result.RoomNumber);

                    RoomStatus.Text      = Constants.result.RoomStatus;
                    RoomStatus.TextColor = Constants.result.RoomStatusColor;

                    RegistrationButton.IsVisible = true;
                    RoomNoText.IsVisible         = true;
                    //AssignRoomButton.IsVisible = false;

                    MessagingCenter.Send <ReservationInfo, ReservationDetails>(this, Constants._roomAssignedUpdateReservationList, Constants.result);
                }
            }
            catch
            {
                //var reload = await DisplayAlert(Constants._headerMessage, "Unable To Assign Room", Constants._buttonTryAgain, Constants._buttonClose);
                //if (reload)
                //{
                //	roomStatusDetails();
                //}
                //else {
                //	roomStatusDetails();
                //}
            }
        }
Exemple #2
0
        public async Task <ReservationDetails> reservationInformation()
        {
            try
            {
                var output = JObject.Parse(Constants.resultMain);

                reservationDetails.ClientName = serviceDataValidation.validation(Convert.ToString(output["d"]["results"][0]["Xclientname"]));

                string temporary_date_holder = output["d"]["results"][0]["XfLlgda"].ToString();
                temporary_date_holder = temporary_date_holder.Split('(', ')')[0];
                DateTime dt1            = DateTime.Parse(temporary_date_holder);
                int      arrivalDateDay = int.Parse(dt1.Day.ToString());
                reservationDetails.ArrivalDate = dt1.ToString("dd-MM-yyyy");


                string temporary_date_holder2 = output["d"]["results"][0]["XfSlida"].ToString();
                temporary_date_holder2 = temporary_date_holder2.Split('(', ')')[0];
                DateTime dt2 = DateTime.Parse(temporary_date_holder2);
                int      departureDateDay = int.Parse(dt2.Day.ToString());
                reservationDetails.DepartureDate = dt2.ToString("dd-MM-yyyy");

                reservationDetails.NoOfNights = Convert.ToString((dt2 - dt1).TotalDays);

                //number of guestsy
                string adult = "", child = "", guide = "", freeChild = "";

                if (serviceDataValidation.paxValidation(Convert.ToString(output["d"]["results"][0]["XnumPax1"])) != "")
                {
                    adult = "Adults (" + serviceDataValidation.paxValidation(Convert.ToString(output["d"]["results"][0]["XnumPax1"])) + ")";
                }
                if (serviceDataValidation.paxValidation(Convert.ToString(output["d"]["results"][0]["XnumPax2"])) != "")
                {
                    child = "Child (" + serviceDataValidation.paxValidation(Convert.ToString(output["d"]["results"][0]["XnumPax2"])) + ")";
                }
                if (serviceDataValidation.paxValidation(Convert.ToString(output["d"]["results"][0]["XnumPax3"])) != "")
                {
                    guide = "Guide (" + serviceDataValidation.paxValidation(Convert.ToString(output["d"]["results"][0]["XnumPax3"])) + ")";
                }
                if (serviceDataValidation.paxValidation(Convert.ToString(output["d"]["results"][0]["XnumPax4"])) != "")
                {
                    freeChild = "Child Free (" + serviceDataValidation.paxValidation(Convert.ToString(output["d"]["results"][0]["XnumPax4"])) + ")";
                }

                reservationDetails.PaxCount              = adult + child + guide + freeChild;
                reservationDetails.RoomType              = serviceDataValidation.validation(Convert.ToString(output["d"]["results"][0]["XtipoHabDes"]));
                reservationDetails.UpgradedRoomType      = serviceDataValidation.validation(Convert.ToString(output["d"]["results"][0]["XtipoHabUpgDes"]));
                reservationDetails.UpgradedRoomTypeColor = serviceDataValidation.validationColor(reservationDetails.UpgradedRoomType);
                reservationDetails.RoomNumber            = serviceDataValidation.validation(Convert.ToString(output["d"]["results"][0]["XhabitacionId"]));
                reservationDetails.RoomColor             = serviceDataValidation.validationColor(reservationDetails.RoomNumber);
                reservationDetails.MealPlan              = serviceDataValidation.validation(Convert.ToString(output["d"]["results"][0]["XregimenDes"]));

                if (reservationDetails.RoomNumber != Constants._notAvailable)
                {
                    roomStatus roomStatusResult = await roomStatus.roomStatusDetails(reservationDetails.RoomNumber);

                    if (roomStatusResult != null)
                    {
                        reservationDetails.RoomStatus      = roomStatusResult.RoomstatusDetail;
                        reservationDetails.RoomStatusColor = roomStatusResult.RoomStatusColor;
                        Constants._roomStatus = roomStatusResult.RoomstatusDetail;
                    }
                }
                else
                {
                    reservationDetails.RoomStatus      = Constants._notAvailable;
                    reservationDetails.RoomStatusColor = Color.Red;
                }
                if (Enumerable.Count(output["d"]["results"][0]["ReservationFlightSet01"]["results"]) != 0)
                {
                    if (Convert.ToString(output["d"]["results"][0]["ReservationFlightSet01"]["results"][0]["ArrFlightNo"]) != "")
                    {
                        reservationDetails.ArrivalFlight = Convert.ToString(output["d"]["results"][0]["ReservationFlightSet01"]["results"][0]["ArrFlightNo"]) + "  " +
                                                           Convert.ToString(output["d"]["results"][0]["ReservationFlightSet01"]["results"][0]["ArrFlightTi"]);


                        if (!string.IsNullOrEmpty(reservationDetails.ArrivalFlight) && reservationDetails.ArrivalFlight.Contains(" "))
                        {
                            var splitted = reservationDetails.ArrivalFlight.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
                            Constants._arrFlight     = splitted[0];
                            Constants._arrFlightTIme = GeneratePayloadDate(splitted[1]);
                        }
                        else
                        {
                            Constants._arrFlight     = "";
                            Constants._arrFlightTIme = "";
                        }
                    }
                    else
                    {
                        reservationDetails.ArrivalFlight      = Constants._notAvailable;
                        reservationDetails.ArrivalFlightColor = Color.Red;
                    }
                    if (Convert.ToString(output["d"]["results"][0]["ReservationFlightSet01"]["results"][0]["DepFlightNo"]) != "")
                    {
                        reservationDetails.DepartureFlight = Convert.ToString(output["d"]["results"][0]["ReservationFlightSet01"]["results"][0]["DepFlightNo"]) + "  " +
                                                             Convert.ToString(output["d"]["results"][0]["ReservationFlightSet01"]["results"][0]["DepFlightTi"]);

                        if (!string.IsNullOrEmpty(reservationDetails.DepartureFlight) && reservationDetails.DepartureFlight.Contains(" "))
                        {
                            var splitted = reservationDetails.DepartureFlight.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
                            Constants._depFlight     = splitted[0];
                            Constants._depFlightTIme = GeneratePayloadDate(splitted[1]);
                        }
                        else
                        {
                            Constants._depFlight     = "";
                            Constants._depFlightTIme = "";
                        }
                    }
                    else
                    {
                        reservationDetails.DepartureFlight      = Constants._notAvailable;
                        reservationDetails.DepartureFlightColor = Color.Red;
                    }
                }
            }
            catch (Exception)
            {
            }
            return(reservationDetails);
        }