protected void rgClassRoom_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) { try { DayCareBAL.ClassRoomService proxyLoad = new DayCareBAL.ClassRoomService(); Guid SchoolId = new Guid(); if (Session["SchoolId"] != null) { SchoolId = new Guid(Session["SchoolId"].ToString()); } rgClassRoom.DataSource = proxyLoad.LoadClassRoom(SchoolId, new Guid(Session["CurrentSchoolYearId"].ToString())); } catch (Exception ex) { DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.ClassRoom, "rgClassRoom_NeedDataSource", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT); } }
public static void BindClassRoom(DropDownList ddlClassRoom, Guid SchoolId) { try { DayCareBAL.ClassRoomService proxyClassRoom = new DayCareBAL.ClassRoomService(); DayCarePL.ClassRoomProperties[] ClassRoom = proxyClassRoom.LoadClassRoom(SchoolId); if (ClassRoom != null && ClassRoom.Count() > 0) { ddlClassRoom.DataSource = ClassRoom.Where(c => c.Active.Equals(true)); ddlClassRoom.DataTextField = "Name"; ddlClassRoom.DataValueField = "Id"; ddlClassRoom.DataBind(); ddlClassRoom.Items.Insert(0, new ListItem("--Select--", DayCarePL.Common.GUID_DEFAULT)); } } catch { } }