public static seriesCatalogTypeSeries row2SeriesCatalogElement(seriesCatalogDataSet.SeriesCatalogRow row, seriesCatalogDataSet ds, VariablesDataset vds, ControlledVocabularyDataset vocabularyDataset) { int variableID = row.VariableID; VariableInfoType variable = ODvariables.GetVariableByID(variableID, vds); Nullable <W3CDateTime> beginDateTime = null; if (!row.IsBeginDateTimeNull()) { TimeSpan timeSpan = row.BeginDateTime.Subtract(row.BeginDateTimeUTC); beginDateTime = new W3CDateTime(row.BeginDateTime, timeSpan); } Nullable <W3CDateTime> endDateTime = null; if (!row.IsEndDateTimeNull()) { TimeSpan timeSpan = row.EndDateTime.Subtract(row.EndDateTimeUTC); endDateTime = new W3CDateTime(row.EndDateTime, timeSpan); } Nullable <int> valueCount = null; if (!row.IsValueCountNull()) { valueCount = row.ValueCount; } string qualityControlLevelTerm = null; int? QualityControlLevelid = null; if (!row.IsQualityControlLevelIDNull()) { QualityControlLevelid = row.QualityControlLevelID; ControlledVocabularyDataset.QualityControlLevelsRow qcRow = vocabularyDataset.QualityControlLevels.FindByQualityControlLevelID(QualityControlLevelid.Value); if (qcRow != null) { qualityControlLevelTerm = qcRow.Definition; } } int?MethodID = null; if (!row.IsMethodIDNull()) { MethodID = row.MethodID; } int?SourceID = null; if (!row.IsSourceIDNull()) { SourceID = row.SourceID; } Nullable <Boolean> valueCountIsEstimated = false; /* public static seriesCatalogTypeSeries createSeriesCatalogRecord( * VariableInfoType variable, * string sampleMedium, * Nullable<W3CDateTime> beginDateTime, * Nullable<W3CDateTime> endDateTime, * Nullable<int> valueCount, * Nullable<Boolean> valueCountIsEstimated, * string dataType, * string valueType, * string generalCategory * ) */ seriesCatalogTypeSeries record = CuahsiBuilder.CreateSeriesRecord( variable, variable.sampleMedium.ToString(), beginDateTime, endDateTime, valueCount, valueCountIsEstimated, null, null, null, false, // real time null, // string if real time row.QualityControlLevelCode, QualityControlLevelid, row.MethodDescription, MethodID, row.Organization, row.SourceDescription, SourceID, row.Citation, true, // include UTC Time qualityControlLevelTerm ); return(record); }
public static seriesCatalogTypeSeries row2SeriesCatalogElement( seriesCatalogDataSet.SeriesCatalogRow row, seriesCatalogDataSet ds, VariablesDataset vds) { int variableID = row.VariableID; VariableInfoType variable = ODvariables.GetVariableByID(variableID, vds); Nullable <W3CDateTime> beginDateTime = null; if (!row.IsBeginDateTimeNull()) { beginDateTime = new W3CDateTime(row.BeginDateTime); } Nullable <W3CDateTime> endDateTime = null; if (!row.IsEndDateTimeNull()) { endDateTime = new W3CDateTime(row.EndDateTime); } Nullable <int> valueCount = null; if (!row.IsValueCountNull()) { valueCount = row.ValueCount; } int?QualityControlLevelid = null; if (!row.IsQualityControlLevelIDNull()) { QualityControlLevelid = row.QualityControlLevelID; } int?MethodID = null; if (!row.IsMethodIDNull()) { MethodID = row.MethodID; } int?SourceID = null; if (!row.IsSourceIDNull()) { SourceID = row.SourceID; } Nullable <Boolean> valueCountIsEstimated = false; seriesCatalogTypeSeries record = CuahsiBuilder.CreateSeriesRecord( variable, variable.sampleMedium.ToString(), beginDateTime, endDateTime, valueCount, valueCountIsEstimated, null, null, null, false, // real time null, // string if real time null, QualityControlLevelid, row.MethodDescription, MethodID, row.Organization, row.SourceDescription, SourceID, row.Citation); return(record); }