Esempio n. 1
0
 public static void MapCustomerDetailsToDynamic(dynamic vm, ReservationDetailsModel reservationDetails)
 {
     vm.ReservationId    = reservationDetails.ReservationId;
     vm.CustomerId       = reservationDetails.CustomerId;
     vm.HotelId          = reservationDetails.HotelId;
     vm.CheckIn          = reservationDetails.CheckIn;
     vm.CheckOut         = reservationDetails.CheckOut;
     vm.PayAtHotel       = reservationDetails.PayAtHotel;
     vm.PaymentId        = reservationDetails.PaymentId;
     vm.CustomerComments = reservationDetails.CustomerComments;
     vm.HotelName        = reservationDetails.HotelName;
 }
        public void CompareNewGetReservationDetailstoOldQuery()
        {
            ReservationDetailsModel rModel = new ReservationDetailsModel();

            var newQuery = rModel.getVehicleDetails(null, 0, null, null, null, null, null, null, null, null, null, "ResDetails", null,
                                                    null, null, null, null, null, "19/06/2014", "21/06/2014", "").OrderBy(d => d.ResId);
            var oldQuery = getVehicleDetailsWithOldQuery(null, 0, null, null, null, null, null, null, null, null, null, "ResDetails",
                                                         null,
                                                         null, null, null, null, null, "19/06/2014", "21/06/2014", "").OrderBy(d => d.ResId);



            var q2 = oldQuery.Select(t => t.ResId)
                     .Except(newQuery.Select(e => e.ResId))
                     .ToList();
        }
Esempio n. 3
0
        private async Task PageOnLoad()
        {
            IsRunningIndicator = true;
            IsVisibleIndicator = true;
            IsVisibleData      = false;

            RoomStatusModel roomStatusModel = new RoomStatusModel();

            var responce = await GetAPIservice.GetReservationDetails(Settings.HotelCode, ReservationsHeader.ReservationID);

            if (!string.IsNullOrEmpty(responce))
            {
                ReservationDetailsModel reservationDetails = JsonConvert.DeserializeObject <ReservationDetailsModel>(responce);
                if (reservationDetails != null)
                {
                    reservationDetails.RoomStatusColor = "Black";

                    if (!string.IsNullOrEmpty(ReservationsHeader.RoomNumber) && ReservationsHeader.RoomNumber.All(Char.IsDigit))
                    {
                        var roomResponce = await GetAPIservice.GetRoomStatus(Settings.HotelCode, ReservationsHeader.RoomNumber);

                        if (!string.IsNullOrEmpty(roomResponce))
                        {
                            roomStatusModel = JsonConvert.DeserializeObject <RoomStatusModel>(roomResponce);
                            if (roomStatusModel != null)
                            {
                                reservationDetails.RoomStatusColor = roomStatusModel.RoomStatus == "Clean" ? "Green" : roomStatusModel.RoomStatus == "Inspected" ? "Orange" : "Red";
                                reservationDetails.RoomStatus      = !string.IsNullOrEmpty(roomStatusModel.RoomStatus) ? roomStatusModel.RoomStatus : "Not Assigned";
                            }
                        }
                    }
                    else
                    {
                        reservationDetails.RoomStatusColor = "Red";
                        reservationDetails.RoomStatus      = !string.IsNullOrEmpty(roomStatusModel.RoomStatus) ? roomStatusModel.RoomStatus : "Not Assigned";
                        reservationDetails.RoomNumber      = reservationDetails.RoomNumber.All(Char.IsDigit) && !string.IsNullOrEmpty(reservationDetails.RoomNumber) ? reservationDetails.RoomNumber : "Not Assigned";
                    }

                    BadgeRemarksIcon = $"Numbers/badge{Constants.SelectedNoticesRemarksSet.RemarksList.Count}.png";

                    ReservationDetails = reservationDetails;
                    IsRunningIndicator = false;
                    IsVisibleIndicator = false;
                    IsVisibleData      = true;
                }
            }
        }
Esempio n. 4
0
        private async Task PostReservationDetails(ReservationDetailsModel reservationDetails)
        {
            HttpContent jasonHttpContent = new StringContent(JsonConvert.SerializeObject(reservationDetails),
                                                             Encoding.UTF8, "application/json");

            var result = await ReservationsWriteApiTask(jasonHttpContent);

            HttpStatusCode resultStatusCode = result.StatusCode;

            if (resultStatusCode == HttpStatusCode.OK)
            {
            }

            if (resultStatusCode != HttpStatusCode.OK)
            {
                // issues?
            }
        }