本文整理汇总了C#中Person.AssignGuests方法的典型用法代码示例。如果您正苦于以下问题:C# Person.AssignGuests方法的具体用法?C# Person.AssignGuests怎么用?C# Person.AssignGuests使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Person
的用法示例。
在下文中一共展示了Person.AssignGuests方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RetrieveTravelWithAsync
/// <summary>
/// Function to retrieve persons by search text.
/// </summary>
/// <param name="reservationNumbers">The reservation numbers.</param>
/// <returns>List of Guest</returns>
public async Task<IList<Guest>> RetrieveTravelWithAsync(string reservationNumbers)
{
var workstation = DIContainer.Instance.Resolve<Workstation>();
var task = await this.guestClient.RetrieveTravelWithAsync(shipId: workstation.Ship.ShipId, guestIds: null, voyageIds: workstation.SelectedVoyageIds, reservationNumbers: reservationNumbers, pageNumber: null, maxResults: null);
IList<Guest> guestData = task != null ? JsonConvert.DeserializeObject<IList<Guest>>(task) : default(IList<Guest>);
Person persons = new Person();
GuestCollection guestCollection = new GuestCollection();
guestData.Iterate(g => guestCollection.Add(g));
persons.AssignGuests(guestCollection);
if (persons != null)
{
CommonDataMethods.FillOnboardStatus(persons);
CommonDataMethods.ManageAlerts(persons, null, null);
}
return await Task.FromResult(guestData);
}
示例2: MapTravelWithGuest
/// <summary>
/// Maps the travel with guest.
/// </summary>
/// <param name="dataReader">The data reader.</param>
/// <returns>List of travel with guests.</returns>
internal static async Task<List<Guest>> MapTravelWithGuest(SqlDataReader dataReader)
{
var persons = new ListResult<Person>();
var person = new Person();
var personCollection = new Collection<Person>();
var guests = new List<Guest>();
if (dataReader != null)
{
////Map Crew
////person.AssignCrewmembers(await MapCrew(dataReader));
////Map Crew Personal Detail
await dataReader.NextResultAsync();
////var crewPersonDetailList = await RetrieveCrewmemberPersonalDetail(dataReader);
////map access card
await dataReader.NextResultAsync();
////Map Crew Alerts
await dataReader.NextResultAsync();
////var alerts = await AlertsAndMessageMapper.MapAlerts(dataReader);
await dataReader.NextResultAsync();
////var alertMessages = await AlertsAndMessageMapper.MapMessagesDescription(dataReader);
await dataReader.NextResultAsync();
////var messages = await AlertsAndMessageMapper.MapMessages(dataReader);
await dataReader.NextResultAsync();
////var messageDescription = await AlertsAndMessageMapper.MapMessagesDescription(dataReader);
////MapCrewDetail(person, crewPersonDetailList, alerts, alertMessages);
////Map Visitor
await dataReader.NextResultAsync();
////person.AssignVisitors(await MapVisitors(dataReader));
////Map Visitor Personal Detail
await dataReader.NextResultAsync();
////var visitorPersonalDetailList = await RetrieveVisitorPersonalDetail(dataReader);
////map access card
await dataReader.NextResultAsync();
////Map Visitor Alerts
await dataReader.NextResultAsync();
////var visitorAlerts = await AlertsAndMessageMapper.MapAlerts(dataReader);
await dataReader.NextResultAsync();
////var visitorAlertMessages = await AlertsAndMessageMapper.MapMessagesDescription(dataReader);
await dataReader.NextResultAsync();
////var visitorMessages = await AlertsAndMessageMapper.MapMessages(dataReader);
await dataReader.NextResultAsync();
////var visitorMessagesDescription = await AlertsAndMessageMapper.MapMessagesDescription(dataReader);
////MapVisitorDetail(person, visitorPersonalDetailList, visitorAlerts, visitorAlertMessages);
////Map Guest
await dataReader.NextResultAsync();
person.AssignGuests(await MapGuests(dataReader));
////Map Guest Personal Detail
await dataReader.NextResultAsync();
var guestPersonDetailList = await RetrieveGuestPersonalDetail(dataReader);
////Map Guest Cruise Detail
await dataReader.NextResultAsync();
var guestReservationDetailList = await RetrieveGuestReservationDetail(dataReader);
////Map Guest Alerts
await dataReader.NextResultAsync();
var guestAlerts = await AlertsAndMessageMapper.MapGuestAlerts(dataReader);
await dataReader.NextResultAsync();
var guestAlertMessages = await AlertsAndMessageMapper.MapMessagesDescription(dataReader);
await dataReader.NextResultAsync();
var guestMessages = await AlertsAndMessageMapper.MapGuestMessages(dataReader);
await dataReader.NextResultAsync();
var guestMessagesDescription = await AlertsAndMessageMapper.MapMessagesDescription(dataReader);
// Map folio data.
await dataReader.NextResultAsync();
var folioList = await RetrieveFolios(dataReader);
MapGuestDetail(person, guestPersonDetailList, guestReservationDetailList, guestAlerts, guestAlertMessages, guestMessages, guestMessagesDescription, folioList);
if (!dataReader.IsClosed)
{
dataReader.Close();
//.........这里部分代码省略.........
示例3: RetrieveGuestPhoto
/// <summary>
/// Function to retrieve photo of guest.
/// </summary>
/// <param name="guest">Instance of Guest</param>
private static void RetrieveGuestPhoto(Guest guest)
{
Observable.ToAsync(() =>
{
var person = new Person();
var guestCollection = new GuestCollection();
guestCollection.Add(guest);
person.AssignGuests(guestCollection);
DIContainer.Instance.Resolve<PhotoService>().RetrievePhotos(person);
})().Subscribe(r => { }, ex => { });
}
示例4: SearchPerson
/// <summary>
/// Searches the person.
/// </summary>
/// <param name="searchParameters">The search parameters.</param>
/// <param name="personTypeList">The person type list.</param>
/// <param name="staterooms">The staterooms.</param>
/// <returns>
/// Return person instance.
/// </returns>
private async Task<Person> SearchPerson(PersonSearchParameter searchParameters, ListResult<PersonTypeEntity> personTypeList, ListResult<DataAccess.Entities.Stateroom> staterooms)
{
var personType = searchParameters.PersonType.HasValue ? searchParameters.PersonType.Value : PersonTypes.All;
var person = new Person();
if ((personType & PersonTypes.All) == PersonTypes.All)
{
var guestList = this.RetrieveGuests(searchParameters, staterooms, true);
var crewMemberList = this.RetrieveCrewMembers(searchParameters, personTypeList, staterooms);
var visitorList = this.RetrieveVisitorsAsync(searchParameters, personTypeList);
await Task.WhenAll(guestList, crewMemberList, visitorList);
person.AssignGuests(guestList.Result.Items);
person.TotalGuestsCount = guestList.Result.TotalResults;
person.AssignCrewmembers(crewMemberList.Result.Items);
person.TotalCrewmembersCount = crewMemberList.Result.TotalResults;
person.AssignVisitors(visitorList.Result.Items);
person.TotalVisitorsCount = visitorList.Result.Items.Count;
}
else if (personType == PersonTypes.Guest)
{
var guestList = await this.RetrieveGuests(searchParameters, staterooms, true);
person.AssignGuests(guestList.Items);
person.TotalGuestsCount = guestList.TotalResults;
}
else if (personType == PersonTypes.Crew)
{
var crewMemberList = await this.RetrieveCrewMembers(searchParameters, personTypeList, staterooms);
person.AssignCrewmembers(crewMemberList.Items);
person.TotalCrewmembersCount = crewMemberList.TotalResults;
}
else if (personType == PersonTypes.Visitor)
{
var visitorList = await this.RetrieveVisitorsAsync(searchParameters, personTypeList);
person.AssignVisitors(visitorList.Items);
person.TotalVisitorsCount = visitorList.Items.Count;
}
return person;
}
示例5: MapPerson
/// <summary>
/// Maps the person.
/// </summary>
/// <param name="dataReader">The data reader.</param>
/// <returns>Person list</returns>
internal static async Task<ListResult<Person>> MapPerson(SqlDataReader dataReader)
{
var persons = new ListResult<Person>();
var person = new Person();
var personCollection = new Collection<Person>();
if (dataReader != null)
{
////Map Crew
person.AssignCrewmembers(await MapCrew(dataReader));
////Map Crew Personal Detail
await dataReader.NextResultAsync();
var crewPersonDetailList = await RetrieveCrewmemberPersonalDetail(dataReader);
////map access card
await dataReader.NextResultAsync();
var crewAccessCards = await AccessCardMapper.MapCrewAccessCards(dataReader);
////Map Crew Alerts
await dataReader.NextResultAsync();
var alerts = await AlertsAndMessageMapper.MapCrewAlerts(dataReader);
await dataReader.NextResultAsync();
var alertMessages = await AlertsAndMessageMapper.MapMessagesDescription(dataReader);
await dataReader.NextResultAsync();
var messages = await AlertsAndMessageMapper.MapCrewMessages(dataReader);
await dataReader.NextResultAsync();
var messageDescription = await AlertsAndMessageMapper.MapMessagesDescription(dataReader);
MapCrewDetail(person, crewPersonDetailList, alerts, alertMessages, messages, messageDescription, crewAccessCards);
////Map Visitor
await dataReader.NextResultAsync();
person.AssignVisitors(await MapVisitors(dataReader));
////Map Visitor Personal Detail
await dataReader.NextResultAsync();
var visitorPersonalDetailList = await RetrieveVisitorPersonalDetail(dataReader);
////Map Visitor access card
await dataReader.NextResultAsync();
var visitorAccessCards = await AccessCardMapper.MapVisitorAccessCards(dataReader);
////Map Visitor Alerts
await dataReader.NextResultAsync();
var visitorAlerts = await AlertsAndMessageMapper.MapVisitorAlerts(dataReader);
await dataReader.NextResultAsync();
var visitorAlertMessages = await AlertsAndMessageMapper.MapMessagesDescription(dataReader);
await dataReader.NextResultAsync();
var visitorMessages = await AlertsAndMessageMapper.MapVisitorMessages(dataReader);
await dataReader.NextResultAsync();
var visitorMessagesDescription = await AlertsAndMessageMapper.MapMessagesDescription(dataReader);
MapVisitorDetail(person, visitorPersonalDetailList, visitorAlerts, visitorAlertMessages, visitorMessages, visitorMessagesDescription, visitorAccessCards);
////Map Guest
await dataReader.NextResultAsync();
person.AssignGuests(await MapGuests(dataReader));
////Map Guest Personal Detail
await dataReader.NextResultAsync();
var guestPersonDetailList = await RetrieveGuestPersonalDetail(dataReader);
////Map Guest Cruise Detail
await dataReader.NextResultAsync();
var guestReservationDetailList = await RetrieveGuestReservationDetail(dataReader);
////Map Guest Alerts
await dataReader.NextResultAsync();
var guestAlerts = await AlertsAndMessageMapper.MapGuestAlerts(dataReader);
await dataReader.NextResultAsync();
var guestAlertMessages = await AlertsAndMessageMapper.MapMessagesDescription(dataReader);
await dataReader.NextResultAsync();
var guestMessages = await AlertsAndMessageMapper.MapGuestMessages(dataReader);
await dataReader.NextResultAsync();
var guestMessagesDescription = await AlertsAndMessageMapper.MapMessagesDescription(dataReader);
// Map folio data.
await dataReader.NextResultAsync();
var folioList = await RetrieveFolios(dataReader);
MapGuestDetail(person, guestPersonDetailList, guestReservationDetailList, guestAlerts, guestAlertMessages, guestMessages, guestMessagesDescription, folioList);
////map total results
await dataReader.NextResultAsync();
await MapTotalResults(dataReader, person);
//.........这里部分代码省略.........
示例6: RetrievePersonByIdAndDocument
/// <summary>
/// Retrieves the person by identifier.
/// </summary>
/// <param name="searchParameters">The search parameters.</param>
/// <param name="personTypeList">The person type list.</param>
/// <param name="staterooms">The staterooms.</param>
/// <returns>Return Instance of person.</returns>
private async Task<Person> RetrievePersonByIdAndDocument(PersonSearchParameter searchParameters, ListResult<PersonTypeEntity> personTypeList, ListResult<DataAccess.Entities.Stateroom> staterooms)
{
var person = new Person();
var applicationSetting = DIContainer.Instance.Resolve<IApplicationSetting>();
if ((!string.IsNullOrEmpty(searchParameters.GuestIds) && !string.IsNullOrEmpty(searchParameters.CrewmemberIds) && !string.IsNullOrEmpty(searchParameters.VisitorIds))
|| (!string.IsNullOrWhiteSpace(searchParameters.DocumentNo) && searchParameters.DocumentTypeId.Equals(applicationSetting.DocumentTypeId) && searchParameters.PersonType == PersonTypes.All))
{
person = await this.SearchPerson(searchParameters, personTypeList, staterooms);
}
else if (!string.IsNullOrEmpty(searchParameters.GuestIds) && !string.IsNullOrEmpty(searchParameters.CrewmemberIds))
{
person = await this.SearchGuestAndCrew(searchParameters, personTypeList, staterooms);
}
else if (!string.IsNullOrEmpty(searchParameters.GuestIds) && !string.IsNullOrEmpty(searchParameters.VisitorIds))
{
var guestList = this.RetrieveGuests(searchParameters, staterooms, true);
var visitorList = this.RetrieveVisitorsAsync(searchParameters, personTypeList);
await Task.WhenAll(guestList, visitorList);
person.AssignGuests(guestList.Result.Items);
person.TotalGuestsCount = guestList.Result.TotalResults;
person.AssignVisitors(visitorList.Result.Items);
person.TotalVisitorsCount = visitorList.Result.Items.Count;
}
else if (!string.IsNullOrEmpty(searchParameters.CrewmemberIds) && !string.IsNullOrEmpty(searchParameters.VisitorIds))
{
var crewMemberList = this.RetrieveCrewMembers(searchParameters, personTypeList, staterooms);
var visitorList = this.RetrieveVisitorsAsync(searchParameters, personTypeList);
await Task.WhenAll(crewMemberList, visitorList);
person.AssignCrewmembers(crewMemberList.Result.Items);
person.TotalCrewmembersCount = crewMemberList.Result.TotalResults;
person.AssignVisitors(visitorList.Result.Items);
person.TotalVisitorsCount = visitorList.Result.Items.Count;
}
else if (!string.IsNullOrEmpty(searchParameters.GuestIds) || (!string.IsNullOrWhiteSpace(searchParameters.DocumentNo) && searchParameters.PersonType == PersonTypes.Guest))
{
var guestList = await this.RetrieveGuests(searchParameters, staterooms, true);
person.AssignGuests(guestList.Items);
person.TotalGuestsCount = guestList.TotalResults;
}
else if (!string.IsNullOrEmpty(searchParameters.CrewmemberIds) || !string.IsNullOrWhiteSpace(searchParameters.EmployeeNumber) || (!string.IsNullOrWhiteSpace(searchParameters.DocumentNo) && searchParameters.PersonType == PersonTypes.Crew))
{
var crewMemberList = await this.RetrieveCrewMembers(searchParameters, personTypeList, staterooms);
person.AssignCrewmembers(crewMemberList.Items);
person.TotalCrewmembersCount = crewMemberList.TotalResults;
}
else if ((!string.IsNullOrEmpty(searchParameters.VisitorIds) || searchParameters.Birthdate.HasValue || (!string.IsNullOrWhiteSpace(searchParameters.DocumentNo) && searchParameters.PersonType == PersonTypes.Visitor))
&& (!string.IsNullOrEmpty(searchParameters.StartDate) || !string.IsNullOrEmpty(searchParameters.EndDate)))
{
var visitorList = await this.RetrieveVisitorsAsync(searchParameters, personTypeList);
person.AssignVisitors(visitorList.Items);
person.TotalVisitorsCount = visitorList.Items.Count;
}
return person;
}
示例7: SearchGuestAndCrew
/// <summary>
/// Searches a person by Guest and Crew.
/// </summary>
/// <param name="searchParameters">The search parameters.</param>
/// <param name="personTypeList">The person type list.</param>
/// <param name="staterooms">The staterooms.</param>
/// <returns>Task contains Person Entity.</returns>
private async Task<Person> SearchGuestAndCrew(PersonSearchParameter searchParameters, ListResult<PersonTypeEntity> personTypeList, ListResult<DataAccess.Entities.Stateroom> staterooms)
{
var person = new Person();
if ((searchParameters.PersonType & PersonTypes.All) == PersonTypes.All)
{
var guestList = this.RetrieveGuests(searchParameters, staterooms, true);
var crewMemberList = this.RetrieveCrewMembers(searchParameters, personTypeList, staterooms);
await Task.WhenAll(crewMemberList, guestList);
person.AssignGuests(guestList.Result.Items);
person.TotalGuestsCount = guestList.Result.TotalResults;
person.AssignCrewmembers(crewMemberList.Result.Items);
person.TotalCrewmembersCount = crewMemberList.Result.TotalResults;
}
else if (searchParameters.PersonType == PersonTypes.Guest)
{
var guestList = await this.RetrieveGuests(searchParameters, staterooms, true);
person.AssignGuests(guestList.Items);
person.TotalGuestsCount = guestList.TotalResults;
}
else if (searchParameters.PersonType == PersonTypes.Crew)
{
var crewMemberList = await this.RetrieveCrewMembers(searchParameters, personTypeList, staterooms);
person.AssignCrewmembers(crewMemberList.Items);
person.TotalCrewmembersCount = crewMemberList.TotalResults;
}
return person;
}
示例8: SearchOnPersonType
/// <summary>
/// Searches the type of the on person.
/// </summary>
/// <param name="searchParameters">The search parameters.</param>
/// <returns>
/// Return person instance.
/// </returns>
private async Task<ListResult<Person>> SearchOnPersonType(PersonSearchParameter searchParameters)
{
var personList = new ListResult<Person>();
var person = new Person();
var personSearchParameter = searchParameters;
var personTypeList = this.referenceDataRepository.RetrievePersonTypeListAsync();
var staterooms = DIContainer.Instance.Resolve<ShipClientRepository>().RetrieveStateroomListAsync(personSearchParameter.ShipId);
await Task.WhenAll(personTypeList, staterooms);
if (!string.IsNullOrEmpty(personSearchParameter.AccessCardNumber) || !string.IsNullOrEmpty(personSearchParameter.SourceIds))
{
/* Search persons by Access Card Number */
person = await this.SearchPerson(personSearchParameter, personTypeList.Result, staterooms.Result);
}
else if (!string.IsNullOrWhiteSpace(personSearchParameter.Staterooms) && personSearchParameter.PersonType != PersonTypes.Visitor)
{
/* Search persons by Stateroom number*/
personSearchParameter.StateroomIds = RetrieveStateroomIds(personSearchParameter, personSearchParameter.StateroomIds, staterooms.Result);
person = await this.SearchGuestAndCrew(personSearchParameter, personTypeList.Result, staterooms.Result);
}
else if (!string.IsNullOrEmpty(personSearchParameter.ReservationNumbers) && (personSearchParameter.PersonType == PersonTypes.Guest || personSearchParameter.PersonType == PersonTypes.All))
{
/* Search persons by Reservation Number*/
var guestList = await this.RetrieveGuests(personSearchParameter, staterooms.Result, true);
person.AssignGuests(guestList.Items);
person.TotalGuestsCount = guestList.Items.Count;
}
else if (!string.IsNullOrEmpty(personSearchParameter.GuestIds) || !string.IsNullOrEmpty(personSearchParameter.CrewmemberIds) || !string.IsNullOrEmpty(personSearchParameter.VisitorIds)
|| !string.IsNullOrWhiteSpace(personSearchParameter.EmployeeNumber) || !string.IsNullOrWhiteSpace(personSearchParameter.DocumentNo) || personSearchParameter.Birthdate.HasValue)
{
/* Search persons by person ids , employee Number, birth date and Document no.*/
person = await this.RetrievePersonByIdAndDocument(personSearchParameter, personTypeList.Result, staterooms.Result);
}
personList.Items.Add(person);
personList.TotalResults = person.Guests.Count + person.Crewmembers.Count + person.Visitors.Count;
return personList;
}
示例9: AddGuestsInPerson
/// <summary>
/// Adds the guests in person.
/// </summary>
/// <param name="personList">The person list.</param>
/// <param name="person">The person.</param>
/// <param name="guestList">The guest list.</param>
private static void AddGuestsInPerson(ListResult<Person> personList, Person person, ListResult<Guest> guestList)
{
person.AssignGuests(guestList.Items);
person.TotalGuestsCount = guestList.TotalResults;
personList.TotalResults += guestList.TotalResults;
}
示例10: RetrieveTravelWithAsync
/// <summary>
/// Function to retrieve persons by search text.
/// </summary>
/// <param name="staterooms">The staterooms.</param>
/// <param name="guestIds">The guest ids.</param>
/// <param name="reservationNumbers">The reservation numbers.</param>
/// <param name="pageNumber">The page number.</param>
/// <param name="maxResults">The maximum results.</param>
/// <returns>List of Guest</returns>
public async Task<IList<Guest>> RetrieveTravelWithAsync(string reservationNumbers)
{
var workstation = DIContainer.Instance.Resolve<Workstation>();
string shipId = workstation.Ship.ShipId;
IList<Guest> guestData = null;
string reservationNumbersofTravelWithGuest = string.Empty;
var command = this.Database.GetStoredProcCommand(ListTravelPartyStoredProcedure)
.AddParameter(ReservationNumber, DbType.String, reservationNumbers);
reservationNumbersofTravelWithGuest = await this.ExecuteReaderAsync(command, PersonDataMapper.MapTravelPartyAsync);
var commandForPerson = this.Database.GetStoredProcCommand(RetrievePersonStoredProcedure)
.AddParameter(ReservationNumbers, DbType.String, reservationNumbersofTravelWithGuest);
commandForPerson.AddParameter(ShipId, DbType.Int16, Convert.ToInt16(shipId));
commandForPerson.AddParameter(PageNumber, DbType.Int32, OfflineConstants.DefaultPageNumber);
commandForPerson.AddParameter(PageSize, DbType.Int32, workstation.MaxRecentPersonCount);
guestData = await this.ExecuteReaderAsync(commandForPerson, PersonDataMapper.MapTravelWithGuest);
Person persons = new Person();
GuestCollection guestCollection = new GuestCollection();
guestData.Iterate(g => guestCollection.Add(g));
persons.AssignGuests(guestCollection);
// Fills IsOnboard status
if (persons != null)
{
CommonDataMethods.FillOnboardStatus(persons);
CommonDataMethods.ManageAlerts(persons, null, null);
}
return await Task.FromResult(guestData);
}
示例11: FilledPerson
private Person FilledPerson()
{
var person = new Person();
CrewmemberCollection crewMembers = new CrewmemberCollection();
var personDetail = new PersonalDetail { CitizenshipCountryId = string.Empty, FirstName = string.Empty, LastName = string.Empty, MiddleName = string.Empty, Title = string.Empty, PreferredName = string.Empty, MaritalStatus = string.Empty, Nickname = string.Empty, Occupation = string.Empty, DocumentNumber = string.Empty, Suffix = string.Empty };
crewMembers.Add(new Crewmember { CrewmemberId = string.Empty, CrewmemberTypeId = "1", SecurityPhotoAddress = string.Empty, ChargeId = string.Empty, EmployeeNo = string.Empty, LastEvent = string.Empty, PersonalDetail = personDetail });
person.AssignCrewmembers(crewMembers);
GuestCollection guests = new GuestCollection();
var checkInDetail = new CheckInDetail
{
ApplicationId = string.Empty,
LocationId = "1",
LocationTypeId = "1",
MachineName = "Machine",
Station = "station",
UserId = "user"
};
var cruiseDetail = new GuestCruiseDetail
{
BeaconId = string.Empty,
CheckInDetail = checkInDetail,
LoyaltyLevelTypeId = "1",
ReservationId = "1",
Stateroom = stateroom,
ReservationStatusId = "0000089",
StateroomCategoryTypeId = "aaasad"
};
var guest = new Guest
{
GuestId = PersonId,
PersonalDetail = personDetail,
Age = 0,
CruiseDetail = cruiseDetail,
SecurityPhotoAddress = string.Empty
};
var cruiseDetails = new GuestCruiseDetail { BeaconId = string.Empty, BerthNumber = string.Empty, IdentificationId = string.Empty, LoyaltyLevelTypeId = string.Empty, ReservationId = string.Empty, Stateroom = stateroom };
//// var personDetail = new PersonalDetail { CitizenshipCountryId = string.Empty, FirstName = string.Empty, LastName = string.Empty, MiddleName = string.Empty, Title = string.Empty, PreferredName = string.Empty, MaritalStatus = string.Empty, Nickname = string.Empty, Occupation = string.Empty, PassportNo = string.Empty, Suffix = string.Empty };
var personBase = new PersonBase
{
IsOnHold = true,
ChargeId = ChargeId,
CruiseDetail = cruiseDetails,
PersonalDetail = personDetail,
LastEvent = string.Empty,
PersonId = PersonId,
SecurityPhotoAddress = string.Empty,
Stateroom = stateroom
};
PortDebarkAuthorization pda = new PortDebarkAuthorization { PortId = "1", PersonId = "00001", CanDebarkAlone = true, IsActivePort = true, PortOrder = 1 };
DebarkAuthorizedPersonCollection dapCollection = new DebarkAuthorizedPersonCollection();
dapCollection.Add(new DebarkAuthorizedPerson { PersonTypeId = "2", Person = personBase, PersonId = PersonId, PersonType = PersonType.Guest });
pda.AssignDebarkAuthorizedPersons(dapCollection);
PortDebarkAuthorizationCollection portDebarkAuthorizations = new PortDebarkAuthorizationCollection();
portDebarkAuthorizations.Add(pda);
guest.AssignPortAuthorizations(portDebarkAuthorizations);
guests.Add(guest);
person.AssignGuests(guests);
return person;
}
示例12: SetUpData
private void SetUpData()
{
this.targetService = new PhotoService();
this.person = new Person();
CrewmemberCollection crewMembers = new CrewmemberCollection();
var personDetail = new PersonalDetail { CitizenshipCountryId = string.Empty, FirstName = string.Empty, LastName = string.Empty, MiddleName = string.Empty, Title = string.Empty, PreferredName = string.Empty, MaritalStatus = string.Empty, Nickname = string.Empty, Occupation = string.Empty, DocumentNumber = string.Empty, Suffix = string.Empty };
crewMembers.Add(new Crewmember { CrewmemberId = string.Empty, CrewmemberTypeId = "1", SecurityPhotoAddress = string.Empty, ChargeId = string.Empty, EmployeeNo = string.Empty, LastEvent = string.Empty, PersonalDetail = personDetail });
this.person.AssignCrewmembers(crewMembers);
GuestCollection guests = new GuestCollection();
var checkInDetail = new CheckInDetail
{
ApplicationId = string.Empty,
LocationId = "1",
LocationTypeId = "1",
MachineName = "Machine",
Station = "station",
UserId = "user"
};
var cruiseDetail = new GuestCruiseDetail
{
BeaconId = string.Empty,
CheckInDetail = checkInDetail,
LoyaltyLevelTypeId = "1",
ReservationId = "1",
Stateroom = stateroom,
ReservationStatusId = "0000089",
StateroomCategoryTypeId = "3"
};
var guest = new Guest
{
GuestId = PersonId,
PersonalDetail = personDetail,
Age = 0,
CruiseDetail = cruiseDetail,
SecurityPhotoAddress = string.Empty,
};
guests.Add(guest);
this.person.AssignGuests(guests);
PortDebarkAuthorization pda = new PortDebarkAuthorization { PortId = "1", PersonId = "00001", CanDebarkAlone = true, IsActivePort = true, PortOrder = 1 };
DebarkAuthorizedPersonCollection dapCollection = new DebarkAuthorizedPersonCollection();
dapCollection.Add(new DebarkAuthorizedPerson { PersonTypeId = "2", Person = this.FilledPerson(), PersonId = PersonId, PersonType = PersonType.Guest });
pda.AssignDebarkAuthorizedPersons(dapCollection);
PortDebarkAuthorizationCollection portDebarkAuthorizations = new PortDebarkAuthorizationCollection();
portDebarkAuthorizations.Add(pda);
guest.AssignPortAuthorizations(portDebarkAuthorizations);
guests.Add(guest);
this.listOfPDA.Add(pda);
person.AssignGuests(guests);
}