Ejemplo n.º 1
0
        public IQueryable <Swimmer> GetSwimmers()
        {
            var db = new SplashFun.Models.SwimContext();
            IQueryable <Swimmer> query = db.Swimmers;

            return(query);
        }
Ejemplo n.º 2
0
        // The id parameter should match the DataKeyNames value set on the control
        // or be decorated with a value provider attribute, e.g. [QueryString]int id
        public IQueryable <Swimmer> SwimmerDetailsView_GetItem([QueryString("swimmerID")] int?swimmerId)
        {
            var db = new SplashFun.Models.SwimContext();
            IQueryable <Swimmer> query = db.Swimmers;

            if (swimmerId.HasValue)
            {
                query = query.Where(s => s.SwimmerID == swimmerId);
            }
            else
            {
                query = null;
            }
            return(query);
        }
Ejemplo n.º 3
0
        public System.Collections.IEnumerable repTimeRecords_GetData([QueryString("swimmerID")] int?swimmerId)
        {
            var db = new SplashFun.Models.SwimContext();

            times = db.TimeRecords.Where(t => t.Swimmer.SwimmerID == swimmerId).ToList();;

            if (!IsPostBack)
            {
                Repeater repeaterTimes = SwimmerDetailsView.FindControl("repBestTimes") as Repeater;
                if (repeaterTimes != null)
                {
                    repeaterTimes.DataSource = times;
                    repeaterTimes.DataBind();
                }
            }

            return(times);
        }