本文整理汇总了C#中Person.AssignCrewmembers方法的典型用法代码示例。如果您正苦于以下问题:C# Person.AssignCrewmembers方法的具体用法?C# Person.AssignCrewmembers怎么用?C# Person.AssignCrewmembers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Person
的用法示例。
在下文中一共展示了Person.AssignCrewmembers方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
//.........这里部分代码省略.........
示例2: RetrieveCrewmemberPhoto
/// <summary>
/// Function to retrieve photo of Crewmember.
/// </summary>
/// <param name="crewmember">Instance of Crewmember</param>
private static void RetrieveCrewmemberPhoto(Crewmember crewmember)
{
Observable.ToAsync(() =>
{
var person = new Person();
var crewmemberCollection = new CrewmemberCollection();
crewmemberCollection.Add(crewmember);
person.AssignCrewmembers(crewmemberCollection);
DIContainer.Instance.Resolve<PhotoService>().RetrievePhotos(person);
})().Subscribe(r => { }, ex => { });
}
示例3: 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;
}
示例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: 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;
}
示例6: AddCrewmembersInPerson
/// <summary>
/// Adds the crew members in person.
/// </summary>
/// <param name="personList">The person list.</param>
/// <param name="person">The person.</param>
/// <param name="crewMemberList">The crew member list.</param>
private static void AddCrewmembersInPerson(ListResult<Person> personList, Person person, ListResult<Crewmember> crewMemberList)
{
person.AssignCrewmembers(crewMemberList.Items);
person.TotalCrewmembersCount = crewMemberList.TotalResults;
personList.TotalResults += crewMemberList.TotalResults;
}
示例7: ShowPartyDetail
/// <summary>
/// Show Party Detail.
/// </summary>
/// <param name="selectedPerson">The Selected Person Identifier.</param>
public async void ShowPartyDetail(PersonBase selectedPerson)
{
if (selectedPerson != null)
{
Messenger.Instance.Notify(MessengerMessage.ShowSpinWheel, true);
if (selectedPerson.PersonType == PersonType.Guest)
{
this.SetVoyage();
await this.RetrieveGuestsBySearchText(selectedPerson);
}
else
{
var person = new Person();
person.AssignCrewmembers(this.RetrieveCrewMemberParty());
person.AssignVisitors(this.RetrieveVisitorParty());
// For crew member and visitor.
IList<PersonIdentity> personIdentities = new List<PersonIdentity>() { new PersonIdentity { PersonId = selectedPerson.PersonId, PersonType = selectedPerson.PersonType } };
var personsParty = await this.personsPartyService.RetrievePersonsPartyByPersons(person, personIdentities);
this.ManageParty(personsParty);
}
}
}
示例8: 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;
}
示例9: SetupData
/// <summary>
/// Setups the data.
/// </summary>
private void SetupData()
{
Domain.Dependencies.Register();
DataAccess.Dependencies.Register();
this.workstationMock = new Mock<Workstation>();
DIContainer.Instance.RegisterInstance<Workstation>(this.workstationMock.Object);
Workstation ws = DIContainer.Instance.Resolve<Workstation>();
ws.Port = new Port { PortId = "1" };
ws.Ship = new Ship { ShipId = "5" };
ws.GangwayLocation = new GangwayLocation { LocationId = "1" };
ws.GangwayServiceBaseAddress = "http://Localhost/";
ws.ConfigurationServiceBaseAddress = "http://Localhost/";
ws.AuthenticationServiceBaseAddress = "http://Localhost/";
ws.AuthorizationServiceBaseAddress = "http://Localhost/";
ws.ConnectionMode = ConnectionMode.Online;
var intCollection = new Collection<int>();
intCollection.Add(0);
var brand = new Brand { BrandId = "3", Name = "Carnival Breeze", MediaItemAddress = "http://172.26.248.122/ImagingMediaService/MediaItems/23" };
var voyageList = new List<Voyage>();
var voyage = new Voyage { DebarkPortId = "1", EmbarkPortId = "1", DestinationId = "1", MediaItemAddress = "http://172.26.248.122/", VoyageId = "31", Name = "Carnival Voyage", IsActive = true, ShipId = "5", Number = "ccl", DebarkDate = new DateTime(2015, 3, 3), EmbarkDate = new DateTime(2015, 3, 2) };
voyageList.Add(voyage);
ws.AssignVoyageList(voyageList);
////this.repository = new Mock<IRepository>();
////this.embarkationStatisticsRepositoryMock = new Mock<EmbarkationStatisticsRepository>();
this.personServiceRepositoryMock = new Mock<PersonServiceRepository>();
this.referenceDataRepositoryMock = new Mock<ReferenceDataRepository>();
////this.photoCaptureRepositoryMock = new Mock<PhotoCaptureRepository>();
////this.shipTimeRepositoryMock = new Mock<ShipTimeRepository>();
////this.referenceDataRepositoryMock = new Mock<ReferenceDataRepository>();
////this.gangwayEventRepositoryMock = new Mock<GangwayEventRepository>();
////this.guestClient = new Mock<IGuestClient>();
////this.personClient = new Mock<IPersonsClient>();
////DIContainer.Instance.RegisterInstance<IGuestClient>(this.guestClient.Object);
////DIContainer.Instance.RegisterInstance<IPersonsClient>(this.personClient.Object);
////DIContainer.Instance.RegisterInstance<IRepository>(this.repository.Object);
DIContainer.Instance.RegisterInstance<ReferenceDataRepository>(this.referenceDataRepositoryMock.Object);
////DIContainer.Instance.RegisterInstance<EmbarkationStatisticsRepository>(this.embarkationStatisticsRepositoryMock.Object);
////DIContainer.Instance.RegisterInstance<GangwayEventRepository>(this.gangwayEventRepositoryMock.Object);
////DIContainer.Instance.RegisterInstance<PhotoCaptureRepository>(this.photoCaptureRepositoryMock.Object);
DIContainer.Instance.RegisterInstance<PersonServiceRepository>(this.personServiceRepositoryMock.Object);
////DIContainer.Instance.RegisterInstance<ShipTimeRepository>(this.shipTimeRepositoryMock.Object);
var cruiseDetails = new GuestCruiseDetail { BeaconId = string.Empty, BerthNumber = string.Empty, IdentificationId = string.Empty, LoyaltyLevelTypeId = string.Empty, ReservationId = string.Empty, Stateroom = "0000" };
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, DocumentTypeId = "1" };
this.person = new Person { TotalResults = 1 };
CrewmemberCollection crewMembers = new CrewmemberCollection();
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 = "00000",
ReservationStatusId = "0000089",
StateroomCategoryTypeId = "aaasad"
};
guests.Add(new Guest
{
GuestId = "0001",
PersonalDetail = personDetail,
Age = 0,
CruiseDetail = cruiseDetail,
SecurityPhotoAddress = string.Empty,
});
VisitorCollection visitors = new VisitorCollection();
visitors.Add(new Visitor
{
VisitorId = "0003",
PersonalDetail = personDetail,
SecurityPhotoAddress = string.Empty,
});
this.person.AssignGuests(guests);
this.person.AssignVisitors(visitors);
this.personTypes = new List<PersonType>();
personTypes.Add(PersonType.Guest);
this.personServiceRepositoryMock.Setup(data => data.RetrievePersonsBySearchText(It.IsNotNull<string>(), It.IsAny<string>(), It.IsAny<IList<PersonType>>(), It.IsAny<SearchType>(), It.IsAny<string>(), It.IsAny<string>(), 0, 0, It.IsAny<string>(), It.IsAny<string>())).Returns(Task.FromResult(this.person));
var documentTypes = new DocumentTypeCollection();
documentTypes.Add(new DocumentType { CountryId = "232", Code = "USA", DocumentTypeId = "1", Name = "Passport" });
//.........这里部分代码省略.........