public bool PrepareMainStreetSectionsMaintenanceDecisions(int mainStID, string user, bool wholeNetwork) { bool result = true; DataTable dt; if (wholeNetwork) { dt = distSurvey.GetRegionsAndMainStreetSectionIntersections(0, "", "", "", false, false, false, false, mainStID, true, false); } else { dt = distSurvey.GetLastSurveyForRoadsNetwork(0, "", "", "", false, false, false, false, mainStID, true, false); } foreach (DataRow dr in dt.Rows) { result &= PrepareMainStreetSectionsMaintenanceDecisions(mainStID, int.Parse(dr["SURVEY_NO"].ToString()), user); } return(result); }
public bool CalculateRegionSecondaryStreetsUDI(int regionID, string user, bool wholeNetwork) { bool result = true; DataTable dt; if (wholeNetwork) { dt = distSurvey.GetRegionsAndMainStreetSectionIntersections(regionID, "", "", "", true, false, false, false, 0, false, false); } else { dt = distSurvey.GetLastSurveyForRoadsNetwork(regionID, "", "", "", true, false, false, false, 0, false, false); } foreach (DataRow dr in dt.Rows) { result &= CalculateRegionSecondaryStreetsUDI(regionID, int.Parse(dr["SURVEY_NO"].ToString()), user); } return(result); }
//private DataTable dtMaintAffectedArea; //private int recordsAffected = 0; #region Reporting public DataTable GetMaintenanceDecisionsForMainStreetLanes(int mainStID, bool forServiceLanes, int surveyNum) { if (mainStID == 0) //|| survey == 0) { return(new DataTable()); } if (surveyNum == 0) { DataTable dt = survey.GetLastSurveyForRoadsNetwork(0, "", "", "", false, false, false, false, mainStID, true, false); if (dt.Rows.Count == 0) { return(new DataTable()); } surveyNum = int.Parse(dt.Rows[0]["SURVEY_NO"].ToString()); } // MAINTE_DECI MAIN_STREET_ID string sql = string.Format("SELECT * FROM VW_MAINT_DEC_IRI_LSAMPLES where STREET_ID={0} and SURVEY_NO={1} ORDER BY SECTION_NO, LANE_TYPE, SAMPLE_NO ", mainStID, surveyNum); return(db.ExecuteQuery(sql)); }
public DataTable GetMainStreetSectionsMaintenanceDecisions(int mainStID, int surveyNum, bool details, bool notMaintOrders) { if (surveyNum == 0) { DataTable dt = survey.GetLastSurveyForRoadsNetwork(0, "", "", "", false, false, false, false, mainStID, true, false); if (dt.Rows.Count == 0) { return(new DataTable()); } surveyNum = int.Parse(dt.Rows[0]["SURVEY_NO"].ToString()); } string sql = ""; string notInMaintOrdersPart = notMaintOrders ? " and section_id not in (select SECTION_ID from MAINTAIN_ORDER_DET_LOCS where SECTION_ID is not null) " : ""; if (details) { if (mainStID == 0) { return(new DataTable()); } else //MAIN_STREET_ID { sql = string.Format("select * from VW_SECTIONS_MAINT_COST where STREET_ID={0} and SURVEY_NO={1} {2} order by arname, section_no, lane_type ", mainStID, surveyNum, notInMaintOrdersPart); } } else { string mainStPart = (mainStID == 0) ? "" : string.Format(" and STREET_ID={0} ", mainStID); sql = string.Format("select * from VW_SECTIONS_MAINT_COST_SUMMARY where survey_no={0} {1} {2} order by arname ", surveyNum, mainStPart, notInMaintOrdersPart); } return(db.ExecuteQuery(sql)); }