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 List <ScholarshipDiscount> GetScholarshipDiscounts() { ScholarshipService ss = new ScholarshipService(); List <ScholarshipDiscount> slist = new List <ScholarshipDiscount>(); slist = ss.GetAllScholarships(); return(slist); }
public int GetScholarshipDiscountId(string scho) { ScholarshipService ss = new ScholarshipService(); List <ScholarshipDiscount> slist = ss.GetAllScholarships(); int i = slist.FindIndex(s => s.Description.Equals(scho)); return(slist[i].ScholarshipDiscountId); }
private void frmScholarshipDiscount_Load(object sender, EventArgs e) { if (Op.Equals("newScholarshipDiscount")) { txtCode.Text = scholarshipCode.ToString(); txtCode.Enabled = false; IScholarshipService fSC = new ScholarshipService(); cmbFee.ValueMember = "FeeID"; cmbFee.DisplayMember = "FeeDescription"; } }
public void LoadScholarships() { IScholarshipService scholarshipService = new ScholarshipService(); string message = String.Empty; try { var scholarships = scholarshipService.GetAllScholarships(); scholarshipList = new List<ScholarshipDiscount>(scholarships); gvScholarship.DataSource = scholarships; gvScholarship.Refresh(); if (gvScholarship.RowCount != 0) gvScholarship.Rows[0].IsSelected = true; } catch (Exception ex) { message = "Error Loading Scholarship List"; MessageBox.Show(ex.ToString()); } }
public int GetScholarshipDiscountId(string scho) { ScholarshipService ss = new ScholarshipService(); List<ScholarshipDiscount> slist = ss.GetAllScholarships(); int i = slist.FindIndex(s => s.Description.Equals(scho)); return slist[i].ScholarshipDiscountId; }
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); }
public List<ScholarshipDiscount> GetScholarshipDiscounts() { ScholarshipService ss = new ScholarshipService(); List<ScholarshipDiscount> slist = new List<ScholarshipDiscount>(); slist = ss.GetAllScholarships(); return slist; }
private void fmScholarship_Load(object sender, EventArgs e) { IScholarshipService sService = new ScholarshipService(); colFee = new GridViewComboBoxColumn("Fee"); colFee.HeaderText = "Fee"; colFee.FieldName = "FeeID"; colFee.ValueMember = "FeeID"; colFee.DisplayMember = "FeeDescription"; colFee.Width = 180; gvScholarshipDetails.Columns.Add(colFee); if (Op.Equals("edit")) { SetField(); SetScholarshipDiscountGrid(); } if (Op.Equals("new")) { BindScholarshipDiscountGrid(); gvScholarshipDetails.Enabled = false; } }