private void ScheduleSelector_Load(object sender, EventArgs e) { Sy = GlobalClass.currentsy; IRegistrationService regService = new RegistrationService(); Schedules=new List<StudentSchedule>(regService.GetSubjectSchedules(Sy)); gvSchedule.DataSource = Schedules; }
private void loadList() { IRegistrationService regService = new RegistrationService(); stEnrolled = new List<StudentEnrollment>(regService.GetCurrentStudents(sY)); gridView.DataSource = stEnrolled; switch (groupedBy) { case "Religion": GroupDescriptor descriptor2 = new GroupDescriptor(); descriptor2.GroupNames.Add("Religion", ListSortDirection.Ascending); this.gridView.GroupDescriptors.Add(descriptor2); break; case "Grade Level": GroupDescriptor descriptor4 = new GroupDescriptor(); descriptor4.GroupNames.Add("GradeLevel", ListSortDirection.Ascending); this.gridView.GroupDescriptors.Add(descriptor4); break; case "Section": GroupDescriptor descriptor5 = new GroupDescriptor(); descriptor5.GroupNames.Add("GradeLevel", ListSortDirection.Ascending); GroupDescriptor descriptor6 = new GroupDescriptor(); descriptor6.GroupNames.Add("Section", ListSortDirection.Ascending); this.gridView.GroupDescriptors.Add(descriptor5); this.gridView.GroupDescriptors.Add(descriptor6); break; case "Gender": GroupDescriptor descriptor3 = new GroupDescriptor(); descriptor3.GroupNames.Add("Gender", ListSortDirection.Ascending); this.gridView.GroupDescriptors.Add(descriptor3); break; } }
private void frmControlSubjects_Load(object sender, EventArgs e) { IRegistrationService registrationService = new RegistrationService(); string message = String.Empty; ControlStudent = registrationService.GetStudent(controlStudentId,ref message); StudentEnrollment enrStudent = new StudentEnrollment(); SY = GlobalClass.currentsy; enrStudent = registrationService.GetStudentEnrolled(controlStudentId,SY); ISubjectAssignmentService schedService = new SubjectAssignmentService(); sections = new List<GradeSection>(schedService.GetAllSections()); List<GradeSection> gs = new List<GradeSection>(); gs = sections.FindAll(s => s.GradeLevel == ControlStudent.GradeLevel); // cbSection.DataSource = gs; int index = gs.FindIndex(s => s.Section == ControlStudent.Section); gradeSectionCode = gs[index].GradeSectionCode; loadSched(); txtSection.Text = ControlStudent.Section; // cbSection.Text = ControlStudent.Section; txtSY.Text = SY; txtGradeLevel.Text = ControlStudent.GradeLevel; txtStudentId.Text = ControlStudent.StudentId; txtStudentName.Text = ControlStudent.LastName + "," + ControlStudent.FirstName + " " + ControlStudent.MiddleName; txtPrevGPA.Text = ControlStudent.Average.ToString(); txtUnitsFailed.Text = ControlStudent.UnitsFailedLastYear.ToString(); }
public void TranslateStudentSubjectBDOToStudentSubject(StudentSubjectBDO ssbdo, StudentSubject ss) { SubjectService s = new SubjectService(); Subject sub = new Subject(); s.TranslateSubjectBDOToSubject(ssbdo.Subject, sub); RegistrationService r = new RegistrationService(); StudentEnrollment se = new StudentEnrollment(); r.TranslatEnrolBDOToEnrol(ssbdo.StudentEnrollment, se); ss.StudentEnr = se; ss.Description = sub.Description; ss.FirstPeriodicRating = ssbdo.FirstPeriodicRating; ss.SecondPeriodicRating = ssbdo.SecondPeriodicRating; ss.ThirdPeriodicRating = ssbdo.ThirdPeriodicRating; ss.FourthPeriodicRating = ssbdo.FourthPeriodicRating; ss.FirstEntered = ssbdo.FirstEntered; ss.SecondEntered = ssbdo.SecondEntered; ss.ThirdEntered = ssbdo.ThirdEntered; ss.FourthEntered = ssbdo.FourthEntered; ss.LockFirst = (bool)ssbdo.LockFirst; ss.LockFourth = (bool)ssbdo.LockFourth; ss.LockSecond = (bool)ssbdo.LockSecond; ss.LockThird = (bool)ssbdo.LockThird; ss.FirstLocked = ssbdo.FirstLocked; ss.SecondLocked = ssbdo.SecondLocked; ss.ThirdLocked = ssbdo.ThirdLocked; ss.FourthLocked = ssbdo.FourthLocked; ss.Remarks = ssbdo.Remarks; ss.StudentEnrSubCode = ssbdo.StudentEnrSubCode; ss.StudentEnrSubCode = ssbdo.StudentEnrSubCode; ss.StudentSubjectsID = ssbdo.StudentSubjectsID; ss.StudentSY = ssbdo.StudentSY; ss.SubjectCode = ssbdo.SubjectCode; ss.StudentId = se.StudentId; ss.StudentName = se.StudentName; }
private void Save() { IRegistrationService regService = new RegistrationService(); ITraitService traitService = new TraitService(); Boolean ret = false; string message = String.Empty; Trait trait = new Trait() { Description = txtDescription.Text.ToString(), CurrTrait = chkCurrent.Checked, Category = Int32.Parse(cmbCategory.SelectedValue.ToString()) }; if (ExistingTraits.Exists(t => t.Category == trait.Category && t.Description == trait.Description && t.CurrTrait==trait.CurrTrait)) { MessageBox.Show(this, "Trait for that Category already Exists", "Trait Exists"); } else { if (Op.Equals("edit")) { trait.TraitsID = SelectedTrait.TraitsID; ret = traitService.UpdateTrait(ref trait, ref message); } else { ret = traitService.CreateTrait(ref trait, ref message); if (ret && trait.CurrTrait) { List<Trait> updatedTraits = new List<Trait>(traitService.GetAllTraits()); Trait savedTrait = new Trait(); savedTrait = updatedTraits.Find(t => t.Category == trait.Category && t.Description == trait.Description && t.CurrTrait == trait.CurrTrait); ret = regService.UpdateStudentCharacters(savedTrait); } } if (ret) MessageBox.Show(this, "Saved Successfully"); } this.Close(); }
public void TranslateStudentTraitBDOToStudentTrait(StudentTraitBDO stb, StudentTrait st) { st.Description = stb.Trait.Description; st.FirstEntered = stb.FirstEntered; st.FirstLocked = stb.FirstLocked; st.FirstPeriodicRating = stb.FirstPeriodicRating; st.FourthEntered = stb.FourthEntered; st.FourthLocked = stb.FourthLocked; st.FourthPeriodicRating = stb.FourthPeriodicRating; st.GradeLevel = stb.GradeSection.GradeLevel; st.GradeSectionCode = (int)stb.GradeSectionCode; st.LockFirst = stb.LockFirst; st.LockFourth = stb.LockCFourth; st.LockSecond = stb.LockSecond; st.LockThird = stb.LockThird; st.SecondEntered = stb.SecondEntered; st.SecondLocked = stb.SecondLocked; st.SecondPeriodicRating = stb.SecondPeriodicRating; st.Section = stb.GradeSection.Section; RegistrationService r = new RegistrationService(); StudentEnrollment se = new StudentEnrollment(); r.TranslatEnrolBDOToEnrol(stb.StudentEnrollment, se); st.StudentEnr = se; st.StudentEnrTraitCode = stb.StudentEnrTraitCode; st.StudentId = se.StudentId; st.StudentName = se.StudentName; st.StudentSY = stb.StudentSY; st.TeacherId = stb.GradeSection.HomeRoomTeacherId; st.TeacherName = stb.GradeSection.HomeRoomTeacher.LastName + "," + stb.GradeSection.HomeRoomTeacher.FirstName; st.ThirdEntered = stb.ThirdEntered; st.ThirdLocked = stb.ThirdLocked; st.ThirdPeriodicRating = stb.ThirdPeriodicRating; st.TraitsID = stb.TraitsID; }
public void TranslateStudentTraitBDOToStudentTrait(StudentTraitBDO stb, StudentTrait st) { st.Description = stb.Trait.Description; st.FirstEntered = stb.FirstEntered; st.FirstLocked = stb.FirstLocked; st.FirstPeriodicRating = stb.FirstPeriodicRating; st.FourthEntered = stb.FourthEntered; st.FourthLocked = stb.FourthLocked; st.FourthPeriodicRating = stb.FourthPeriodicRating; st.GradeLevel = stb.GradeSection.GradeLevel; st.GradeSectionCode = (int)stb.GradeSectionCode; st.LockFirst = stb.LockFirst; st.LockFourth = stb.LockCFourth; st.LockSecond = stb.LockSecond; st.LockThird = stb.LockThird; st.SecondEntered = stb.SecondEntered; st.SecondLocked = stb.SecondLocked; st.SecondPeriodicRating = stb.SecondPeriodicRating; st.Section = stb.GradeSection.Section; RegistrationService r = new RegistrationService(); StudentEnrollment se = new StudentEnrollment(); r.TranslatEnrolBDOToEnrol(stb.StudentEnrollment, se); st.StudentEnr = se; st.StudentEnrTraitCode = stb.StudentEnrTraitCode; st.StudentId = se.StudentId; st.StudentName = se.StudentName; st.StudentSY = stb.StudentSY; st.TeacherId = stb.GradeSection.HomeRoomTeacherId; st.TeacherName = stb.GradeSection.HomeRoomTeacher.LastName + "," + stb.GradeSection.HomeRoomTeacher.FirstName; st.ThirdEntered = stb.ThirdEntered; st.ThirdLocked = stb.ThirdLocked; st.ThirdPeriodicRating = stb.ThirdPeriodicRating; st.TraitsID = stb.TraitsID; }
public void TranslateStudentSubjectBDOToStudentSubject(StudentSubjectBDO ssbdo, StudentSubject ss) { SubjectService s = new SubjectService(); Subject sub = new Subject(); s.TranslateSubjectBDOToSubject(ssbdo.Subject, sub); RegistrationService r = new RegistrationService(); StudentEnrollment se = new StudentEnrollment(); r.TranslatEnrolBDOToEnrol(ssbdo.StudentEnrollment, se); ss.StudentEnr = se; ss.Description = sub.Description; ss.FirstPeriodicRating = ssbdo.FirstPeriodicRating; ss.SecondPeriodicRating = ssbdo.SecondPeriodicRating; ss.ThirdPeriodicRating = ssbdo.ThirdPeriodicRating; ss.FourthPeriodicRating = ssbdo.FourthPeriodicRating; ss.FirstEntered = ssbdo.FirstEntered; ss.SecondEntered = ssbdo.SecondEntered; ss.ThirdEntered = ssbdo.ThirdEntered; ss.FourthEntered = ssbdo.FourthEntered; ss.LockFirst = (bool)ssbdo.LockFirst; ss.LockFourth = (bool)ssbdo.LockFourth; ss.LockSecond = (bool)ssbdo.LockSecond; ss.LockThird = (bool)ssbdo.LockThird; ss.FirstLocked = ssbdo.FirstLocked; ss.SecondLocked = ssbdo.SecondLocked; ss.ThirdLocked = ssbdo.ThirdLocked; ss.FourthLocked = ssbdo.FourthLocked; ss.Remarks = ssbdo.Remarks; ss.StudentEnrSubCode = ssbdo.StudentEnrSubCode; ss.StudentEnrSubCode = ssbdo.StudentEnrSubCode; ss.StudentSubjectsID = ssbdo.StudentSubjectsID; ss.StudentSY = ssbdo.StudentSY; ss.SubjectCode = ssbdo.SubjectCode; ss.StudentId = se.StudentId; ss.StudentName = se.StudentName; }
private void btnSave_Click(object sender, EventArgs e) { if (sectionsForGradeLevel.Count > 0) { IRegistrationService registrationService = new RegistrationService(); EnrolMe.StudentSY = RegisterStudent.StudentId + SY; EnrolMe.StudentId = RegisterStudent.StudentId; EnrolMe.SY = SY; EnrolMe.GradeLevel = GradeLevel; EnrolMe.Dismissed = false; if (!String.IsNullOrEmpty(cmbScholarship.SelectedValue.ToString())) { EnrolMe.DiscountId = Int32.Parse(cmbScholarship.SelectedValue.ToString()); } EnrolMe.Rank = (int)RegisterStudent.ranking; //EnrolMe.GradeSectionCode= if (EnrolMe.Stat.Equals("b") || EnrolMe.Stat.Equals("c")) { if (registrationService.EnrolStudent(EnrolMe)) { Log("C", "StudentEnrolments", EnrolMe); Log("U", "Students", EnrolMe); Log("C", "StudentTraits", EnrolMe); MessageBox.Show(this, "Student Successfully Registered."); //frmControlSubjects fmControlSubjects = new frmControlSubjects(); //fmControlSubjects.controlStudentId = RegisterStudent.StudentId; // fmControlSubjects.changed = false; // fmControlSubjects.ShowDialog(this); } else { MessageBox.Show(this, "Student Registration Failed."); } } else { if (registrationService.EnrolStudent(EnrolMe)) { Log("C", "StudentEnrolments", EnrolMe); Log("U", "Students", EnrolMe); Log("C", "StudentTraits", EnrolMe); MessageBox.Show(this, "Student Successfully Registered."); // frmControlSubjects fmControlSubjects = new frmControlSubjects(); //fmControlSubjects.controlStudentId = RegisterStudent.StudentId; // fmControlSubjects.changed = false; // fmControlSubjects.ShowDialog(this); } else MessageBox.Show(this, "Student Registration Failed."); } } else MessageBox.Show(this, "Student Registration Failed: No sections for GradeLevel " + GradeLevel); this.Close(); }
private void frmStudentRegister_Load(object sender, EventArgs e) { IRegistrationService registrationService = new RegistrationService(); IGradeSectionService gsService = new GradeSectionService(); if (String.IsNullOrEmpty(RegisterStudent.GradeLevel)) { chkRetain.Checked = false; chkPromote.Checked = true; chkIrreg.Checked = false; Promote(); EnrolMe.Stat = "a"; } else { RegisterStudent =registrationService.StudentInfoWithRank(StudentId,GradeLevel,Gender); decimal cri = 3.50M; if (RegisterStudent.UnitsFailedLastYear.CompareTo(0.0M) == 0) { chkRetain.Checked = false; chkPromote.Checked = true; chkIrreg.Checked = false; Promote(); EnrolMe.Stat = "a"; } else if (RegisterStudent.UnitsFailedLastYear.CompareTo(cri) > 0) { chkRetain.Checked = true; chkPromote.Checked = false; chkIrreg.Checked = false; EnrolMe.Stat = "c"; GradeLevel = RegisterStudent.GradeLevel; } else if (RegisterStudent.UnitsFailedLastYear.CompareTo(cri) <= 0) { chkRetain.Checked = false; chkPromote.Checked = false; chkIrreg.Checked = true; Promote(); EnrolMe.Stat = "b"; } } SY = GlobalClass.currentsy; Discounts = new List<ScholarshipDiscount>(registrationService.GetScholarshipDiscounts()); txtSY.Text = SY; txtStudentId.Text = RegisterStudent.StudentId; txtName.Text = RegisterStudent.LastName + "," + RegisterStudent.FirstName + " " + RegisterStudent.MiddleName; txtGpa.Text = RegisterStudent.Average.ToString(); txtFailed.Text = RegisterStudent.UnitsFailedLastYear.ToString(); txtranking.Text = RegisterStudent.ranking.ToString(); txtPrevGradeLevel.Text = RegisterStudent.GradeLevel; cmbScholarship.DataSource = Discounts; cmbScholarship.ValueMember = "ScholarshipDiscountId"; cmbScholarship.DisplayMember = "Scholarship"; cmbScholarship.SelectedValue = RegisterStudent.ScholarshipDiscountId; sectionsForGradeLevel = gsService.GetAllSectionsForGrade(GradeLevel); }
private void cbSection_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e) { if (changed) { IRegistrationService registrationService = new RegistrationService(); int index = cbSection.SelectedIndex; GradeSection s = sections[index]; registrationService.DeleteExistingSubjects(ControlStudent.StudentId + SY); registrationService.UpdateStudentSection(ControlStudent.StudentId + SY, s.GradeSectionCode, s.Section); Schedule = registrationService.GetSubjectsOfSection(s.GradeSectionCode, SY); subjects.Clear(); foreach (StudentSchedule sch in Schedule) { StudentSubject ss = new StudentSubject() { StudentSY = controlStudentId + SY, SubjectCode = sch.SubjectCode, SubjectAssignments = sch.SubjectAssignments, StudentEnrSubCode = controlStudentId + SY + sch.SubjectCode, LockFirst = false, LockSecond = false, LockThird = false, LockFourth = false, FirstPeriodicRating = 0.00, SecondPeriodicRating = 0.00, ThirdPeriodicRating = 0.00, FourthPeriodicRating = 0.00 }; subjects.Add(ss); } ControlSchedule = Schedule; GlobalClass.gvDatasource = 1; gvSchedule.DataSource = ControlSchedule; gvSchedule.ReadOnly = false; } }
private void btnSave_Click(object sender, EventArgs e) { IRegistrationService registrationService = new RegistrationService(); ILogService logService = new LogService(); if (ExistingSchedRemove.Count > 0) { if (registrationService.DeleteLoadedSubjects(controlStudentId, SY, ExistingSchedRemove)) { foreach (StudentSubject ss in ExistingSchedRemove) { string json = JsonConvert.SerializeObject(ss); Log log = new Log { CLUD = "D", LogDate = DateTime.Now, TableName = "StudentSubject", UserId = GlobalClass.user.UserId, UserName = GlobalClass.user.UserName, PassedData = json }; logService.AddLogs(log); } MessageBox.Show(this, "Adding Student Subjects Successful ."); Close(); } else { MessageBox.Show(this, "Student Subjects Adding Failed."); Close(); } } if (subjects.Count > 0) { if (registrationService.ControlSubjects(controlStudentId, SY, subjects)) { foreach (StudentSubject ss in subjects) { string json = JsonConvert.SerializeObject(ss); Log log = new Log { CLUD = "C", LogDate = DateTime.Now, TableName = "StudentSubject", UserId = GlobalClass.user.UserId, UserName = GlobalClass.user.UserName, PassedData = json }; logService.AddLogs(log); } MessageBox.Show(this, "Adding Student Subjects Successful ."); Close(); } else { MessageBox.Show(this, "Student Subjects Adding Failed."); Close(); } } }
public void TranslateStuSubjectsBDOToStuSubjects(StudentSubjectBDO sbdo, StudentSubject s) { SubjectService ss = new SubjectService(); Subject sub = new Subject(); ss.TranslateSubjectBDOToSubject(sbdo.Subject, sub); s.SubjectCode = sbdo.SubjectCode; s.Description = sub.Description; RegistrationService rs = new RegistrationService(); StudentEnrollment se = new StudentEnrollment(); rs.TranslatEnrolBDOToEnrol(sbdo.StudentEnrollment, se); s.StudentEnr = se; s.StudentSY = sbdo.StudentSY; s.StudentId = se.StudentId; s.StudentName = se.StudentName; s.StudentSubjectsID = sbdo.StudentSubjectsID; s.StudentEnrSubCode = sbdo.StudentEnrSubCode; s.Remarks = sbdo.Remarks; s.FirstPeriodicRating = sbdo.FirstPeriodicRating; s.SecondPeriodicRating = sbdo.SecondPeriodicRating; s.ThirdPeriodicRating = sbdo.ThirdPeriodicRating; s.FourthPeriodicRating = sbdo.FourthPeriodicRating; s.Description = sub.Description; s.SubjectAssignments = sbdo.SubjectAssignments; s.FirstEntered = sbdo.FirstEntered; s.FirstLocked = sbdo.FirstLocked; s.FourthEntered = sbdo.FourthEntered; s.FourthLocked = sbdo.FourthLocked; s.LockFirst = sbdo.LockFirst; s.LockFourth = sbdo.LockFourth; s.LockSecond = sbdo.LockSecond; s.LockThird = sbdo.LockThird; s.SecondEntered = sbdo.SecondEntered; s.SecondLocked = sbdo.SecondLocked; s.ThirdEntered = sbdo.ThirdEntered; s.ThirdLocked = sbdo.ThirdLocked; s.FinalRating = (double)sbdo.FourthPeriodicRating; if (s.FinalRating > 90) { s.Proficiency = "O"; } else if (s.FinalRating >= 85) { s.Proficiency = "VS"; } else if (s.FinalRating >= 80) { s.Proficiency = "S"; } else if (s.FinalRating >= 75) { s.Proficiency = "FS"; } else if (s.FinalRating <= 74) { s.Proficiency = "D"; } }
public void TranslateStuSubjectsBDOToStuSubjects(StudentSubjectBDO sbdo, StudentSubject s) { SubjectService ss = new SubjectService(); Subject sub = new Subject(); ss.TranslateSubjectBDOToSubject(sbdo.Subject, sub); s.SubjectCode = sbdo.SubjectCode; s.Description = sub.Description; RegistrationService rs = new RegistrationService(); StudentEnrollment se = new StudentEnrollment(); rs.TranslatEnrolBDOToEnrol(sbdo.StudentEnrollment, se); s.StudentEnr = se; s.StudentSY = sbdo.StudentSY; s.StudentId = se.StudentId; s.StudentName = se.StudentName; s.StudentSubjectsID = sbdo.StudentSubjectsID; s.StudentEnrSubCode = sbdo.StudentEnrSubCode; s.Remarks = sbdo.Remarks; s.FirstPeriodicRating = sbdo.FirstPeriodicRating; s.SecondPeriodicRating = sbdo.SecondPeriodicRating; s.ThirdPeriodicRating = sbdo.ThirdPeriodicRating; s.FourthPeriodicRating = sbdo.FourthPeriodicRating; s.Description = sub.Description; s.SubjectAssignments = sbdo.SubjectAssignments; s.FirstEntered = sbdo.FirstEntered; s.FirstLocked = sbdo.FirstLocked; s.FourthEntered = sbdo.FourthEntered; s.FourthLocked = sbdo.FourthLocked; s.LockFirst = sbdo.LockFirst; s.LockFourth = sbdo.LockFourth; s.LockSecond = sbdo.LockSecond; s.LockThird = sbdo.LockThird; s.SecondEntered = sbdo.SecondEntered; s.SecondLocked = sbdo.SecondLocked; s.ThirdEntered = sbdo.ThirdEntered; s.ThirdLocked = sbdo.ThirdLocked; s.FinalRating = (double)sbdo.FourthPeriodicRating; if (s.FinalRating > 90) s.Proficiency = "O"; else if (s.FinalRating >= 85) s.Proficiency = "VS"; else if (s.FinalRating >= 80) s.Proficiency = "S"; else if (s.FinalRating >= 75) s.Proficiency = "FS"; else if (s.FinalRating <= 74) s.Proficiency = "D"; }
private void btnPrint_Click(object sender, EventArgs e) { calculate.Visible = false; IRegistrationService registrationService = new RegistrationService(); ILogService logService = new LogService(); var assessments = registrationService.AssessMe(StudentAssessed); if (assessments.Count > 0) { string json = JsonConvert.SerializeObject(StudentAssessed); Log log = new Log { CLUD = "C", LogDate = DateTime.Now, TableName = "StudentAssessment", UserId = GlobalClass.user.UserId, UserName = GlobalClass.user.UserName, PassedData = json }; logService.AddLogs(log); PrintPane(); if (listStudentAssessed.Count <= 0) registrationService.UpdateStudentBalance(StudentAssessed.StudentSY, StudentAssessed.StudentId, float.Parse(Total.Text)); calculate.Visible = true; labelVisibility(false); TuitionDet.Visible = true; } }
private void loadSched() { IRegistrationService registrationService = new RegistrationService(); string message = String.Empty; EnrolMe.StudentSY = controlStudentId + SY; int prev = Int32.Parse(SY.Substring(0, 4)); prev--; int sy = Int32.Parse(SY.Substring(5, 4)); sy--; string prevSY = prev.ToString() + "-" + sy.ToString(); string prevRecord = controlStudentId + prevSY; gvAllSchedules.DataSource = null; gvSchedule.DataSource = null; gvFail.DataSource = null; ExistingSchedRemove.Clear(); FailedSubjects = new List<StudentSubject>(registrationService.GetFailedSubjects(prevRecord)); StudentSubs = new List<StudentSubject>(registrationService.GetStudentSubjects(EnrolMe.StudentSY)); Schedules = new List<StudentSchedule>(registrationService.GetSubjectSchedules(SY)); if (StudentSubs.Count > 0) { ExistingSchedule = new List<StudentSchedule>(registrationService.GetStudentExistingSchedule(StudentSubs, SY)); } if (ExistingSchedule.Count > 0) { foreach (StudentSchedule ss in ExistingSchedule) { int index = Schedules.FindIndex(item => item.SubjectAssignments == ss.SubjectAssignments); Schedules.RemoveAt(index); } } gvFail.DataSource = FailedSubjects; gvAllSchedules.DataSource = Schedules; if (ControlStudent.UnitsFailedLastYear == 0 && StudentSubs.Count == 0) { // int sectionCode = (int)cbSection.SelectedValue; Schedule = new List<StudentSchedule>(registrationService.GetSubjectsOfSection(gradeSectionCode, SY)); foreach (StudentSchedule sch in Schedule) { StudentSubject ss = new StudentSubject() { StudentSY = controlStudentId + SY, SubjectCode = sch.SubjectCode, SubjectAssignments = sch.SubjectAssignments, StudentEnrSubCode = controlStudentId + SY + sch.SubjectCode, LockFirst = false, LockSecond = false, LockThird = false, LockFourth = false, FirstPeriodicRating = 0.00, SecondPeriodicRating = 0.00, ThirdPeriodicRating = 0.00, FourthPeriodicRating = 0.00 }; subjects.Add(ss); } ControlSchedule = Schedule; GlobalClass.gvDatasource = 1; gvSchedule.DataSource = ControlSchedule; gvSchedule.ReadOnly = false; } else if (StudentSubs.Count > 0) { GlobalClass.gvDatasource = 2; ControlSchedule = ExistingSchedule; gvAllSchedules.ReadOnly = false; gvSchedule.ReadOnly = false; gvSchedule.DataSource = ControlSchedule; } else if (ControlStudent.UnitsFailedLastYear > 0) { GlobalClass.gvDatasource = 3; gvAllSchedules.ReadOnly = false; gvSchedule.ReadOnly = false; } }
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 void LoadStudents() { IGradeLevelService glService = new GradeLevelService(); gradeLevel = new List<GradeLevel>(glService.GetAllGradeLevels()); if (gradeLevel.Count > 0) gradeLevel[0].Description = "None"; IGradeSectionService sectionService = new GradeSectionService(); sections = new List<GradeSection>(sectionService.GetAllGradeSections()); IRegistrationService registrationService = new RegistrationService(); RegisteredStudents= new List<string>(registrationService.GetEnrolledStudents(GlobalClass.currentsy)); IStudentService studentService = new StudentService(); string message = String.Empty; try { var students = studentService.GetAllStudents(); studentList = new List<Student>(students); gvStudent.DataSource = students; gvStudent.Refresh(); if (gvStudent.RowCount != 0) gvStudent.Rows[0].IsSelected = true; } catch (Exception ex) { message = "Error Loading Student List"; MessageBox.Show(ex.ToString()); } }