protected void rgAbsentReason_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
 {
     try
     {
         DayCareBAL.AbsentReasonService LoadProxy = new DayCareBAL.AbsentReasonService();
         Guid SchoolId = new Guid();
         if (Session["SchoolId"] != null)
         {
             SchoolId = new Guid(Session["SchoolId"].ToString());
         }
         rgAbsentReason.DataSource = LoadProxy.LoadAbsentReason(SchoolId);
     }
     catch (Exception ex)
     {
         DayCarePL.Logger.Write(DayCarePL.LogType.EXCEPTION, DayCarePL.ModuleToLog.AbsentReason, "rgAbsentReason_NeedDataSource", ex.Message.ToString(), DayCarePL.Common.GUID_DEFAULT);
     }
 }
Exemple #2
0
 public static void BindAbsentReson(DropDownList ddlAbsentReason, Guid SchoolId)
 {
     try
     {
         DayCareBAL.AbsentReasonService    proxyAbsentReason = new DayCareBAL.AbsentReasonService();
         DayCarePL.AbsentResonProperties[] lstRelationship   = proxyAbsentReason.LoadAbsentReason(SchoolId);
         if (lstRelationship != null && lstRelationship.Count() > 0)
         {
             ddlAbsentReason.DataSource     = lstRelationship.ToList().FindAll(r => r.Active == true);
             ddlAbsentReason.DataTextField  = "Reason";
             ddlAbsentReason.DataValueField = "Id";
             ddlAbsentReason.DataBind();
         }
         ddlAbsentReason.Items.Insert(0, new ListItem("--Select--", DayCarePL.Common.GUID_DEFAULT));
     }
     catch
     {
     }
 }