本文整理汇总了C#中DataProvider.GetCards方法的典型用法代码示例。如果您正苦于以下问题:C# DataProvider.GetCards方法的具体用法?C# DataProvider.GetCards怎么用?C# DataProvider.GetCards使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataProvider
的用法示例。
在下文中一共展示了DataProvider.GetCards方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateDataSet
protected override DataSet CreateDataSet(DataProvider dataProvider)
{
var filter = GetFilter<EmployeeReportFilter>();
dataProvider.LoadCache();
var employees = dataProvider.GetEmployees(filter);
var cards = dataProvider.GetCards(new CardFilter { EmployeeFilter = new EmployeeFilter { UIDs = employees.Select(x => x.UID).ToList() } });
var dataSet = new EmployeeDataSet();
foreach (var employee in employees)
{
var dataRow = dataSet.Data.NewDataRow();
dataRow.IsEmployee = filter.IsEmployee;
dataRow.BirthDay = employee.Item.BirthDate;
dataRow.BirthPlace = employee.Item.BirthPlace;
dataRow.Department = employee.Department;
dataRow.Document = employee.Item.DocumentType.ToDescription();
dataRow.DocumentIssuer = employee.Item.DocumentGivenBy;
dataRow.DocumentNumber = employee.Item.DocumentNumber;
dataRow.DocumentValidFrom = employee.Item.DocumentGivenDate;
dataRow.DocumentValidTo = employee.Item.DocumentValidTo;
dataRow.FirstName = employee.Item.FirstName;
dataRow.LastName = employee.Item.LastName;
dataRow.Nationality = employee.Item.Citizenship;
int number = -1;
int.TryParse(employee.Item.TabelNo, out number);
dataRow.Number = number;
dataRow.Organisation = employee.Organisation;
dataRow.Phone = employee.Item.Phone;
if (employee.Item.Photo != null)
dataRow.Photo = employee.Item.Photo.Data;
if (employee.Item.Type == PersonType.Guest)
{
dataRow.Type = "Сопровождающий";
dataRow.PositionOrEscort = employee.Item.EscortName;
}
if (employee.Item.Type == PersonType.Employee)
{
dataRow.Type = "Должность";
dataRow.PositionOrEscort = employee.Position;
dataRow.Schedule = employee.Item.ScheduleName;
}
dataRow.SecondName = employee.Item.SecondName;
dataRow.Sex = employee.Item.Gender.ToDescription();
dataRow.UID = employee.UID;
dataSet.Data.Rows.Add(dataRow);
var employeeCards = cards.Where(x => x.EmployeeUID == employee.UID);
foreach (var card in employeeCards)
{
var cardRow = dataSet.PassCards.NewPassCardsRow();
cardRow.DataRow = dataRow;
cardRow.Number = (int)card.Number;
dataSet.PassCards.AddPassCardsRow(cardRow);
}
foreach (var column in employee.Item.AdditionalColumns)
{
if (column.DataType == AdditionalColumnDataType.Text)
{
var columnRow = dataSet.AdditionalColumns.NewAdditionalColumnsRow();
columnRow.DataRow = dataRow;
columnRow.Value = column.TextData;
columnRow.Name = column.ColumnName;
dataSet.AdditionalColumns.AddAdditionalColumnsRow(columnRow);
}
}
}
return dataSet;
}