Example #1
0
        public DataTable GetMainStreetIntersectionsMaintenanceDecisions(string municName, bool details, bool notMaintOrders)
        {
            string sql = ""; // MAINTAIN_ORDER_DET_LOCS
            string notInMaintOrdersPart = notMaintOrders ? @" and INTERSECTION_ID not in (select INTERSECT_ID from VW_MAINT_ORDERS_FULL where INTERSECT_ID is not null and WORK_STATUS=1)  
                                                              and INTERSECTION_ID not in (select INTER_ID from FEEDBACK_DETAILS where INTER_ID is not null) "
                : "";

            string municNum = new Municpiality().GetMunicNo(municName);

            if (details)
            {
                if (municName == "0" || string.IsNullOrEmpty(municName))
                {
                    return(new DataTable());
                }

                sql = string.Format("select * from VW_LATEST_MD_INTERSAMP where inter_no like '{0}%' and INTER_NO is not null {1}  order by arname, INTER_NO ",
                                    municNum, notInMaintOrdersPart);
            }
            else
            {
                sql = string.Format("select * from VW_LATEST_MDCOST_SUM_INTER  where inter_no like '{0}%' {1}  order by arname ", municNum, notInMaintOrdersPart);
            }

            return(db.ExecuteQuery(sql));
        }
Example #2
0
        public DataTable GetMaintenancePrioritiesForMainStreetIntersectReport(string municName, bool udiDesc, bool udiAsc, bool priority)
        {
            string orderByPart = GetOrderByPriorityPart(udiDesc, udiAsc, priority);
            string municNum    = new Municpiality().GetMunicNo(municName);

            string sql = string.Format("select * from VW_LATEST_PRIO_INTERSECTIONS where SURVEY_NO>2 and inter_no like '{0}%' {1} ", municNum, orderByPart);

            return(db.ExecuteQuery(sql));
        }