コード例 #1
0
        public IEnumerable<Team> GetAllTeams()
        {
            try
            {
                db.LoadTeams();
                return db.Teams;
            }
            catch (Exception)
            {
                throw;
            }

        }
コード例 #2
0
 private void FormMain_Load(object sender, EventArgs e)
 {
     db    = new DbTools();
     teams = new BindingList <Team>(db.LoadTeams());
     listBoxTeam.DataSource = teams;
     // listBoxTeam.SelectedIndex = -1;
 }
コード例 #3
0
 private void FormMain_Load(object sender, EventArgs e)
 {
     db = new DbTools();
     db.GetCountries();
     db.GetDrivers();
     teams = new BindingList <Team>(db.LoadTeams());
     listBoxTeam.DataSource = teams;
 }
コード例 #4
0
        public IHttpActionResult GetTeam(int id)
        {
            try
            {
                db.LoadTeams();
                if (db.Teams[id] == null)
                {
                    return(NotFound());
                }

                return(Ok(db.Teams[id]));
            }
            catch (Exception)
            {
                return(NotFound());
            }
        }
コード例 #5
0
        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";
        }
コード例 #6
0
 private void FormMain_Load(object sender, EventArgs e)
 {
     db    = new DbTools();
     teams = db.LoadTeams();
     listBoxTeam.DataSource = teams;
 }