private void comboBox2_SelectedIndexChanged(object sender, EventArgs e) { var test = comboBox1.SelectedItem as VihecalType; if (test == null) { return; } var ts = TransportModel.GetTransport(test.name); dataGridView1.DataSource = RideModel.GetRides(ts.Id.ToString(), (comboBox2.SelectedItem as RoutView).Id.ToString()); }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { var test = comboBox1.SelectedItem as VihecalType; if (test == null) { return; } var ts = TransportModel.GetTransport(test.name); comboBox2.Enabled = true; comboBox2.Items.AddRange(RouteModel.GetAllRoutes(ts.Id.ToString()).ToArray()); dataGridView1.DataSource = RideModel.GetRides(ts.Id.ToString(), null); }
private void Time_Table_Load(object sender, EventArgs e) { dataGridView1.DataSource = RideModel.GetRides(null, null); }