Ejemplo n.º 1
0
        public static string GetLocations()
        {
            _sqlConn = new SqlConnection(Properties.Settings.Default.TirCache);
            _sqlConn.Open();

            _dataTables = new webTirCache();

            var taStations  = new StationsTableAdapter();
            var tblStations = _dataTables.Stations;

            taStations.Fill(tblStations);

            string stationArray = "";

            for (int i = 0; i < tblStations.Count; i++)
            {
                //six positions
                stationArray += string.Format(@"[""{0}"",""<strong>{0}</strong><p>{1}</p>"",{2},{3},{4},""{1}""]",
                                              tblStations[i].Name,
                                              tblStations[i].Type,
                                              tblStations[i].Latitude,
                                              tblStations[i].Longitude,
                                              tblStations[i].Id);

                if (i != tblStations.Count)
                {
                    stationArray += ",";
                }
            }

            stationArray = string.Format(@"[{0}]", stationArray);

            return(stationArray);
        }
Ejemplo n.º 2
0
        public ActionResult GetLocations()
        {
            _dataTables = new webTirCache();

            var taStations  = new StationsTableAdapter();
            var tblStations = _dataTables.Stations;

            taStations.Fill(tblStations);

            List <StationsRow> Stations = new List <StationsRow>();

            foreach (var row in tblStations)
            {
                Stations.Add(row);
            }

            return(Content("yolo"));
        }