public Boolean UpdateSY(ref SchoolYear schoolyear, ref string message) { message = String.Empty; SchoolYearBDO syBDO = new SchoolYearBDO(); TranslateSYDTOToSYBDO(schoolyear, syBDO); return syLogic.UpdateSY(ref syBDO, ref message); }
public void LoadSY() { gvSY.DataSource = null; ISchoolYearService syService = new SchoolYearService(); string message = String.Empty; try { var sy = syService.GetAllSY(); SYList = new List<SchoolYear>(sy); gvSY.DataSource = SYList; gvSY.Refresh(); if (gvSY.RowCount != 0) gvSY.Rows[0].IsSelected = true; SYcurrent = SYList.Find(x => x.CurrentSY == true); } catch (Exception ex) { message = "Error Loading List of School Years"; MessageBox.Show(ex.ToString()); } }
public SchoolYear GetSY(string schoolyear) { SchoolYearBDO SYbdo = new SchoolYearBDO(); SYbdo = syLogic.GetSY(schoolyear); SchoolYear u = new SchoolYear(); TranslateSYBDOToSYDTO(SYbdo, u); return u; }
public List<SchoolYear> GetAllSY() { List<SchoolYearBDO> syBDOList = syLogic.GetAllSY(); List<SchoolYear> allSY = new List<SchoolYear>(); foreach (SchoolYearBDO syBDO in syBDOList) { SchoolYear sy = new SchoolYear(); TranslateSYBDOToSYDTO(syBDO, sy); allSY.Add(sy); } return allSY; }
private void TranslateSYBDOToSYDTO(SchoolYearBDO syBDO, SchoolYear schoolyear) { schoolyear.SY = syBDO.SY; schoolyear.CurrentSY = syBDO.CurrentSY; }
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 gvSY_SelectionChanged(object sender, EventArgs e) { if (gvSY.RowCount != 0 && gvSY.CurrentRow != null) { int selectedIndex = gvSY.CurrentRow.Index; if (selectedIndex >= 0) { string tCode = gvSY.Rows[selectedIndex].Cells["SY"].Value.ToString(); List<SchoolYear> item = new List<SchoolYear>(); item = SYList.FindAll(x => x.SY.ToString() == tCode); SYSelected = new SchoolYear(); SYSelected = (SchoolYear)item[0]; } } }
private void UpdateCurrentSY(string szSY, bool bSY) { try { Boolean ret = false; string message = String.Empty; ISchoolYearService syService = new SchoolYearService(); SchoolYear schoolyear = new SchoolYear() { SY = szSY, CurrentSY = bSY }; ret = syService.UpdateSY(ref schoolyear, ref message); schoolyear.CurrentSY = true; Log("U", "SchoolYear", schoolyear); } catch (Exception ex) { MessageBox.Show("Error: " + ex.ToString()); } }
private void SaveSY() { try { Boolean ret = false; string message = String.Empty; int SYto = 0; SYto = int.Parse(txtSY.Text) + 1; ISchoolYearService syService = new SchoolYearService(); SchoolYear schoolyear = new SchoolYear() { SY = txtSY.Text + "-" + SYto.ToString(), CurrentSY = false }; ret = syService.CreateSY(ref schoolyear, ref message); Log("C", "SchoolYear", schoolyear); MessageBox.Show("Saved Successfully!"); LoadSY(); } catch (Exception ex) { MessageBox.Show("Error: " + ex.ToString()); } }
public Boolean UpdateStudentCharacters(Trait tbdo) { SchoolYear sy = new SchoolYear(); sy = GetCurrentSY(); IGradeLevelService gradeLevelService = new GradeLevelService(); List<GradeLevel> gradeLevelList = new List<GradeLevel>(gradeLevelService.GetAllGradeLevels()); List<GradeLevel> gradeLevelCategory = new List<GradeLevel>(); gradeLevelCategory = gradeLevelList.FindAll(x => x.Category == tbdo.Category); Boolean ret = false; List<string> studentIDs = new List<string>(); foreach (GradeLevel gl in gradeLevelCategory) { studentIDs.AddRange(GetEnrolledStudentsforNewTraits(gl.GradeLev, sy.SY)); } foreach (string studentID in studentIDs) { StudentEnrollment se = new StudentEnrollment(); se = GetEnrolledStudent(studentID, sy.SY); StudentTrait st = new StudentTrait { StudentSY = se.StudentSY, TraitsID = tbdo.TraitsID, StudentEnrTraitCode = se.StudentSY + tbdo.TraitsID, GradeSectionCode = (int)se.GradeSectionCode, LockFirst = false, LockSecond = false, LockFourth = false, LockThird = false }; string message = string.Empty; StudentTraitBDO stb = new StudentTraitBDO(); NewTraitsTranslateStuTraitsToStuTraitsBDO(st, stb); ret = stl.AddStudentCharacters(stb, ref message); } return ret; }