/// <summary> /// Returns true if Seller instances are equal /// </summary> /// <param name="other">Instance of Seller to be compared</param> /// <returns>Boolean</returns> public bool Equals(Seller other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Address == other.Address || Address != null && Address.Equals(other.Address) ) && ( ChannelCode == other.ChannelCode || ChannelCode != null && ChannelCode.Equals(other.ChannelCode) ) && ( Description == other.Description || Description != null && Description.Equals(other.Description) ) && ( Geocode == other.Geocode || Geocode != null && Geocode.Equals(other.Geocode) ) && ( Id == other.Id || Id != null && Id.Equals(other.Id) ) && ( InvoiceNumber == other.InvoiceNumber || InvoiceNumber != null && InvoiceNumber.Equals(other.InvoiceNumber) ) && ( Mcc == other.Mcc || Mcc != null && Mcc.Equals(other.Mcc) ) && ( Name == other.Name || Name != null && Name.Equals(other.Name) ) && ( Type == other.Type || Type != null && Type.Equals(other.Type) )); }
/// <summary> /// Initializes a new instance of the ReservationItemModel class. /// </summary> /// <param name="adults">Number of adults</param> /// <param name="arrival">Date of arrival<br />Specify a date and /// time (without fractional second part) in UTC or with UTC offset as /// defined in <a /// href="https://en.wikipedia.org/wiki/ISO_8601">ISO8601:2004</a></param> /// <param name="balance">The balance of this reservation.</param> /// <param name="bookingId">Booking id</param> /// <param name="cancellationFee">Details about the cancellation fee /// for this reservation</param> /// <param name="channelCode">Channel code. Possible values include: /// 'Direct', 'BookingCom', 'Ibe', 'ChannelManager', 'Expedia'</param> /// <param name="created">Date of creation<br />Specify a date /// and time (without fractional second part) in UTC or with UTC offset /// as defined in <a /// href="https://en.wikipedia.org/wiki/ISO_8601">ISO8601:2004</a></param> /// <param name="departure">Date of departure<br />Specify a date /// and time (without fractional second part) in UTC or with UTC offset /// as defined in <a /// href="https://en.wikipedia.org/wiki/ISO_8601">ISO8601:2004</a></param> /// <param name="guaranteeType">The strongest guarantee for the rate /// plans booked in this reservation. Possible values include: /// 'PM6Hold', 'CreditCard', 'Prepayment', 'Company', 'Ota'</param> /// <param name="hasCityTax">Whether the city tax has already been /// added to the reservation. Set to false, if the property does not /// have city tax configured</param> /// <param name="id">Reservation id</param> /// <param name="modified">Date of last modification<br />Specify /// a date and time (without fractional second part) in UTC or with UTC /// offset as defined in <a /// href="https://en.wikipedia.org/wiki/ISO_8601">ISO8601:2004</a></param> /// <param name="noShowFee">Details about the no-show fee for this /// reservation</param> /// <param name="primaryGuest">The primary guest of the /// reservation</param> /// <param name="property">The property</param> /// <param name="ratePlan">The rate plan</param> /// <param name="status">Status of the reservation. Possible values /// include: 'Confirmed', 'InHouse', 'CheckedOut', 'Canceled', /// 'NoShow'</param> /// <param name="totalGrossAmount">Total amount</param> /// <param name="unitGroup">The unit group</param> /// <param name="actions">The list of actions for this /// reservation</param> /// <param name="additionalGuests">Additional guests of the /// reservation.</param> /// <param name="allFoliosHaveInvoice">Whether all folios of a /// reservation have an invoice</param> /// <param name="assignedUnits">The list of units assigned to this /// reservation</param> /// <param name="blockId">Block id</param> /// <param name="booker">The person who made the booking</param> /// <param name="cancellationTime">Time of cancellation, if the /// reservation was canceled<br />Specify a date and time /// (without fractional second part) in UTC or with UTC offset as /// defined in <a /// href="https://en.wikipedia.org/wiki/ISO_8601">ISO8601:2004</a></param> /// <param name="checkInTime">Time of check-in<br />Specify a /// date and time (without fractional second part) in UTC or with UTC /// offset as defined in <a /// href="https://en.wikipedia.org/wiki/ISO_8601">ISO8601:2004</a></param> /// <param name="checkOutTime">Time of check-out<br />Specify a /// date and time (without fractional second part) in UTC or with UTC /// offset as defined in <a /// href="https://en.wikipedia.org/wiki/ISO_8601">ISO8601:2004</a></param> /// <param name="childrenAges">The ages of the children</param> /// <param name="cityTax">The amount of city tax that can be charged /// for this reservation</param> /// <param name="comment">Additional information and comments</param> /// <param name="commission">The information about the OTA /// commission.</param> /// <param name="company">Company for this reservation.</param> /// <param name="corporateCode">Corporate code provided during /// creation. Used to find offers during amend.</param> /// <param name="externalCode">Code in external system</param> /// <param name="guestComment">Additional information and comment by /// the guest</param> /// <param name="noShowTime">Time of setting no-show reservation /// status<br />Specify a date and time (without fractional /// second part) in UTC or with UTC offset as defined in <a /// href="https://en.wikipedia.org/wiki/ISO_8601">ISO8601:2004</a></param> /// <param name="paymentAccount">Payment information</param> /// <param name="services">The list of additional services (extras, /// add-ons) reserved for the stay</param> /// <param name="source">Source of the reservation (e.g Hotels.com, /// Orbitz, etc.)</param> /// <param name="timeSlices">The list of time slices with the reserved /// units / unit groups for the stay</param> /// <param name="travelPurpose">The purpose of the trip, leisure or /// business. Possible values include: 'Business', 'Leisure'</param> /// <param name="unit">The unit</param> /// <param name="validationMessages">Validation rules are applied to /// reservations during their lifetime. /// For example a reservation that was created while the house or unit /// group is already fully booked. /// Whenever a rule was or is currently violated, a validation message /// will be added to this list. /// They can be deleted whenever the hotel staff worked them /// off.</param> public ReservationItemModel(int adults, System.DateTime arrival, MonetaryValueModel balance, string bookingId, ReservationCancellationFeeModel cancellationFee, ChannelCode channelCode, System.DateTime created, System.DateTime departure, GuaranteeType guaranteeType, bool hasCityTax, string id, System.DateTime modified, ReservationNoShowFeeModel noShowFee, GuestModel primaryGuest, EmbeddedPropertyModel property, EmbeddedRatePlanModel ratePlan, ReservationStatus status, MonetaryValueModel totalGrossAmount, EmbeddedUnitGroupModel unitGroup, IList <ActionModelReservationActionNotAllowedReservationActionReason> actions = default(IList <ActionModelReservationActionNotAllowedReservationActionReason>), IList <GuestModel> additionalGuests = default(IList <GuestModel>), bool?allFoliosHaveInvoice = default(bool?), IList <ReservationAssignedUnitModel> assignedUnits = default(IList <ReservationAssignedUnitModel>), string blockId = default(string), BookerModel booker = default(BookerModel), System.DateTime?cancellationTime = default(System.DateTime?), System.DateTime?checkInTime = default(System.DateTime?), System.DateTime?checkOutTime = default(System.DateTime?), IList <int?> childrenAges = default(IList <int?>), AmountModel cityTax = default(AmountModel), string comment = default(string), CommissionModel commission = default(CommissionModel), EmbeddedCompanyModel company = default(EmbeddedCompanyModel), string corporateCode = default(string), string externalCode = default(string), string guestComment = default(string), System.DateTime?noShowTime = default(System.DateTime?), PaymentAccountModel paymentAccount = default(PaymentAccountModel), IList <ReservationServiceItemModel> services = default(IList <ReservationServiceItemModel>), string source = default(string), IList <TimeSliceModel> timeSlices = default(IList <TimeSliceModel>), string travelPurpose = default(string), EmbeddedUnitModel unit = default(EmbeddedUnitModel), IList <ReservationValidationMessageModel> validationMessages = default(IList <ReservationValidationMessageModel>)) { Actions = actions; AdditionalGuests = additionalGuests; Adults = adults; AllFoliosHaveInvoice = allFoliosHaveInvoice; Arrival = arrival; AssignedUnits = assignedUnits; Balance = balance; BlockId = blockId; Booker = booker; BookingId = bookingId; CancellationFee = cancellationFee; CancellationTime = cancellationTime; ChannelCode = channelCode; CheckInTime = checkInTime; CheckOutTime = checkOutTime; ChildrenAges = childrenAges; CityTax = cityTax; Comment = comment; Commission = commission; Company = company; CorporateCode = corporateCode; Created = created; Departure = departure; ExternalCode = externalCode; GuaranteeType = guaranteeType; GuestComment = guestComment; HasCityTax = hasCityTax; Id = id; Modified = modified; NoShowFee = noShowFee; NoShowTime = noShowTime; PaymentAccount = paymentAccount; PrimaryGuest = primaryGuest; Property = property; RatePlan = ratePlan; Services = services; Source = source; Status = status; TimeSlices = timeSlices; TotalGrossAmount = totalGrossAmount; TravelPurpose = travelPurpose; Unit = unit; UnitGroup = unitGroup; ValidationMessages = validationMessages; CustomInit(); }
/// <summary> /// Returns a 13 character array, representing the code word to be sent. /// A code word consists of 9 address bits, 3 data bits, and on sync bit /// but in our case, only the first 8 address bits and the last 2 data /// bits are used. A code bit can have 4 different states: "F" (floating), /// "1" (high), "0" (low), and "S" (synchronous bit).<br/><br/> /// +-------------------------------+--------------------------------+-----------------------------------------+-----------------------------------------+----------------------+------------+ /// | 4 bits address (switch group) | 4 bits address (switch number) | 1 bit address (not used, so never mind) | 1 bit address (not used, so never mind) | 2 data bits (on|off) | 1 sync bit | /// | 1=0FFF 2=F0FF 3=FF0F 4=FFF0 | 1=0FFF 2=F0FF 3=FF0F 4=FFF0 | F | F | on=FF off=F0 | S | /// +-------------------------------+--------------------------------+-----------------------------------------+-----------------------------------------+----------------------+------------+ /// <br/> /// </summary> /// <param name="groupAddress"> /// A bitset containing 5 bits that represent the switch group address. /// </param> /// <param name="chan"> /// The channel (switch) to manipulate. /// </param> /// <param name="status"> /// Whether to switch on (true) or off (false). /// </param> /// <returns> /// If successful, a 13 character array containing the code word; Otherwise, /// a single-character array containing only a null-character. /// </returns> private String GetCodeWordA(BitSet groupAddress, ChannelCode chan, Boolean status) { Int32 returnPos = 0; char[] word = new char[13]; String[] code = new String[6] { "FFFFF", "0FFFF", "F0FFF", "FF0FF", "FFF0F", "FFFF0" }; if (((Int32)chan < 1) || ((Int32)chan > 5)) { return(new String(new char[1] { '\0' })); } for (Int32 i = 0; i < 5; i++) { if (!groupAddress.Get(i)) { word[returnPos++] = 'F'; } else { word[returnPos++] = '0'; } } for (Int32 j = 0; j < 5; j++) { word[returnPos++] = code[(Int32)chan][j]; } if (status) { word[returnPos++] = '0'; word[returnPos++] = 'F'; } else { word[returnPos++] = 'F'; word[returnPos++] = '0'; } word[returnPos] = '\0'; return(new String(word)); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (Address != null) { hashCode = hashCode * 59 + Address.GetHashCode(); } if (ChannelCode != null) { hashCode = hashCode * 59 + ChannelCode.GetHashCode(); } if (Description != null) { hashCode = hashCode * 59 + Description.GetHashCode(); } if (Geocode != null) { hashCode = hashCode * 59 + Geocode.GetHashCode(); } if (Id != null) { hashCode = hashCode * 59 + Id.GetHashCode(); } if (InvoiceNumber != null) { hashCode = hashCode * 59 + InvoiceNumber.GetHashCode(); } if (Mcc != null) { hashCode = hashCode * 59 + Mcc.GetHashCode(); } if (Name != null) { hashCode = hashCode * 59 + Name.GetHashCode(); } if (Type != null) { hashCode = hashCode * 59 + Type.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns a 13 character array, representing the code word to be sent. /// A code word consists of 9 address bits, 3 data bits, and on sync bit /// but in our case, only the first 8 address bits and the last 2 data /// bits are used. A code bit can have 4 different states: "F" (floating), /// "1" (high), "0" (low), and "S" (synchronous bit).<br/><br/> /// +-------------------------------+--------------------------------+-----------------------------------------+-----------------------------------------+----------------------+------------+ /// | 4 bits address (switch group) | 4 bits address (switch number) | 1 bit address (not used, so never mind) | 1 bit address (not used, so never mind) | 2 data bits (on|off) | 1 sync bit | /// | 1=0FFF 2=F0FF 3=FF0F 4=FFF0 | 1=0FFF 2=F0FF 3=FF0F 4=FFF0 | F | F | on=FF off=F0 | S | /// +-------------------------------+--------------------------------+-----------------------------------------+-----------------------------------------+----------------------+------------+ /// <br/> /// </summary> /// <param name="address"> /// The switch group (address). /// </param> /// <param name="chan"> /// The channel (switch) to manipulate. /// </param> /// <param name="status"> /// Whether to switch on (true) or off (false). /// </param> /// <returns> /// a single-character array containing only a null-character. /// </returns> private String GetCodeWordB(AddressCode address, ChannelCode chan, Boolean status) { Int32 returnPos = 0; char[] word = new char[13]; String[] code = new String[5] { "FFFF", "0FFF", "F0FF", "FF0F", "FFF0" }; if (((Int32)address < 1) || ((Int32)address > 4) || ((Int32)chan < 1) || ((Int32)chan > 4)) { return(new String(new char[1] { '\0' })); } for (Int32 i = 0; i < 4; i++) { word[returnPos++] = code[(Int32)address][i]; } for (Int32 j = 0; j < 4; j++) { word[returnPos++] = code[(Int32)chan][j]; } word[returnPos++] = 'F'; word[returnPos++] = 'F'; word[returnPos++] = 'F'; if (status) { word[returnPos++] = 'F'; } else { word[returnPos++] = '0'; } word[returnPos] = '\0'; return(new String(word)); }
internal static string ToSerializedValue(this ChannelCode value) { switch (value) { case ChannelCode.Direct: return("Direct"); case ChannelCode.BookingCom: return("BookingCom"); case ChannelCode.Ibe: return("Ibe"); case ChannelCode.ChannelManager: return("ChannelManager"); case ChannelCode.Expedia: return("Expedia"); } return(null); }
/// <summary> /// Initializes a new instance of the BookingReservationModel class. /// </summary> /// <param name="adults">Number of adults</param> /// <param name="arrival">Date of arrival<br />Specify a date and /// time (without fractional second part) in UTC or with UTC offset as /// defined in <a /// href="https://en.wikipedia.org/wiki/ISO_8601">ISO8601:2004</a></param> /// <param name="cancellationFee">Details about the cancellation fee /// for this reservation</param> /// <param name="channelCode">Channel code. Possible values include: /// 'Direct', 'BookingCom', 'Ibe', 'ChannelManager', 'Expedia'</param> /// <param name="departure">Date of departure<br />Specify a date /// and time (without fractional second part) in UTC or with UTC offset /// as defined in <a /// href="https://en.wikipedia.org/wiki/ISO_8601">ISO8601:2004</a></param> /// <param name="id">Reservation id</param> /// <param name="property">The property</param> /// <param name="ratePlan">The currently active rate plan</param> /// <param name="status">Status of the reservation. Possible values /// include: 'Confirmed', 'InHouse', 'CheckedOut', 'Canceled', /// 'NoShow'</param> /// <param name="totalGrossAmount">Total amount</param> /// <param name="unitGroup">The currently active unit group</param> /// <param name="childrenAges">The ages of the children</param> /// <param name="company">Company for this reservation.</param> /// <param name="externalCode">Code in external system</param> /// <param name="guestComment">Additional information and comment by /// the guest</param> /// <param name="paymentAccount">Payment information</param> /// <param name="services">The list of additional services (extras, /// add-ons) reserved for the stay</param> /// <param name="source">Source of the reservation (e.g Hotels.com, /// Orbitz, etc.)</param> public BookingReservationModel(int adults, System.DateTime arrival, ReservationCancellationFeeModel cancellationFee, ChannelCode channelCode, System.DateTime departure, string id, EmbeddedPropertyModel property, EmbeddedRatePlanModel ratePlan, ReservationStatus status, MonetaryValueModel totalGrossAmount, EmbeddedUnitGroupModel unitGroup, IList <int?> childrenAges = default(IList <int?>), EmbeddedCompanyModel company = default(EmbeddedCompanyModel), string externalCode = default(string), string guestComment = default(string), PaymentAccountModel paymentAccount = default(PaymentAccountModel), IList <ReservationServiceItemModel> services = default(IList <ReservationServiceItemModel>), string source = default(string)) { Adults = adults; Arrival = arrival; CancellationFee = cancellationFee; ChannelCode = channelCode; ChildrenAges = childrenAges; Company = company; Departure = departure; ExternalCode = externalCode; GuestComment = guestComment; Id = id; PaymentAccount = paymentAccount; Property = property; RatePlan = ratePlan; Services = services; Source = source; Status = status; TotalGrossAmount = totalGrossAmount; UnitGroup = unitGroup; CustomInit(); }
/// <summary> /// Switch a remote switch off (Type B with two rotary/sliding switches). /// </summary> /// <param name="address"> /// The address of the switch group. /// </param> /// <param name="channel"> /// The channel (switch) itself. /// </param> public void SwitchOff(AddressCode address, ChannelCode channel) { this.SendTriState(this.GetCodeWordB(address, channel, false).ToCharArray()); }
/// <summary> /// Switch a remote switch off (Type B with two rotary/sliding switches). /// </summary> /// <param name="address"> /// The address of the switch group. /// </param> /// <param name="channel"> /// The channel (switch) itself. /// </param> public void SwitchOff(AddressCode address, ChannelCode channel) { this.SendTriState(this.GetCodeWordB(address, channel, false).ToCharArray()); }
/// <summary> /// Returns a 13 character array, representing the code word to be sent. /// A code word consists of 9 address bits, 3 data bits, and on sync bit /// but in our case, only the first 8 address bits and the last 2 data /// bits are used. A code bit can have 4 different states: "F" (floating), /// "1" (high), "0" (low), and "S" (synchronous bit).<br/><br/> /// +-------------------------------+--------------------------------+-----------------------------------------+-----------------------------------------+----------------------+------------+ /// | 4 bits address (switch group) | 4 bits address (switch number) | 1 bit address (not used, so never mind) | 1 bit address (not used, so never mind) | 2 data bits (on|off) | 1 sync bit | /// | 1=0FFF 2=F0FF 3=FF0F 4=FFF0 | 1=0FFF 2=F0FF 3=FF0F 4=FFF0 | F | F | on=FF off=F0 | S | /// +-------------------------------+--------------------------------+-----------------------------------------+-----------------------------------------+----------------------+------------+ /// <br/> /// </summary> /// <param name="address"> /// The switch group (address). /// </param> /// <param name="chan"> /// The channel (switch) to manipulate. /// </param> /// <param name="status"> /// Whether to switch on (true) or off (false). /// </param> /// <returns> /// a single-character array containing only a null-character. /// </returns> private String GetCodeWordB(AddressCode address, ChannelCode chan, Boolean status) { Int32 returnPos = 0; char[] word = new char[13]; String[] code = new String[5] { "FFFF", "0FFF", "F0FF", "FF0F", "FFF0" }; if (((Int32)address < 1) || ((Int32)address > 4) || ((Int32)chan < 1) || ((Int32)chan > 4)) { return new String(new char[1] { '\0' }); } for (Int32 i = 0; i < 4; i++) { word[returnPos++] = code[(Int32)address][i]; } for (Int32 j = 0; j < 4; j++) { word[returnPos++] = code[(Int32)chan][j]; } word[returnPos++] = 'F'; word[returnPos++] = 'F'; word[returnPos++] = 'F'; if (status) { word[returnPos++] = 'F'; } else { word[returnPos++] = '0'; } word[returnPos] = '\0'; return new String(word); }
/// <summary> /// Returns a 13 character array, representing the code word to be sent. /// A code word consists of 9 address bits, 3 data bits, and on sync bit /// but in our case, only the first 8 address bits and the last 2 data /// bits are used. A code bit can have 4 different states: "F" (floating), /// "1" (high), "0" (low), and "S" (synchronous bit).<br/><br/> /// +-------------------------------+--------------------------------+-----------------------------------------+-----------------------------------------+----------------------+------------+ /// | 4 bits address (switch group) | 4 bits address (switch number) | 1 bit address (not used, so never mind) | 1 bit address (not used, so never mind) | 2 data bits (on|off) | 1 sync bit | /// | 1=0FFF 2=F0FF 3=FF0F 4=FFF0 | 1=0FFF 2=F0FF 3=FF0F 4=FFF0 | F | F | on=FF off=F0 | S | /// +-------------------------------+--------------------------------+-----------------------------------------+-----------------------------------------+----------------------+------------+ /// <br/> /// </summary> /// <param name="groupAddress"> /// A bitset containing 5 bits that represent the switch group address. /// </param> /// <param name="chan"> /// The channel (switch) to manipulate. /// </param> /// <param name="status"> /// Whether to switch on (true) or off (false). /// </param> /// <returns> /// If successful, a 13 character array containing the code word; Otherwise, /// a single-character array containing only a null-character. /// </returns> private String GetCodeWordA(BitSet groupAddress, ChannelCode chan, Boolean status) { Int32 returnPos = 0; char[] word = new char[13]; String[] code = new String[6] { "FFFFF", "0FFFF", "F0FFF", "FF0FF", "FFF0F", "FFFF0" }; if (((Int32)chan < 1) || ((Int32)chan > 5)) { return new String(new char[1] { '\0' }); } for (Int32 i = 0; i < 5; i++) { if (!groupAddress.Get(i)) { word[returnPos++] = 'F'; } else { word[returnPos++] = '0'; } } for (Int32 j = 0; j < 5; j++) { word[returnPos++] = code[(Int32)chan][j]; } if (status) { word[returnPos++] = '0'; word[returnPos++] = 'F'; } else { word[returnPos++] = 'F'; word[returnPos++] = '0'; } word[returnPos] = '\0'; return new String(word); }