Example #1
0
        /// <summary>
        /// Asignamos los valores de ReservationOrigos a nuestro objeto Guest
        /// </summary>
        /// <param name="reservationOrigos">ReservationOrigos</param>
        /// <history>
        /// [erosado] 18/08/2016  Created.
        /// </history>
        public void SetRervationOrigosInfo(ReservationOrigos reservationOrigos)
        {
            //Asignamos el folio de reservacion
            Guest.guHReservID  = reservationOrigos.Folio;
            Guest.guLastName1  = reservationOrigos.LastName;
            Guest.guFirstName1 = reservationOrigos.FirstName;
            Guest.guCheckInD   = reservationOrigos.Arrival;
            Guest.guCheckOutD  = reservationOrigos.Departure;
            Guest.guRoomNum    = reservationOrigos.Room;
            //Calculamos Pax
            decimal pax;
            bool    convertPax = decimal.TryParse($"{reservationOrigos.Adults}.{reservationOrigos.Children}", out pax);

            Guest.guPax = convertPax ? pax : 0;
            //Obtenemos el Id del Hotel
            var ls = BRLeadSources.GetLeadSourceByID(reservationOrigos.Hotel);

            Guest.guHotel = ls?.lsho;
            //Country
            Guest.guco = Countries.Where(x => x.coN == reservationOrigos.Country).Select(x => x.coID).FirstOrDefault();
            //Agency
            Guest.guag = Agencies.Where(x => x.agN.ToUpper() == reservationOrigos.Agency.ToUpper()).Select(x => x.agID).FirstOrDefault();
            //Company
            Guest.guCompany = reservationOrigos.Company;
            //Membership
            Guest.guMembershipNum = reservationOrigos.Membership;
            //Notificamos el cambio
            OnPropertyChanged(nameof(Guest));
        }