/// <summary> /// getStations /// </summary> /// <param name="rowId"></param> /// <param name="maxRows"></param> /// <param name="responsibleOrganizationName"></param> /// <param name="providingOrganizationName"></param> /// <param name="projectName"></param> /// <param name="fieldEventStartDate"></param> /// <param name="fieldEventEndDate"></param> /// <param name="maximumLocationLatitude"></param> /// <param name="maximumLocationLongitude"></param> /// <param name="minimumLocationLatitude"></param> /// <param name="minimumLocationLongitude"></param> /// <param name="locationDescriptorContext"></param> /// <param name="locationDescriptorName"></param> /// <param name="stationType"></param> /// <param name="analyteName"></param> /// <returns>PNWWQXStations</returns> public static PNWWQXStations getStations ( int rowId, int maxRows, string providingOrganizationName, string projectOrganizationName, string projectName, string projectStartDate, string projectEndDate, string responsibleOrganizationName, string maximumLocationLatitude, string maximumLocationLongitude, string minimumLocationLatitude, string minimumLocationLongitude, string locationDescriptorContext, string[] locationDescriptorName, string[] stationType, string stationName, string samplingOrganizationName, string fieldEventStartDate, string fieldEventEndDate, string[] sampledMedia, string[] analyteName, string[] sampledTaxon ) { PNWWQXStations station = new PNWWQXStations(); //Validate Lat long //Do not wrap in try,catch -- validation logic build in Utility.LatLong ll = new Utility.LatLong( minimumLocationLatitude, minimumLocationLongitude, maximumLocationLatitude, maximumLocationLongitude); Utility.MinMaxDate dateProject = new Utility.MinMaxDate( projectStartDate, projectEndDate); Utility.MinMaxDate dateFieldEvent = new Utility.MinMaxDate( fieldEventStartDate, fieldEventEndDate); ArrayList returnStations = new ArrayList(); //Get Data DataSet ds = Data.getData ( rowId, maxRows, providingOrganizationName, projectOrganizationName, projectName, dateProject, responsibleOrganizationName, ll, locationDescriptorContext, string.Join(Config.SQL_ARR_DELIMINATOR.ToString(), locationDescriptorName), string.Join(Config.SQL_ARR_DELIMINATOR.ToString(), stationType), stationName, samplingOrganizationName, dateFieldEvent, string.Join(Config.SQL_ARR_DELIMINATOR.ToString(), sampledMedia), string.Join(Config.SQL_ARR_DELIMINATOR.ToString(), analyteName), string.Join(Config.SQL_ARR_DELIMINATOR.ToString(), sampledTaxon), Common.PNWWQDXIdentity.Station ); if ((ds == null) || (ds.Tables == null) || (ds.Tables[0] == null) || (ds.Tables[0].Rows.Count < 1)) { throw new ApplicationException("Query did not return any results. Please adjust your query."); } #if DEBUG System.Diagnostics.Debug.WriteLine("Provider Row Count: " + ds.Tables[0].Rows.Count); System.Diagnostics.Debug.WriteLine("Project Row Count: " + ds.Tables[1].Rows.Count); System.Diagnostics.Debug.WriteLine("Organization Row Count: " + ds.Tables[2].Rows.Count); System.Diagnostics.Debug.WriteLine("Analyte Row Count: " + ds.Tables[3].Rows.Count); System.Diagnostics.Debug.WriteLine("Binaries Row Count: " + ds.Tables[4].Rows.Count); #endif //Load Stations Stations.loadStationsValues(ref returnStations, ref ds); //Return cased array station.PNWWQXStationsList = (PNWWQXStationsList[])returnStations.ToArray(typeof(PNWWQXStationsList)); return(station); }
public static PNWWQXMeasurements getMeasurements( int rowId, int maxRows, string providingOrganizationName, string projectOrganizationName, string projectName, string projectStartDate, string projectEndDate, string responsibleOrganizationName, string maximumLocationLatitude, string maximumLocationLongitude, string minimumLocationLatitude, string minimumLocationLongitude, string locationDescriptorContext, string[] locationDescriptorName, string[] stationType, string stationName, string samplingOrganizationName, string fieldEventStartDate, string fieldEventEndDate, string[] sampledMedia, string[] analyteName, string[] sampledTaxon ) { PNWWQXMeasurements measurments = new PNWWQXMeasurements(); //Validate Lat long //Do not wrap in try,catch -- validation logic build in Utility.LatLong ll = new Utility.LatLong( minimumLocationLatitude, minimumLocationLongitude, maximumLocationLatitude, maximumLocationLongitude); Utility.MinMaxDate dateProject = new Utility.MinMaxDate( projectStartDate, projectEndDate); Utility.MinMaxDate dateFieldEvent = new Utility.MinMaxDate( fieldEventStartDate, fieldEventEndDate); //Array Used to buld the return array ArrayList returnMeasurments = new ArrayList(); //Get Data DataSet ds = Data.getData ( rowId, maxRows, providingOrganizationName, projectOrganizationName, projectName, dateProject, responsibleOrganizationName, ll, locationDescriptorContext, string.Join(Config.SQL_ARR_DELIMINATOR.ToString(), locationDescriptorName), string.Join(Config.SQL_ARR_DELIMINATOR.ToString(), stationType), stationName, samplingOrganizationName, dateFieldEvent, string.Join(Config.SQL_ARR_DELIMINATOR.ToString(), sampledMedia), string.Join(Config.SQL_ARR_DELIMINATOR.ToString(), analyteName), string.Join(Config.SQL_ARR_DELIMINATOR.ToString(), sampledTaxon), Common.PNWWQDXIdentity.Measurements ); #if DEBUG foreach (DataTable dt in ds.Tables) { System.Diagnostics.Debug.WriteLine("Table " + dt.TableName + ": " + dt.Rows.Count); } #endif //Load Measurments Measurements.loadMeasurementsValues(ref returnMeasurments, ref ds); //Return cased array measurments.PNWWQXMeasurementsList = (PNWWQXMeasurementsList[])returnMeasurments.ToArray(typeof(PNWWQXMeasurementsList)); return(measurments); }
/// <summary> /// getProjects /// </summary> /// <param name="rowId"></param> /// <param name="maxRows"></param> /// <param name="providingOrganizationName"></param> /// <param name="projectOrganizationName"></param> /// <param name="samplingOrganizationName"></param> /// <param name="projectStartDate"></param> /// <param name="projectEndDate"></param> /// <param name="maximumLocationLatitude"></param> /// <param name="maximumLocationLongitude"></param> /// <param name="minimumLocationLatitude"></param> /// <param name="minimumLocationLongitude"></param> /// <param name="locationDescriptorContext"></param> /// <param name="locationDescriptorName"></param> /// <param name="analyteName"></param> /// <returns>PNWWQXProjects</returns> public static PNWWQXProjects getProjects ( int rowId, int maxRows, string providingOrganizationName, string projectOrganizationName, string projectName, string projectStartDate, string projectEndDate, string responsibleOrganizationName, string maximumLocationLatitude, string maximumLocationLongitude, string minimumLocationLatitude, string minimumLocationLongitude, string locationDescriptorContext, string[] locationDescriptorName, string[] stationType, string stationName, string samplingOrganizationName, string fieldEventStartDate, string fieldEventEndDate, string[] sampledMedia, string[] analyteName, string[] sampledTaxon ) { //begin test raising user exceptions //SoapException SoapExcept = CreateSoapException(); //throw SoapExcept; //throw new Exception("E_InvalidSQL"); //end test PNWWQXProjects projects = new PNWWQXProjects(); //Validate Lat long //Do not wrap in try,catch -- validation logic build in Utility.LatLong ll = new Utility.LatLong( minimumLocationLatitude, minimumLocationLongitude, maximumLocationLatitude, maximumLocationLongitude); Utility.MinMaxDate dateProject = new Utility.MinMaxDate( projectStartDate, projectEndDate); Utility.MinMaxDate dateFieldEvent = new Utility.MinMaxDate( fieldEventStartDate, fieldEventEndDate); //Array Used to buld the return array ArrayList returnProject = new ArrayList(); //Get Data DataSet ds = Data.getData ( rowId, maxRows, providingOrganizationName, projectOrganizationName, projectName, dateProject, responsibleOrganizationName, ll, locationDescriptorContext, string.Join(Config.SQL_ARR_DELIMINATOR.ToString(), locationDescriptorName), string.Join(Config.SQL_ARR_DELIMINATOR.ToString(), stationType), stationName, samplingOrganizationName, dateFieldEvent, string.Join(Config.SQL_ARR_DELIMINATOR.ToString(), sampledMedia), string.Join(Config.SQL_ARR_DELIMINATOR.ToString(), analyteName), string.Join(Config.SQL_ARR_DELIMINATOR.ToString(), sampledTaxon), Common.PNWWQDXIdentity.Project ); #if DEBUG System.Diagnostics.Debug.WriteLine("Provider Row Count: " + ds.Tables[0].Rows.Count); System.Diagnostics.Debug.WriteLine("Project Row Count: " + ds.Tables[1].Rows.Count); System.Diagnostics.Debug.WriteLine("Organization Row Count: " + ds.Tables[2].Rows.Count); System.Diagnostics.Debug.WriteLine("Analyte Row Count: " + ds.Tables[3].Rows.Count); System.Diagnostics.Debug.WriteLine("Binaries Row Count: " + ds.Tables[4].Rows.Count); #endif //Load Projects Project.loadProjectValues(ref returnProject, ref ds); //Return cased array projects.PNWWQXProjectsList = (PNWWQXProjectsList[])returnProject.ToArray(typeof(PNWWQXProjectsList)); return(projects); }