public List <int> GetStudentClassToAdd() { List <int> studentsClassToAdd = new List <int>(); combPromotedText = combPromoted.Text; txtClassText = txtClass.Text; if (combPromotedText != "" || txtClassText != "") { List <StudentClassDo> studentsClass = studentClassRepository.GetAll(); foreach (var studClass in studentsClass) { var toAdd = true; if (combPromotedText != "" && !combPromotedText.Equals(studClass.Promoted)) { toAdd = false; } if (txtClassText != "" && !txtClassText.Equals(studClass.Name)) { toAdd = false; } if (toAdd) { studentsClassToAdd.Add(studClass.StudentId); } } } return(studentsClassToAdd); }
private void insertClass_Click(object sender, EventArgs e) { List <StudentClassDo> listClassStudents = studentClassRepository.GetAll(); StudentClassDo studentClass = listClassStudents.Last(); int studentClassId = studentClass.Id; StudentClassDo studentClassData = new StudentClassDo(); studentClassData.Id = ++studentClassId; studentClassData.Name = txtClassName.Text; studentClassData.Promoted = combPromoted.Text; studentClassData.StudentId = Int32.Parse(textStudentId.Text); studentClassRepository.Insert(studentClassData); MessageBox.Show("Done !"); }
private void label2_Click(object sender, EventArgs e) { studentClassRepository.GetAll(); }
public async Task <IEnumerable <StudentClass> > GetAll() { // return _mapper.Map<IEnumerable<StudentClassDTO>>(await _studentClassRepository.GetAll()); return(await _studentClassRepository.GetAll()); }