protected void rptBreakdown_ItemDataBound(object sender, RepeaterItemEventArgs e) { int clsId = ((BCClassSchedule)(e.Item.DataItem)).Id; string temp; BCRegular objRegular = new BCRegular(); objRegular.Id = clsId; try { objRegular.LoadData(); } catch (WebServiceException ex) { bool rethrow = ExceptionPolicy.HandleException(ex, "GenericPolicy"); if (rethrow) throw; return; } //class description label //S4 P Chem Sun 1300 - 1430 (sample) Label lblClassDescription = (Label)(e.Item.FindControl("lblClassDescription")); temp = "{0} {1} {2} {3} - {4}"; lblClassDescription.Text = String.Format(temp, objRegular.GetSubject().name, objRegular.getLevel().Name, objRegular.Day, objRegular.TimeStart.ToString("hh:mm tt"), objRegular.TimeEnd.ToString("hh:mm tt") ); GridView grdPaymentHistory = (GridView)(e.Item.FindControl("grdPaymentHistory")); grdPaymentHistory.RowDataBound += new GridViewRowEventHandler(grdPaymentHistory_RowDataBound); grdPaymentHistory.RowCreated += new GridViewRowEventHandler(grdPaymentHistory_RowCreated); BCPayment[] aryBCPayment = BCPayment.getPaymentByStudentClass( Convert.ToInt32(hdnStudentId.Value), clsId); grdPaymentHistory.DataSource = aryBCPayment; grdPaymentHistory.DataBind(); Label lblEmptyPH = (Label)(e.Item.FindControl("lblEmptyPaymentHistory")); lblEmptyPH.Visible = (aryBCPayment == null || aryBCPayment.Length == 0); GridView grdAttendanceHistory = (GridView)(e.Item.FindControl("grdAttendanceHistory")); grdAttendanceHistory.RowDataBound += new GridViewRowEventHandler(grdAttendanceHistory_RowDataBound); grdAttendanceHistory.RowCreated += new GridViewRowEventHandler(grdAttendanceHistory_RowCreated); wsvAttendanceLn.AttendanceLn dbAttln = new wsvAttendanceLn.AttendanceLn(); wsvAttendanceLn.CAttendanceLn[] aryAttln = dbAttln.GetAttendanceByStudentClass( Convert.ToInt32(hdnStudentId.Value), clsId); grdAttendanceHistory.DataSource = aryAttln; grdAttendanceHistory.DataBind(); Label lblEmptyAH = (Label)(e.Item.FindControl("lblEmptyAttendanceHistory")); lblEmptyAH.Visible = (aryAttln == null || aryAttln.Length == 0); GridView grdAbsenceSummary = (GridView)(e.Item.FindControl("grdAbsenceSummary")); grdAbsenceSummary.RowDataBound += new GridViewRowEventHandler(grdAbsenceSummary_RowDataBound); grdAbsenceSummary.RowCreated += new GridViewRowEventHandler(grdAbsenceSummary_RowCreated); BCStudent objStud = new BCStudent(); objStud.Id = Convert.ToInt32(hdnStudentId.Value); DataSet dsReport = objStud.GenerateAttendanceSummaryReport(clsId, 2); grdAbsenceSummary.DataSource = dsReport; grdAbsenceSummary.DataBind(); Label lblEmptyAS = (Label)(e.Item.FindControl("lblEmptyAbsenceSummary")); lblEmptyAS.Visible = (dsReport == null || dsReport.Tables.Count == 0 || dsReport.Tables[0].Rows.Count == 0); }