/// <summary> /// Returns a VariablesDataSet, as defined by VariablesDataSet.xsd /// /// In SDSC code, this variable is loaded once, and is stored in an /// Application, or AppServer variable, and queries are run against the stored dataset. /// Other methods in this class are used to query the dataset. /// </summary> /// <param name="networkID"></param> /// <returns></returns> public static VariablesDataset GetVariableDataSet(int networkID) { VariablesDataset ds = new VariablesDataset(); UnitsTableAdapter unitTableAdapter = new UnitsTableAdapter(); VariablesTableAdapter varsTableAdapter = new VariablesTableAdapter(); CategoriesTableAdapter categoriesTableAdapter = new CategoriesTableAdapter(); unitTableAdapter.Connection.ConnectionString = Config.ODDB(); varsTableAdapter.Connection.ConnectionString = Config.ODDB(); categoriesTableAdapter.Connection.ConnectionString = Config.ODDB(); try { unitTableAdapter.Fill(ds.Units); varsTableAdapter.Fill(ds.Variables); categoriesTableAdapter.Fill(ds.Categories); } catch (Exception e) { log.Fatal("Cannot retrieve units or variables from database" + e.Message); //+ unitTableAdapter.Connection.DataSource throw new WaterOneFlowServerException("Cannot retrieve units or variables from database", e); } return(ds); }
// never implemented or used. Now implemented as a filter using a passed variable parameter //public static ValuesDataSet GetValueDataSet(int? siteID, int? VariableID, int? MethodID, int? SourceID, int? QualityControlLevelID, W3CDateTime BeginDateTime, W3CDateTime EndDateTime) //{ // ValuesDataSet ds = basicValuesDataSet(); // if (!siteID.HasValue || !VariableID.HasValue) return ds; // ValuesDataSetTableAdapters.DataValuesTableAdapter valuesTableAdapter = new DataValuesTableAdapter(); // valuesTableAdapter.Connection.ConnectionString = Config.ODDB(); // valuesTableAdapter.FillBySiteIdVariableIDBetweenDates(ds.DataValues, siteID.Value, VariableID.Value, BeginDateTime.DateTime, EndDateTime.DateTime); // return ds; //} #endregion // fills dataset with basic tables private static ValuesDataSet basicValuesDataSet() { ValuesDataSet ds = new ValuesDataSet(); ValuesDataSetTableAdapters.UnitsTableAdapter unitsTableAdapter = new UnitsTableAdapter(); unitsTableAdapter.Connection.ConnectionString = Config.ODDB(); ValuesDataSetTableAdapters.OffsetTypesTableAdapter offsetTypesTableAdapter = new ValuesDataSetTableAdapters.OffsetTypesTableAdapter(); offsetTypesTableAdapter.Connection.ConnectionString = Config.ODDB(); ValuesDataSetTableAdapters.QualityControlLevelsTableAdapter qualityControlLevelsTableAdapter = new ValuesDataSetTableAdapters.QualityControlLevelsTableAdapter(); qualityControlLevelsTableAdapter.Connection.ConnectionString = Config.ODDB(); ValuesDataSetTableAdapters.MethodsTableAdapter methodsTableAdapter = new ValuesDataSetTableAdapters.MethodsTableAdapter(); methodsTableAdapter.Connection.ConnectionString = Config.ODDB(); ValuesDataSetTableAdapters.SamplesTableAdapter samplesTableAdapter = new ValuesDataSetTableAdapters.SamplesTableAdapter(); samplesTableAdapter.Connection.ConnectionString = Config.ODDB(); ValuesDataSetTableAdapters.SourcesTableAdapter sourcesTableAdapter = new ValuesDataSetTableAdapters.SourcesTableAdapter(); sourcesTableAdapter.Connection.ConnectionString = Config.ODDB(); QualifiersTableAdapter qualifiersTableAdapter = new QualifiersTableAdapter(); qualifiersTableAdapter.Connection.ConnectionString = Config.ODDB(); unitsTableAdapter.Fill(ds.Units); offsetTypesTableAdapter.Fill(ds.OffsetTypes); qualityControlLevelsTableAdapter.Fill(ds.QualityControlLevels); methodsTableAdapter.Fill(ds.Methods); samplesTableAdapter.Fill(ds.Samples); sourcesTableAdapter.Fill(ds.Sources); qualifiersTableAdapter.Fill(ds.Qualifiers); return(ds); }
public static unitsDataset getUnitsDataset() { unitsDataset uDS = new unitsDataset(); UnitsTableAdapter unitsTableAdapter = new UnitsTableAdapter(); unitsTableAdapter.Connection.ConnectionString = odws.Config.ODDB(); try { unitsTableAdapter.Fill(uDS.Units); } catch (Exception e) { log.Fatal("Cannot retrieve units from the database: " + e.Message); } return uDS; }
public static unitsDataset getUnitsDataset() { unitsDataset uDS = new unitsDataset(); UnitsTableAdapter unitsTableAdapter = new UnitsTableAdapter(); unitsTableAdapter.Connection.ConnectionString = odws.Config.ODDB(); try { unitsTableAdapter.Fill(uDS.Units); } catch (Exception e) { log.Fatal("Cannot retrieve units from the database: " + e.Message); } return(uDS); }
// fills dataset with basic tables private static ValuesDataSet basicValuesDataSet() { ValuesDataSet ds = new ValuesDataSet(); UnitsTableAdapter unitsTableAdapter = new UnitsTableAdapter(); unitsTableAdapter.Connection.ConnectionString = odws.Config.ODDB(); OffsetTypesTableAdapter offsetTypesTableAdapter = new OffsetTypesTableAdapter(); offsetTypesTableAdapter.Connection.ConnectionString = odws.Config.ODDB(); QualityControlLevelsTableAdapter qualityControlLevelsTableAdapter = new QualityControlLevelsTableAdapter(); qualityControlLevelsTableAdapter.Connection.ConnectionString = odws.Config.ODDB(); MethodsTableAdapter methodsTableAdapter = new MethodsTableAdapter(); methodsTableAdapter.Connection.ConnectionString = odws.Config.ODDB(); SamplesTableAdapter samplesTableAdapter = new SamplesTableAdapter(); samplesTableAdapter.Connection.ConnectionString = odws.Config.ODDB(); SourcesTableAdapter sourcesTableAdapter = new SourcesTableAdapter(); sourcesTableAdapter.Connection.ConnectionString = odws.Config.ODDB(); QualifiersTableAdapter qualifiersTableAdapter = new QualifiersTableAdapter(); qualifiersTableAdapter.Connection.ConnectionString = odws.Config.ODDB(); CensorCodeCVTableAdapter censorCodeCvTableAdapter = new CensorCodeCVTableAdapter(); censorCodeCvTableAdapter.Connection.ConnectionString = odws.Config.ODDB(); ISOMetadataTableAdapter IsoMetadataTableAdapter = new ISOMetadataTableAdapter(); IsoMetadataTableAdapter.Connection.ConnectionString = odws.Config.ODDB(); unitsTableAdapter.Fill(ds.Units); offsetTypesTableAdapter.Fill(ds.OffsetTypes); qualityControlLevelsTableAdapter.Fill(ds.QualityControlLevels); methodsTableAdapter.Fill(ds.Methods); samplesTableAdapter.Fill(ds.Samples); sourcesTableAdapter.Fill(ds.Sources); qualifiersTableAdapter.Fill(ds.Qualifiers); censorCodeCvTableAdapter.Fill(ds.CensorCodeCV); IsoMetadataTableAdapter.Fill(ds.ISOMetadata); return(ds); }
//public static ValuesDataSet GetValueDataSet(int? siteID, int? VariableID, int? MethodID, int? SourceID, int? QualityControlLevelID) //{ // ValuesDataSet ds = basicValuesDataSet(); // if (!siteID.HasValue || !VariableID.HasValue) return ds; // ValuesDataSetTableAdapters.DataValuesTableAdapter valuesTableAdapter = new DataValuesTableAdapter(); // valuesTableAdapter.FillBySiteIdVariableIDBetweenDates(ds.DataValues, siteID.Value, VariableID.Value, BeginDateTime.DateTime, EndDateTime.DateTime); // return ds; //} #endregion odm 1 series based // fills dataset with basic tables private static ValuesDataSet basicValuesDataSet() { ValuesDataSet ds = new ValuesDataSet(); UnitsTableAdapter unitsTableAdapter = new UnitsTableAdapter(); unitsTableAdapter.Connection.ConnectionString = odws.Config.ODDB(); OffsetTypesTableAdapter offsetTypesTableAdapter = new OffsetTypesTableAdapter(); offsetTypesTableAdapter.Connection.ConnectionString = odws.Config.ODDB(); QualityControlLevelsTableAdapter qualityControlLevelsTableAdapter = new QualityControlLevelsTableAdapter(); qualityControlLevelsTableAdapter.Connection.ConnectionString = odws.Config.ODDB(); MethodsTableAdapter methodsTableAdapter = new MethodsTableAdapter(); methodsTableAdapter.Connection.ConnectionString = odws.Config.ODDB(); SamplesTableAdapter samplesTableAdapter = new SamplesTableAdapter(); samplesTableAdapter.Connection.ConnectionString = odws.Config.ODDB(); SourcesTableAdapter sourcesTableAdapter = new SourcesTableAdapter(); sourcesTableAdapter.Connection.ConnectionString = odws.Config.ODDB(); QualifiersTableAdapter qualifiersTableAdapter = new QualifiersTableAdapter(); qualifiersTableAdapter.Connection.ConnectionString = odws.Config.ODDB(); CensorCodeCVTableAdapter censorCodeCvTableAdapter = new CensorCodeCVTableAdapter(); censorCodeCvTableAdapter.Connection.ConnectionString = odws.Config.ODDB(); ISOMetadataTableAdapter IsoMetadataTableAdapter = new ISOMetadataTableAdapter(); IsoMetadataTableAdapter.Connection.ConnectionString = odws.Config.ODDB(); unitsTableAdapter.Fill(ds.Units); offsetTypesTableAdapter.Fill(ds.OffsetTypes); qualityControlLevelsTableAdapter.Fill(ds.QualityControlLevels); methodsTableAdapter.Fill(ds.Methods); samplesTableAdapter.Fill(ds.Samples); sourcesTableAdapter.Fill(ds.Sources); qualifiersTableAdapter.Fill(ds.Qualifiers); censorCodeCvTableAdapter.Fill(ds.CensorCodeCV); IsoMetadataTableAdapter.Fill(ds.ISOMetadata); return ds; }
/// <summary> /// Returns a VariablesDataSet, as defined by VariablesDataSet.xsd /// /// In SDSC code, this variable is loaded once, and is stored in an /// Application, or AppServer variable, and queries are run against the stored dataset. /// Other methods in this class are used to query the dataset. /// </summary> /// <param name="networkID"></param> /// <returns></returns> public static VariablesDataset GetVariableDataSet(int networkID) { VariablesDataset ds = new VariablesDataset(); UnitsTableAdapter unitTableAdapter = new UnitsTableAdapter(); VariablesTableAdapter varsTableAdapter = new VariablesTableAdapter(); CategoriesTableAdapter categoriesTableAdapter = new CategoriesTableAdapter(); unitTableAdapter.Connection.ConnectionString = Config.ODDB(); varsTableAdapter.Connection.ConnectionString = Config.ODDB(); categoriesTableAdapter.Connection.ConnectionString = Config.ODDB(); try { unitTableAdapter.Fill(ds.Units); varsTableAdapter.Fill(ds.Variables); categoriesTableAdapter.Fill(ds.Categories); } catch (Exception e) { log.Fatal("Cannot retrieve units or variables from database" + e.Message); //+ unitTableAdapter.Connection.DataSource throw new WaterOneFlowServerException("Cannot retrieve units or variables from database", e); } return ds; }