public Station(string stationId, string planVersionId, string shortName, string longName, Ubication ubi) { this.stationId = stationId; this.PlanVersionId = planVersionId; this.ShortName = shortName; this.LongName = longName; this.ubi = ubi; stops = new Hashtable(); }
public void addTime(String posX, String posY, String time) { String[] date = time.Split(' '); String[] hour = date[1].Split('.'); String[] date2 = date[0].Split('-'); String key = Int32.Parse(date2[0]) + "-" + date2[1] + "-" + Int32.Parse(date2[2]) + " " + Int32.Parse(hour[0]) + "." + Int32.Parse(hour[1]) + "." + Int32.Parse(hour[2]) + " " + date[2]; if (!UbicationTime.ContainsKey(key)) { Ubication nuevou = new Ubication(posX, posY); // Int32.Parse(date2[2]) Int32.Parse(date2[0]), Int32.Parse(date2[1]), Int32.Parse(date2[2]), Int32.Parse(hour[0]), Int32.Parse(hour[1]), Int32.Parse(hour[2]), date[2] GenericTime time2 = new GenericTime(Int32.Parse(date2[2]), Int32.Parse(date2[0]), (date2[1]), Int32.Parse(hour[0]), Int32.Parse(hour[1]), Int32.Parse(hour[2]), date[2]); nuevou.Time = time2; UbicationTime.Add(key, nuevou); //Next(key, nuevou); } }
public void CreateStation(Stop a) { String las = a.Gps_X; las.Replace(',', '.'); String lons = a.Gps_Y; lons.Replace(',', '.'); Boolean existeStop = false; Station existente = null; ICollection keyStop = Stations.Keys; foreach (String key in keyStop) { if (nameStop(((Station)stations[key]).ShortName).Equals(nameStop(a.ShortName))) { existeStop = true; existente = ((Station)stations[key]); break; } } if (existeStop == true) { (existente).addStop(a.ShortName, a); } else { Ubication ubi = new Ubication(lons, las); Station b = new Station(a.StopId, a.PlanVersionId, a.ShortName, a.LongName, ubi); b.addStop(a.ShortName, a); Stations.Add(a.StopId, b); } }