public void TranslateGradeLevelToGradeLevelBDO(GradeLevel gl, GradeLevelBDO g) { FeeService fs = new FeeService(); TraitService ts = new TraitService(); g.Description = gl.Description; g.GradeLev = gl.GradeLev; g.Category = gl.Category; g.StudentFees = fs.ToFeeBDOList(gl.StudentFees); // g.Traits = ts.ToTraitBDOList(gl.Traits); }
public void ControlStudentCharacters(StudentEnrollmentBDO student) { int cat = GetCategory(student.GradeLevel); Boolean ret = false; TraitService trait = new TraitService(); List <Trait> traitlist = new List <Trait>(); traitlist = trait.GetAllTraitsOfCategory(cat); foreach (Trait t in traitlist) { StudentTrait st = new StudentTrait { StudentSY = student.StudentSY, TraitsID = t.TraitsID, StudentEnrTraitCode = student.StudentSY + t.TraitsID, LockFirst = false, LockSecond = false, LockFourth = false, LockThird = false }; if (student.GradeSectionCode != null) { st.GradeSectionCode = (int)student.GradeSectionCode; } string message = string.Empty; StudentTraitBDO stb = new StudentTraitBDO(); TranslateStuTraitsToStuTraitsBDO(st, stb); ret = stl.AddStudentCharacters(stb, ref message); } }
public void TranslateGradeLevelToGradeLevelBDO(GradeLevel gl, GradeLevelBDO g) { FeeService fs = new FeeService(); TraitService ts = new TraitService(); g.Description = gl.Description; g.GradeLev = gl.GradeLev; g.Category = gl.Category; g.StudentFees = fs.ToFeeBDOList(gl.StudentFees); // g.Traits = ts.ToTraitBDOList(gl.Traits); }
private void LoadMe() { var list = new[] { new { Number = 1, Name = "Pre-school" }, new { Number = 2, Name = "Elementary" }, new { Number = 3, Name = "Secondary" } }; cmbCategory.DataSource = list; cmbCategory.ValueMember = "Number"; cmbCategory.DisplayMember = "Name"; txtDescription.Text = String.Empty; chkCurrent.Checked = true; ITraitService traitService = new TraitService(); ExistingTraits = new List<Trait>(traitService.GetAllTraits()); }
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 LoadTraits() { ITraitService traitService = new TraitService(); string message = String.Empty; try { var traits = traitService.GetAllTraits(); traitList = new List<Trait>(traits); gvTraits.DataSource = traitList; gvTraits.Refresh(); if (gvTraits.RowCount != 0) gvTraits.Rows[0].IsSelected = true; } catch (Exception ex) { message = "Error Loading Traits List"; MessageBox.Show(ex.ToString()); } }
public void ControlStudentCharacters(StudentEnrollmentBDO student) { int cat = GetCategory(student.GradeLevel); Boolean ret = false; TraitService trait = new TraitService(); List<Trait> traitlist = new List<Trait>(); traitlist = trait.GetAllTraitsOfCategory(cat); foreach (Trait t in traitlist) { StudentTrait st = new StudentTrait { StudentSY = student.StudentSY, TraitsID = t.TraitsID, StudentEnrTraitCode = student.StudentSY + t.TraitsID, LockFirst = false, LockSecond = false, LockFourth = false, LockThird = false }; if (student.GradeSectionCode != null) st.GradeSectionCode = (int)student.GradeSectionCode; string message = string.Empty; StudentTraitBDO stb = new StudentTraitBDO(); TranslateStuTraitsToStuTraitsBDO(st, stb); ret = stl.AddStudentCharacters(stb, ref message); } }