protected void Page_Load(object sender, EventArgs e) { /** * Access Control code * */ //first time loading only if (Page.IsPostBack) { return; } //Mandatory query string if (String.IsNullOrEmpty(Request.QueryString["StudentID"])) { return; } //load student data hdnStudentId.Value = Request.QueryString["StudentID"]; BCStudent objStudent = new BCStudent(); try { objStudent.Id = Convert.ToInt32(hdnStudentId.Value); objStudent.loadData(); } catch (WebServiceException ex) { /* error logging here */ Response.Redirect("ManageStudentSearch.aspx"); bool rethrow = ExceptionPolicy.HandleException(ex, "GenericPolicy"); if (rethrow) throw; return; } //populate headers lblNRIC.Text = objStudent.NRIC; lblStudentName.Text = objStudent.FullName; lblDateofReport.Text = DateTime.Today.ToString("dd MMMM yyyy"); //populate Summary gridview: grdSummary int[] clsIDs = retrieveClassIDsFromQueryString(); List<BCClassSchedule> aryCls = new List<BCClassSchedule>(); if (clsIDs != null) { foreach (int clsID in clsIDs) { BCClassSchedule objCls = new BCClassSchedule(); objCls.Id = clsID; if (objStudent.hasThisClassSchedule(objCls,true)) { objCls.LoadData(); aryCls.Add(objCls); } } } grdSummary.DataSource = aryCls; //bind grdSummary grdSummary.DataBind(); rptBreakdown.DataSource = aryCls; //bind detail breakdown rptBreakdown.DataBind(); //populate DepositFee gridview wsvDepositFee.DepositFee dbDF = new wsvDepositFee.DepositFee(); wsvDepositFee.CDepositFee[] aryDF = dbDF.GetDepositFeeByStudent(Convert.ToInt32(hdnStudentId.Value), wsvDepositFeePart.DFOption.OnlyUnDeleted); grdDesposits.DataSource = aryDF; grdDesposits.DataBind(); }