public void AddInputsTables(DataSet dataSet) { AddReportTimeSeriesInputsTable(dataSet, "TimeSeriesInputs", _RunReportRequest.Inputs); AddReportLocationInputTable(dataSet, "LocationInput", _RunReportRequest.Inputs); ReportRequestInputs inputs = _RunReportRequest.Inputs; if (inputs == null) { return; } if (inputs.TimeSeriesInputs != null) { foreach (TimeSeriesReportRequestInput timeseriesInput in inputs.TimeSeriesInputs) { AddTimeSeriesInputDataTable(dataSet, timeseriesInput); AddTimeSeriesLocationDataTable(dataSet, timeseriesInput); } } if (inputs.LocationInput != null) { AddLocationInputDataTable(dataSet, inputs.LocationInput); } }
public void AddReportLocationInputTable(System.Data.DataSet dataSet, string tableName, ReportRequestInputs inputs) { Log.DebugFormat("AddReportLocationInputTable {0}", tableName); if (dataSet.Tables.Contains(tableName)) { return; } DataTable table = new DataTable(tableName); dataSet.Tables.Add(table); table.Columns.Add("Name", typeof(string)); table.Columns.Add("Identifier", typeof(string)); if ((inputs == null) || (inputs.LocationInput == null)) { return; } System.Data.DataRow row = table.NewRow(); LocationReportRequestInput locationInput = inputs.LocationInput; row["Name"] = locationInput.Name; row["Identifier"] = locationInput.Identifier; table.Rows.Add(row); }
public void AddReportTimeSeriesInputsTable(System.Data.DataSet dataSet, string tableName, ReportRequestInputs inputs) { Log.DebugFormat("AddReportTimeSeriesInputsTable {0}", tableName); if (dataSet.Tables.Contains(tableName)) { return; } DataTable table = new DataTable(tableName); dataSet.Tables.Add(table); table.Columns.Add("Name", typeof(string)); table.Columns.Add("Guid", typeof(Guid)); table.Columns.Add("Label", typeof(string)); table.Columns.Add("IsMaster", typeof(bool)); if (inputs == null) { return; } foreach (TimeSeriesReportRequestInput timeseriesInput in inputs.TimeSeriesInputs) { DataRow row = table.NewRow(); row["Name"] = timeseriesInput.Name; row["Guid"] = timeseriesInput.UniqueId; row["Label"] = timeseriesInput.Label; row["IsMaster"] = timeseriesInput.IsMaster; table.Rows.Add(row); } }