当前位置: 首页>>代码示例>>C#>>正文


C# DataProvider.GetCards方法代码示例

本文整理汇总了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;
		}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:66,代码来源:EmployeeReport.cs


注:本文中的DataProvider.GetCards方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。