public virtual BCStudent GetAssociatedStudent() { BCStudent result = new BCStudent(); result.Id = IdStudent; result.loadData(); return result; }
public virtual void ComputeDynamicFields(PaymentAdvice parent) { ApasConfigurationManager cfg=new ApasConfigurationManager(); decimal deviationTotal=0; PayableCredit=NextMonthCredit -Credit +CreditAdjustment; PayableFee=PerLessonFee*PayableCredit; foreach(FeeDeviationPayableFee objFD in FeeDeviations.Values) { //objFD returns exact amount. round it before adding to total deviationTotal += MyUtils.FormatCurrencyWithRounding(objFD.ComputeNetDeviation(PayableFee)); } PayableFee += deviationTotal; PayableFee = MyUtils.FormatCurrencyWithRounding(PayableFee); //get Config paymentadvice Text template and fill PaymentAdviceText PaymentAdviceText = cfg.getConfigValue("PaymentAdviceTemplateCFee"); BCStudent student = new BCStudent(); student.Id = parent.IdStudent; student.loadData(); ApasRegular regClass = GetAssociatedClass(); PaymentAdviceText = PaymentAdviceText .Replace("[Name]", student.FullName) .Replace("[Subject]", regClass.GetSubject().name) .Replace("[Level]", regClass.getLevel().Name) .Replace("[Time Start]", regClass.TimeStart.ToString("hh:mm tt")) .Replace("[Time End]", regClass.TimeEnd.ToString("hh:mm tt")) .Replace("[Day]", regClass.Day) .Replace("[Absence]", Convert.ToString(Absence)) .Replace("[Prorate]", Convert.ToString(Prorate)) .Replace("[Makeup]", Convert.ToString(Makeup)) .Replace("[Forfeit]", Convert.ToString(Forfeit)) .Replace("[Credit]", Convert.ToString(Credit)) .Replace("[Payable Credit]", Convert.ToString(PayableCredit)) .Replace("[Next Mth Lessons]", Convert.ToString(NextMonthCredit)) .Replace("[Credit Adjustment]", Convert.ToString(CreditAdjustment)) .Replace("[Per Lesson Fee]", String.Format("{0:C}", PerLessonFee)) .Replace("[Fee Deviation Total]", String.Format("{0:C}", deviationTotal)) .Replace("[Payable Fee]", String.Format("{0:C}", PayableFee)) .Replace("[Private Remarks]", PrivateRemark) .Replace("[Public Remarks]", PublicRemark) .Replace("[Month]", parent.GetParentPAList().Month.ToString("MMMM")) .Replace("[Year]", parent.GetParentPAList().Month.ToString("yyyy")); }
public virtual void ComputeDynamicFields(PaymentAdvice parent) { ApasConfigurationManager cfg = new ApasConfigurationManager(); decimal deviationTotal = 0; PayableFee=Amount; foreach (FeeDeviationPayableFee objFD in FeeDeviations.Values) { //objFD returns exact amount. round it before adding to total deviationTotal += MyUtils.FormatCurrencyWithRounding(objFD.ComputeNetDeviation(0));//dummy zero, type is "fixed" } PayableFee += deviationTotal; BCStudent student = new BCStudent(); student.Id = parent.IdStudent ; student.loadData(); PaymentAdviceText = cfg.getConfigValue("PaymentAdviceTemplateOFee"); //get Config paymentadvice Text template and fill PaymentAdviceText PaymentAdviceText = PaymentAdviceText .Replace("[Name]", student.FullName) .Replace("[Amount]", String.Format("{0:C}", Amount)) .Replace("[Payable Fee]", String.Format("{0:C}", PayableFee)) .Replace("[Fee Deviation Total]", String.Format("{0:C}", deviationTotal)) .Replace("[Private Remarks]", PrivateRemark) .Replace("[Public Remarks]", PublicRemark) .Replace("[Month]", parent.GetParentPAList().Month.ToString("MMMM")) .Replace("[Year]", parent.GetParentPAList().Month.ToString("yyyy")) .Replace("[Type]", OtherFeeType.Name); }
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(); }