public IEnumerable <SelectStudentViewModel> Get()
        {
            List <SelectStudentViewModel> studentsViewModel = new List <SelectStudentViewModel>();
            StudentProvider Studprovider = new StudentProvider(GenericMethodHandler.GetConnectionString());
            var             students     = Studprovider.GetStudents();

            foreach (var student in students)
            {
                SelectStudentViewModel studentviewModel = new SelectStudentViewModel();

                studentviewModel.Id      = student.Id;
                studentviewModel.Name    = student.Name;
                studentviewModel.EmailId = student.EmailId;
                studentsViewModel.Add(studentviewModel);
            }
            return(studentsViewModel);
        }
예제 #2
0
        public void createNewSportsFestival(DateTime sportsFestivalDate, List <Int32> competitionIds)
        {
            List <Competition> competitions = new List <Competition>();

            foreach (int competitionId in competitionIds)
            {
                Competition competition = CompetitionProvider.getCompetitionById(competitionId);
                competitions.Add(competition);
            }

            int sportsFestivalId = SportsFestivalProvider.createSportsFestival(sportsFestivalDate, competitions);

            SportsFestival sportsFestival = SportsFestivalProvider.getSportsFestivalById(sportsFestivalId);
            List <Student> students       = StudentProvider.getAllActiveStudents();

            foreach (Student student in students)
            {
                SportsFestivalSubscriptionProvider.createSportsFestivalSubscription(
                    sportsFestival,
                    student
                    );
            }
        }
 public void storeNewStudent(
     string firstName,
     string lastName,
     DateTime birthday,
     char gender,
     string street,
     int zip,
     string city,
     Class selectedClass,
     bool isActive
     )
 {
     StudentProvider.createStudent(
         firstName,
         lastName,
         birthday,
         gender,
         street,
         zip,
         city,
         selectedClass,
         isActive
         );
 }
 public List <Student> getAllStudentsOrderedByAscendingLastName()
 {
     return(StudentProvider.getAllStudentsOrderedByAscendingLastName());
 }
예제 #5
0
 private void cbClass_SelectionChangeCommitted(object sender, EventArgs e)
 {
     cbStudent.DataSource   = StudentProvider.getAllStudentsByClassId((int)cbClass.SelectedValue);
     cbStudent.SelectedItem = null;
 }