本文整理汇总了C#中Common.List.Iterate方法的典型用法代码示例。如果您正苦于以下问题:C# List.Iterate方法的具体用法?C# List.Iterate怎么用?C# List.Iterate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Common.List
的用法示例。
在下文中一共展示了List.Iterate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RetrieveHistoryByPersonStatusAsync
/// <summary>
/// Retrieves the history by person status asynchronous.
/// </summary>
/// <param name="shipId">The ship identifier.</param>
/// <param name="voyageIds">The voyage ids.</param>
/// <param name="statusType">Type of the status.</param>
/// <param name="personTypeId">The person type identifier.</param>
/// <param name="startDate">The start date.</param>
/// <param name="pageNumber">The page number.</param>
/// <param name="pageSize">Size of the page.</param>
/// <returns>
/// List Result of person status.
/// </returns>
public async Task<ListResult<PersonStatusHistory>> RetrieveHistoryByPersonStatusAsync(string shipId, string voyageIds, string statusType, string personTypeId, string startDate, int? pageNumber, int? pageSize)
{
var statusTypeId = RetrieveStatusTypeId(statusType);
var personIds = string.Empty;
var personStatus = new List<PersonStatus>();
var personTypeList = new List<PersonType>();
personTypeList.Add(personTypeId.RetrievePersonType());
var personData = new Person();
long totalResults = 0;
if (statusType.Equals(ExpectedToday, StringComparison.OrdinalIgnoreCase) && personTypeId == CommonConstants.VisitorTypeId)
{
personData = await this.personDataAdaptor.RetrievePersonsBySearchText(shipId, personIds, personTypeList, SearchType.VisitorExpectedToday, pageNumber: pageNumber, maxResults: pageSize, folioNumber: null);
return PersonStatusHistoryMapper.MapPersonInformation(personData, personTypeId, personStatus);
}
else if (statusType.Equals(LeavingToday, StringComparison.OrdinalIgnoreCase) && personTypeId == CommonConstants.GuestTypeId)
{
var dbCommand = this.Database.GetStoredProcCommand(RetrieveGuestDashboardStatisticsDetail)
.AddParameter(StatsDate, DbType.DateTime, startDate)
.AddParameter(ShipId, DbType.String, shipId)
.AddParameter(PageNumber, DbType.Int32, pageNumber != null && pageNumber.Value != default(int) ? pageNumber : OfflineConstants.DefaultPageNumber)
.AddParameter(PageSize, DbType.Int32, pageSize != null && pageSize.Value != default(int) ? pageSize : OfflineConstants.DefaultPageSize)
.AddParameter(RecordCount, ParameterDirection.Output, DbType.Int64, 0);
if (!string.IsNullOrWhiteSpace(voyageIds))
{
dbCommand.AddParameter(VoyageIDs, DbType.String, voyageIds);
}
personIds = await this.ExecuteReaderAsync(dbCommand, PersonStatusHistoryMapper.MapPersonIds);
totalResults = RetrieveRecordCountValue(dbCommand);
}
else
{
var command = this.Database.GetStoredProcCommand(RetrieveDashboardStatisticsDetail)
.AddParameter(StatisticsType, DbType.Int16, Convert.ToInt16(statusTypeId))
.AddParameter(PersonTypeID, DbType.Byte, personTypeId)
.AddParameter(StatsDate, DbType.DateTime, startDate)
.AddParameter(ShipId, DbType.String, shipId)
.AddParameter(PageNumber, DbType.Int32, pageNumber != null && pageNumber.Value != default(int) ? pageNumber : OfflineConstants.DefaultPageNumber)
.AddParameter(PageSize, DbType.Int32, pageSize != null && pageSize.Value != default(int) ? pageSize : OfflineConstants.DefaultPageSize)
.AddParameter(RecordCount, ParameterDirection.Output, DbType.Int64, 0);
if (!string.IsNullOrWhiteSpace(voyageIds))
{
command.AddParameter(VoyageIDs, DbType.String, voyageIds);
}
personStatus = await this.ExecuteReaderAsync(command, PersonStatusHistoryMapper.MapPersonStatus);
personStatus.Iterate(a => { personIds = string.Concat(personIds, a.PersonId, CommaSeparator); });
totalResults = RetrieveRecordCountValue(command);
}
personData = await this.personDataAdaptor.RetrievePersonsBySearchText(shipId, personIds, personTypeList, SearchType.PersonId, pageNumber: OfflineConstants.DefaultPageNumber, maxResults: pageSize, personId: personIds, folioNumber: null);
var personHistoryList = PersonStatusHistoryMapper.MapPersonInformation(personData, personTypeId, personStatus);
personHistoryList.TotalResults = totalResults;
return personHistoryList;
}