Ejemplo n.º 1
0
        public void LoadMiejska(string data, int h, int m)
        {
            Label4 = "Working...";
            miej   = new Miejska(this);
            miej.Pobierz(data, h, m);
            dataGridViewKZKGOP.Rows.Clear();
            int thH = 0, thM = 0, thI = 0;

            for (int i = 0; i < miej.Autobusy.Count(); i++)
            {
                Autobus bus = miej.Autobusy[i];
                dataGridViewKZKGOP.Rows.Add(bus.Odjazd, bus.Przyjazd, bus.BusNr, bus.Kierunek, bus.PrzystanekStart, bus.PrzystanekKoniec, bus.IloscPrzystankow);
                int tH = Convert.ToInt32(bus.Przyjazd.Substring(0, bus.Przyjazd.IndexOf(":")));
                int tM = Convert.ToInt32(bus.Przyjazd.Substring(bus.Przyjazd.IndexOf(":") + 1));
                if (tH > thH || (tH == thH && tM > thM))
                {
                    thH = tH;
                    thM = tM;
                    thI = i;
                }
            }
            dataGridViewKZKGOP.CurrentCell = dataGridViewKZKGOP.Rows[thI].Cells[0];
            Label4 = "Completed";
        }
Ejemplo n.º 2
0