public IEnumerable<Team> GetAllTeams() { try { db.LoadTeams(); return db.Teams; } catch (Exception) { throw; } }
private void FormMain_Load(object sender, EventArgs e) { db = new DbTools(); teams = new BindingList <Team>(db.LoadTeams()); listBoxTeam.DataSource = teams; // listBoxTeam.SelectedIndex = -1; }
private void FormMain_Load(object sender, EventArgs e) { db = new DbTools(); db.GetCountries(); db.GetDrivers(); teams = new BindingList <Team>(db.LoadTeams()); listBoxTeam.DataSource = teams; }
public IHttpActionResult GetTeam(int id) { try { db.LoadTeams(); if (db.Teams[id] == null) { return(NotFound()); } return(Ok(db.Teams[id])); } catch (Exception) { return(NotFound()); } }
private void FormMain_Load(object sender, EventArgs e) { db = new DbTools(); teams = new BindingList <Team>(db.LoadTeams()); listBoxTeam.DataSource = teams; cmbCountry.DataSource = new BindingSource(db.Countries, null); cmbCountry.DisplayMember = "Value"; cmbCountry.ValueMember = "Key"; cmbFirstDriver.DataSource = new BindingSource(db.Drivers, null); cmbFirstDriver.DisplayMember = "Value"; cmbFirstDriver.ValueMember = "Key"; cmbSecondDriver.DataSource = new BindingSource(db.Drivers, null); cmbSecondDriver.DisplayMember = "Value"; cmbSecondDriver.ValueMember = "Key"; }
private void FormMain_Load(object sender, EventArgs e) { db = new DbTools(); teams = db.LoadTeams(); listBoxTeam.DataSource = teams; }