Last active
February 27, 2016 16:22
-
-
Save islaytitans/b879575dc4df00f3e258 to your computer and use it in GitHub Desktop.
Populate the results from the Query to populate the results table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PopulateSampleOrdersWithXdbData : ReportProcessorBase | |
{ | |
public override void Process(ReportProcessorArgs args) | |
{ | |
DataTable queryResult = args.QueryResult; | |
DataTable resultTableForView = args.ResultTableForView; | |
ProjectRawTableIntoResultTable(args, queryResult, resultTableForView); | |
} | |
private void ProjectRawTableIntoResultTable(ReportProcessorArgs args, DataTable rawTable, DataTable resultTable) | |
{ | |
foreach (DataRow sourceRow in DataTableExtensions.AsEnumerable(rawTable)) | |
{ | |
DataRow dataRow = resultTable.NewRow(); | |
TryFillData<Guid>(dataRow, new ViewField<Guid>("ContactId"), sourceRow, "ContactId"); | |
TryFillData<Guid>(dataRow, new ViewField<Guid>("VisitId"), sourceRow, "_id"); | |
TryFillData<int>(dataRow, new ViewField<int>("VisitIndex"), sourceRow, "LatestVisitIndex"); | |
TryFillData<DateTime>(dataRow, new ViewField<DateTime>("VisitStartDateTime"), sourceRow, "StartDateTime"); | |
TryFillData<string>(dataRow, new ViewField<string>("RangeId"), sourceRow, "RangeId"); | |
TryFillData<string>(dataRow, new ViewField<string>("DecorId"), sourceRow, "DecorId"); | |
resultTable.Rows.Add(dataRow); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment