public static double GetIntersectionSampleArea(int intersectSampleID) { string sql = string.Format("select nvl(INTERSEC_SAMP_AREA, 0) as INTERSEC_SAMP_AREA from INTERSECTION_SAMPLES where INTER_SAMP_ID={0} ", intersectSampleID); DataTable dt = new OracleDatabaseClass().ExecuteQuery(sql); return((dt.Rows.Count == 0) ? 0 : double.Parse(dt.Rows[0]["INTERSEC_SAMP_AREA"].ToString())); }
public static bool SampleReadyForDistressEntry(int sampleID) { if (sampleID == 0) { return(false); } string sql = string.Format("SELECT SAMPLE_ID, SAMPLE_NO, SAMPLE_LENGTH, SAMPLE_WIDTH, (SAMPLE_LENGTH * SAMPLE_WIDTH) AS AREA FROM LANE_SAMPLES WHERE SAMPLE_ID={0} AND SAMPLE_LENGTH IS NOT NULL AND SAMPLE_WIDTH IS NOT NULL", sampleID); DataTable dt = new OracleDatabaseClass().ExecuteQuery(sql); return((dt.Rows.Count > 0) ? decimal.Parse(dt.Rows[0]["AREA"].ToString()) > 0 : false); }
public static string GetSurveyorNameByID(int ID) { if (ID == 0) { return(""); } string sql = string.Format("select SURVEYOR_NAME from SURVEYORS where SURVEYOR_NO={0} ", ID); string surveyorName = new OracleDatabaseClass().ExecuteScalar(sql).ToString(); return(surveyorName); }
public static bool IntersectionSampleReadyForDistressEntry(int intersectSampleID) { if (intersectSampleID == 0) { return(false); } string sql = string.Format("SELECT INTER_SAMP_ID, INTER_SAMP_NO, INTERSEC_SAMP_AREA AS AREA FROM INTERSECTION_SAMPLES WHERE INTER_SAMP_ID={0} and INTERSEC_SAMP_AREA is not null ", intersectSampleID); DataTable dt = new OracleDatabaseClass().ExecuteQuery(sql); if (dt.Rows.Count > 0) { return(decimal.Parse(dt.Rows[0]["AREA"].ToString()) > 0); } else { return(false); } //return (dt.Rows.Count > 0); }
public static bool SecondaryStreetSampleReadyForDistressEntry(int secondaryStID) { if (secondaryStID == 0) { return(false); } string sql = string.Format("SELECT STREET_ID, SECOND_ST_NO, SECOND_ARNAME, SECOND_ST_LENGTH, SECOND_ST_WIDTH, (SECOND_ST_LENGTH * SECOND_ST_WIDTH) AS AREA FROM STREETS " + " WHERE STREET_ID={0} AND SECOND_ST_LENGTH IS NOT NULL AND SECOND_ST_WIDTH IS NOT NULL ", secondaryStID); // SECOND_ID DataTable dt = new OracleDatabaseClass().ExecuteQuery(sql); if (dt.Rows.Count > 0) { return((decimal.Parse(dt.Rows[0]["AREA"].ToString()) > 0) && !string.IsNullOrEmpty(dt.Rows[0]["SECOND_ST_NO"].ToString())); } else { return(false); } }
public static decimal?GetRoadNetworkItemUdi(string sectionID, string interID, string sampleID, string regionID, string secondID) { //DataTable dt; //int lastSurveyNum = 0; string sql = ""; decimal?lastUDI = null; if (!string.IsNullOrEmpty(sectionID) && sectionID != "0") { //if (sectionID == "0") // return null; //dt = new DistressSurvey().GetSectionLatestSurvey(int.Parse(sectionID)); //if (dt.Rows.Count == 0) // return null; //else if (int.Parse(dt.Rows[0]["SURVEY_NO"].ToString()) == 0) // return null; //else // lastSurveyNum = int.Parse(dt.Rows[0]["SURVEY_NO"].ToString()); // UDI_SECTION and SURVEY_NO={1} , lastSurveyNum if (string.IsNullOrEmpty(sampleID) || sampleID == "0") { // get section UDI sql = string.Format("select UDI_VALUE from VW_LATEST_UDI_SECTIONS where SECTION_ID={0} ", sectionID); lastUDI = new OracleDatabaseClass().ExecuteScalarNullable(sql); } else { // get section sample UDI sql = string.Format("select UDI_VALUE from VW_LATEST_UDI_SEC_SAMPLES where SAMPLE_ID={0} ", sampleID); // UDI_SECTION_SAMPLE lastUDI = new OracleDatabaseClass().ExecuteScalarNullable(sql); } } else if (!string.IsNullOrEmpty(interID) && interID != "0") { //dt = new DistressSurvey().GetIntersectionLatestSurvey(int.Parse(interID)); //if (dt.Rows.Count == 0) // return null; //else if (int.Parse(dt.Rows[0]["SURVEY_NO"].ToString()) == 0) // return null; //else // lastSurveyNum = int.Parse(dt.Rows[0]["SURVEY_NO"].ToString()); if (string.IsNullOrEmpty(sampleID) || sampleID == "0") { // get intersection UDI sql = string.Format("select UDI_VALUE from VW_LATEST_UDI_INTERSECTIONS where INTERSECTION_ID={0} ", interID); // UDI_INTERSECTION lastUDI = new OracleDatabaseClass().ExecuteScalarNullable(sql); } else { // get intersection sample UDI sql = string.Format("select UDI_VALUE from VW_LATEST_UDI_INTER_SAMPLES where INTER_SAMP_ID={0} ", sampleID); // UDI_INTERSECTION_SAMPLE lastUDI = new OracleDatabaseClass().ExecuteScalarNullable(sql); } } else if (!string.IsNullOrEmpty(regionID) && !string.IsNullOrEmpty(secondID) && regionID != "0" && secondID != "0") { //dt = new DistressSurvey().GetRegionDistrictLatestSurveys(int.Parse(regionID), "", "", "", true, false, false, false); //if (dt.Rows.Count == 0) // return null; //else if (int.Parse(dt.Rows[0]["SURVEY_NO"].ToString()) == 0) // return null; //else // lastSurveyNum = int.Parse(dt.Rows[0]["SURVEY_NO"].ToString()); // get secondary street UDI sql = string.Format("select UDI_VALUE from VW_LATEST_UDI_SECONDARY where STREET_ID={0} ", secondID); // UDI_SECONDARY lastUDI = new OracleDatabaseClass().ExecuteScalarNullable(sql); } else { return(null); } return(lastUDI); }