public Form2() { InitializeComponent(); List <flights> fl = new List <flights>(); // fl.Add(new flights() {flightNumber="kakka", from ="kska", destination="OK", status="on time"}); //FlightListMaker flm = new FlightListMaker(); FlightListMaker flm = new FlightListMaker(); fl = flm.listMaker(); Console.WriteLine(fl[0].flightNumber); // fl = flm.listMaker(); dataGridView1.DataSource = fl; }
public Form2(Form loginPage) { InitializeComponent(); this.loginPage = loginPage; this.warning = new Form3(this); //towrzenie listy lotow flm = new FlightListMaker(this); List <Flight> fl = flm.listMaker(); dataGridView1.DataSource = fl.Select(o => new { Number = o.flightNumber, From = o.from, Destination = o.destination, Status = o.status }).ToList();; //tworzenie timera Timer timer1 = new Timer(); timer1.Interval = 500; timer1.Enabled = true; timer1.Tick += new System.EventHandler(timer1_Tick); }