/// <summary> /// Maps the guest detail. /// </summary> /// <param name="person">The person.</param> /// <param name="guestPersonDetailList">The guest person detail list.</param> /// <param name="guestReservationDetailList">The guest reservation detail list.</param> /// <param name="guestAlerts">The guest alerts.</param> /// <param name="guestAlertMessages">The guest alert messages.</param> /// <param name="guestPersonMessages">The guest person messages.</param> /// <param name="guestMessages">The guest messages.</param> private static void MapGuestDetail(Person person, GuestCollection guestPersonDetailList, GuestCollection guestReservationDetailList, IDictionary<string, AlertCollection> guestAlerts, IDictionary<string, Collection<Message>> guestAlertMessages, IDictionary<string, PersonMessageCollection> guestPersonMessages, IDictionary<string, Collection<Message>> guestMessages, IDictionary<string, FolioCollection> folioList) { var debarkPersonalDetails = new DebarkPersonDetailCollection(); person.Guests.Iterate(a => { var guestReservationDetail = guestReservationDetailList.Where(b => a.GuestId.Equals(b.GuestId)).FirstOrDefault(); var guestPersonalDetail = guestPersonDetailList.Where(c => a.GuestId.Equals(c.GuestId)).FirstOrDefault(); if (guestReservationDetail != null) { a.CruiseDetail = guestReservationDetail.CruiseDetail; } if (guestPersonalDetail != null) { a.PersonalDetail = guestPersonalDetail.PersonalDetail; } var guestAlertCollection = guestAlerts.ContainsKey(a.GuestId) ? guestAlerts[a.GuestId] : null; guestAlertCollection.Iterate(b => b.Message = guestAlertMessages.ContainsKey(b.AlertId) ? guestAlertMessages[b.AlertId].FirstOrDefault() : null); if (guestAlertCollection != null) { a.AssignAlerts(guestAlertCollection); } var messageCollection = guestPersonMessages.ContainsKey(a.GuestId) ? guestPersonMessages[a.GuestId] : null; messageCollection.Iterate(b => b.Message = guestMessages.ContainsKey(b.AlertId) ? guestMessages[b.AlertId].FirstOrDefault() : null); if (messageCollection != null) { a.AssignMessages(messageCollection); } var folioCollection = folioList.ContainsKey(a.GuestId) ? folioList[a.GuestId] : null; if (folioCollection != null) { a.AssignFolios(folioCollection); } if (a.CruiseDetail.Stateroom != null) { var debarkPersonalDetail = new DebarkPersonDetail { Age = a.PersonalDetail.Age, PersonId = a.GuestId, PersonTypeId = CommonConstants.GuestTypeId, ReservationId = a.CruiseDetail.ReservationId, StateroomNumber = a.CruiseDetail.Stateroom }; debarkPersonalDetails.Add(debarkPersonalDetail); } }); MapDebarkAuthorizationDetails(person, debarkPersonalDetails); }
/// <summary> /// Update Card status disabled /// </summary> /// <param name="guests">The guests.</param> /// <param name="accessCardNumberScanned">access Card Number Scanned</param> /// <param name="folioNumber">The folio number.</param> public static void UpdateCardDisabled(GuestCollection guests, string accessCardNumberScanned, string folioNumber) { guests.Iterate(g => g.IsDisabledCard = false); if (string.IsNullOrWhiteSpace(folioNumber)) { guests.Where(g => g.Folios.Count > 0 && g.Folios.Any(f => f.FolioStatus != null && f.AccessCardNumber != null && f.AccessCardNumber.Equals(accessCardNumberScanned, StringComparison.OrdinalIgnoreCase) && f.FolioStatus.Equals(FolioStatusCancel, StringComparison.OrdinalIgnoreCase))).Iterate(g => g.IsDisabledCard = true); } else { guests.Where(g => g.Folios.Count > 0 && g.Folios.Any(f => f.FolioStatus != null && f.FolioNumber != null && (f.FolioStatus.Equals(FolioStatusCancel, StringComparison.OrdinalIgnoreCase) || string.IsNullOrEmpty(f.AccessCardNumber)) && f.FolioNumber.Equals(folioNumber, StringComparison.OrdinalIgnoreCase)) && g.PersonalDetail.SourceId.Equals(accessCardNumberScanned, StringComparison.OrdinalIgnoreCase)).Iterate(g => g.IsDisabledCard = true); } }