예제 #1
0
        protected void CoachList()
        {
            ICoachInterface coachInterface = new CoachService();
            var             lst            = coachInterface.GetCoachList().Select(x => new { x.CoachName, x.ID }).ToList();
            DataTable       dt             = ToDataTable(lst);

            if (dt != null && dt.Rows.Count > 0)
            {
                CoachID.DataSource     = dt;
                CoachID.DataTextField  = "CoachName";
                CoachID.DataValueField = "ID";
                CoachID.DataBind();
            }
            else
            {
                CoachID.DataBind();
            }
        }
예제 #2
0
        protected void CoachList()//Binding coach dropdown here
        {
            ICoachLogics coachLogics = new CoachLogics();
            var          lst         = coachLogics.GetCoachList().Select(x => new { x.CoachName, x.ID }).ToList();
            DataTable    dt          = ToDataTable(lst);

            if (dt != null && dt.Rows.Count > 0)
            {
                CoachID.DataSource     = dt;
                CoachID.DataTextField  = "CoachName";
                CoachID.DataValueField = "ID";
                CoachID.DataBind();
            }
            else
            {
                CoachID.DataBind();
            }
        }