Exemple #1
0
        private void LoadCoaches()
        {
            try
            {
                using (var db = new CSBCDbContext())
                {
                    var rep = new CoachRepository(db);
                    var rsData = rep.GetSeasonCoaches(Master.SeasonId);
                    cmbCoach.DataSource = rsData;
                    cmbCoach.DataValueField = "CoachID";
                    cmbCoach.DataTextField = "Name";
                    cmbCoach.DataBind();
                    cmbCoach.Items.Insert(0, new ListItem(String.Empty, String.Empty));
                    cmbCoach.SelectedIndex = 0;

                    cmbAsstCoach.DataSource = rsData;
                    cmbAsstCoach.DataValueField = "CoachID";
                    cmbAsstCoach.DataTextField = "Name";
                    cmbAsstCoach.DataBind();
                    cmbAsstCoach.Items.Insert(0, new ListItem(String.Empty, String.Empty));
                    cmbAsstCoach.SelectedIndex = 0;
                }
            }
            catch (Exception ex)
            {
                lblError.Text = "LoadCoaches::" + ex.Message;
            }
        }
Exemple #2
0
        public void GetSeasonCoachesTest()
        {
            var context = new Core.Data.CSBCDbContext();
            var testinit = new CSBCDbInitializer();
            var rep = new CoachRepository(context);
            var coaches = rep.GetSeasonCoaches(testinit.CurrentSeason.SeasonID);

            Assert.IsTrue(coaches.Any<vw_Coaches>() );
        }
Exemple #3
0
        private void LoadCoaches()
        {
            var rep = new CoachRepository(new CSBCDbContext());
            try
            {
                var rsData = rep.GetSeasonCoaches(Master.SeasonId);

                //grdCoaches.Columns.Clear();
                if (rsData.Count<vw_Coaches>() > 0)
                {
                    var _with1 = grd;
                    grd.DataSource = rsData;
                    grd.DataBind();

                }
            }
            catch (Exception ex)
            {
                lblError.Text = "LoadCoaches::" + ex.Message;
            }
        }