// Done public List<ScholarshipDiscount> GetAllScholarshipDiscount(int scholarshipCode) { List<ScholarshipDiscount> sDiscount = new List<ScholarshipDiscount>(); foreach (ScholarshipDiscountBDO sdbdo in sLogic.GetAllDiscounts(scholarshipCode)) { ScholarshipDiscount sc = new ScholarshipDiscount(); TranslateScholarshipDiscountBDOToScholarshipDiscount(sdbdo, sc); sDiscount.Add(sc); } return sDiscount; }
// Done public List<ScholarshipDiscount> GetAllScholarships() { List<ScholarshipDiscount> slist = new List<ScholarshipDiscount>(); foreach (ScholarshipDiscountBDO sbdo in sLogic.GetAllScholarships()) { ScholarshipDiscount s = new ScholarshipDiscount(); TranslateScholarshipBDOToScholarship(sbdo, s); slist.Add(s); } return slist; }
public void TranslateScholarshipToScholarshipBDO(ScholarshipDiscount s, ScholarshipDiscountBDO sBDO) { //sBDO.ScholarshipCode = s.ScholarshipCode; //sBDO.Condition = s.Condition; sBDO.Deactivated = s.Deactivated; sBDO.Description = s.Description; // sBDO.Privilege = s.Privilege; }
private void TranslateScholarshipBDOToScholarship(ScholarshipDiscountBDO sc, ScholarshipDiscount sbdo) { sbdo.ScholarshipDiscountId = sc.ScholarshipDiscountId; sbdo.Scholarship = sc.Scholarship; sbdo.Discount = sc.Discount; sbdo.Deactivated = sc.Deactivated; sbdo.Description = sc.Description; }
// Done public bool UpdateScholarshipDiscount(ref ScholarshipDiscount scholarshipDiscount, ref string message) { ScholarshipDiscountBDO sdBDO = new ScholarshipDiscountBDO(); TranslateScholarshipDiscountToScholarshipDiscountBDO(scholarshipDiscount, sdBDO); return sLogic.UpdateScholarshipDiscount(ref sdBDO, ref message); }
public bool AddScholarshipDiscount(ref ScholarshipDiscount scholarshipDiscount, int scholarshipCode, ref string message) { ScholarshipDiscountBDO sdbdo = new ScholarshipDiscountBDO(); TranslateScholarshipDiscountToScholarshipDiscountBDO(scholarshipDiscount, sdbdo); return sLogic.AddScholarshipDiscount(sdbdo, scholarshipCode, ref message); }
public bool CreateScholarship(ref ScholarshipDiscount scholarship, ref string message) { ScholarshipDiscountBDO sbdo = new ScholarshipDiscountBDO(); TranslateScholarshipToScholarshipBDO(scholarship, sbdo); return sLogic.CreateScholarship(ref sbdo, ref message); }
private void TranslateScholarshipDiscountBDOToScholarshipDiscount(ScholarshipDiscountBDO sc, ScholarshipDiscount sbdo) { sbdo.Deactivated = sc.Deactivated; sbdo.Discount = sc.Discount; sbdo.ScholarshipDiscountId = sc.ScholarshipDiscountId; }
public List<ScholarshipDiscount> ToScholarhsipDiscountList(List<ScholarshipDiscountBDO> sdbdo) { List<ScholarshipDiscount> scholarshipDiscounts = new List<ScholarshipDiscount>(); foreach (ScholarshipDiscountBDO SD in sdbdo) { ScholarshipDiscount s = new ScholarshipDiscount(); TranslateScholarshipDiscountBDOToScholarshipDiscount(SD, s); scholarshipDiscounts.Add(s); } return scholarshipDiscounts; }
private void TranslateScholarshipDiscountToScholarshipDiscountBDO(ScholarshipDiscount sc, ScholarshipDiscountBDO sbdo) { //FeeService fs = new FeeService(); //Fee f = new Fee(); //f = fs.GetFee(sc.FeeID); sbdo.Deactivated = sc.Deactivated; sbdo.Discount = (float)sc.Discount; sbdo.ScholarshipDiscountId = sc.ScholarshipDiscountId; //sbdo.Fee = f; }
private void AssessStudent_Load(object sender, EventArgs e) { IRegistrationService registrationService = new RegistrationService(); List<Fee> fees = new List<Fee>(); IScholarshipService scholarshipService = new ScholarshipService(); List<ScholarshipDiscount> scholarships = new List<ScholarshipDiscount>(); currentSY = registrationService.GetCurrentSY(); StudentAssessed = registrationService.GetStudentEnrolled(StudentId, currentSY.SY); txtGradeLevel.Text = StudentAssessed.GradeLevel; txtIDnum.Text = StudentAssessed.StudentId; txtName.Text = StudentAssessed.StudentName; txtSY.Text = currentSY.SY; lblSectionVal.Text = StudentAssessed.student.Section; fees = new List<Fee>(registrationService.GetStudentFees(StudentAssessed)); gvAssessment.DataSource = fees; fees.ToArray(); scholarships = new List<ScholarshipDiscount>(registrationService.GetScholarshipDiscounts()); int scholarshipDiscountId = StudentAssessed.DiscountId; ScholarshipDiscount sd = new ScholarshipDiscount(); sd = scholarships.Find(v => v.ScholarshipDiscountId == scholarshipDiscountId); fees[0].Amount = fees[0].Amount ?? 0; amountTuition = (double)fees[0].Amount; if (fees.Count > 1) { fees[1].Amount = fees[1].Amount ?? 0; enrollment = (double)fees[1].Amount; } // Read Only TextBox tuitionFee.ReadOnly = true; discountPercent.ReadOnly = true; totalLessDiscount.ReadOnly = true; enrollmentFee.ReadOnly = true; enrTotalTuitionFee.ReadOnly = true; subTotal.ReadOnly = true; discountbyAmountSubTotal.ReadOnly = true; //Total.ReadOnly = true; // Total Tuition Fee tuitionFee.Text = amountTuition.ToString("0.###"); // Percent Discount double perc = 0; double percRound = 0; double percInitial = 0; if (double.TryParse(fullPaymentDisc.Text, out fullPaymentDiscPar)) ; perc = (double)sd.Discount; if (sd.Discount == null) { discountPercent.Enabled = false; } else { discountPercent.Text = perc.ToString("0.##"); percRound = perc / 100; percInitial = amountTuition * percRound; percValue = amountTuition - percInitial; totalLessDisc = percValue; finalPercentDisc = totalLessDisc - fullPaymentDiscPar; } if (perc == 100) { fullPaymentDisc.ReadOnly = true; } /* Operations */ // Operation for Percent Discount if not null //Total Less Discount totalLessDiscount.Text = totalLessDisc.ToString("0.##"); // Enrollment Fee enrollmentFee.Text = enrollment.ToString(); // Total Tuition Fee enrTotalTuitionFee.Text = finalPercentDisc.ToString("0.##"); // Sub Total subTotalValue = enrollment + finalPercentDisc; subTotal.Text = subTotalValue.ToString("0.##"); // Sub Total discountbyAmountSubTotal.Text = subTotalValue.ToString("0.##"); listStudentAssessed = registrationService.GetStudentAssessment(StudentId, currentSY.SY); }
private void gvScholarship_SelectionChanged(object sender, EventArgs e) { int selectedIndex = gvScholarship.CurrentRow.Index; if (selectedIndex >= 0) { string sID = gvScholarship.Rows[selectedIndex].Cells["ScholarshipCode"].Value.ToString(); List<ScholarshipDiscount> item = new List<ScholarshipDiscount>(); item = scholarshipList.FindAll(x => x.ScholarshipDiscountId.ToString() == sID); scholarshipSelected = new ScholarshipDiscount(); scholarshipSelected = (ScholarshipDiscount)item[0]; } }
private void Save() { IScholarshipService sService = new ScholarshipService(); Boolean ret = false; string message = String.Empty; ScholarshipDiscount scholarship = new ScholarshipDiscount(); if (Op.Equals("edit")) ret = sService.UpdateScholarship(ref scholarship, ref message); else ret = sService.CreateScholarship(ref scholarship, ref message); if (ret) MessageBox.Show("Saved Successfully"); else MessageBox.Show("Error Saving"); if (Op.Equals("edit")) Close(); if (Op.Equals("new")) { Op = "edit"; txtScholarshipCode.Enabled = false; gvScholarshipDetails.Enabled = true; } this.Close(); }
public void gvScholarshipDiscounts_ValueChanging(object sender, ValueChangingEventArgs e) { if (gvScholarshipDetails.CurrentRow.Index >= 0) { sDiscountSelected = new ScholarshipDiscount() { ScholarshipDiscountId = scholarshipDiscountList[gvScholarshipDetails.CurrentRow.Index].ScholarshipDiscountId, Discount = scholarshipDiscountList[gvScholarshipDetails.CurrentRow.Index].Discount, Deactivated = false, }; oldScholarshipDiscountList.Add(sDiscountSelected); } }