private void FillStudent() { firstNameStudent.ForEach(firstName => { var index = firstNameStudent.IndexOf(firstName); student tmpStud = new student { salutation = salutationStudent[index], firstName = firstName, lastName = lastNameStudent[index], email = emailStudent[index], matricelNumber = matricelnumberStudent[index], studyCourse = studyCourseStudent[index], semester = semesterStudent[index] }; studDbSet.AddOne(tmpStud); if (index % 2 == 0) { studDbSet.AddStudToLab(tmpStud, labsDbset.GetById(1)); Console.WriteLine($"fill stud {tmpStud.firstName} and add them to lab {labsDbset.GetById(1).labID}"); } else { studDbSet.AddStudToLab(tmpStud, labsDbset.GetById(2)); Console.WriteLine($"fill stud {tmpStud.firstName} and add them to lab {labsDbset.GetById(2).labID}"); } }); Console.WriteLine("- - - - - - - Finished - - - - -"); }
private void FillPresent() { List <student> studentList = studDbSet.GetAll(); List <labdate> studsLabdatesOfLab = new List <labdate>(); List <labdate> dates = labdatesDbSet.GetAll(); studentList.ForEach(student => { var index = studentList.IndexOf(student); labsDbset.GetLabsOfStudent(student.studentID).ForEach(lab => { studsLabdatesOfLab = dates.Where(l => l.lab_labID == lab.labID).ToList(); }); foreach (var i in studsLabdatesOfLab) { present pre = new present { labdate_labdateID = i.labdateID, student_studentID = studentList[index].studentID, note = "war hier", wasPresent = 0 }; presentDbSet.AddOne(pre); Console.WriteLine($"student {studentList[index].firstName} has Labdate {i.date}"); } }); Console.WriteLine("- - - - - - - Finished - - - - -"); }
private void FillCourse() { courseNames.ForEach(courseName => { course newCourse = new course { name = courseName, semester = semester[courseNames.IndexOf(courseName)] }; courseDbSet.AddOne(newCourse); }); }
private void FillCourse() { courseNames.ForEach(courseName => { course newCourse = new course { name = courseName, semester = semester[courseNames.IndexOf(courseName)] }; courseDbSet.AddOne(newCourse); Console.WriteLine($"fill course {newCourse.name}"); }); Console.WriteLine("- - - - - - - Finished - - - - -"); }
private void FillLecturer() { firstNameLecturer.ForEach(firstname => { lecturer tmplec = new lecturer { salutation = salutationLecturer[firstNameLecturer.IndexOf(firstname)], firstName = firstname, lastName = lastNameLecturer[firstNameLecturer.IndexOf(firstname)], email = emailLecturer[firstNameLecturer.IndexOf(firstname)] }; lecDbSet.AddLecToCourse(lecDbSet.AddOne(tmplec), courseDbSet.GetById(firstNameLecturer.IndexOf(firstname) + 1)); }); }
private void FillLecturer() { firstNameLecturer.ForEach(firstname => { lecturer tmplec = new lecturer { salutation = salutationLecturer[firstNameLecturer.IndexOf(firstname)], firstName = firstname, lastName = lastNameLecturer[firstNameLecturer.IndexOf(firstname)], email = emailLecturer[firstNameLecturer.IndexOf(firstname)] }; lecDbSet.AddLecToCourse(lecDbSet.AddOne(tmplec), courseDbSet.GetById(firstNameLecturer.IndexOf(firstname) + 1)); Console.WriteLine($"fill lecturer {tmplec.firstName}{tmplec.lastName} and add to course"); }); Console.WriteLine("- - - - - - - Finished - - - - -"); }
private void FillTaskDone() { List <task> alltasksList = taskDbSet.GetAll(); List <student> studentsList = studDbSet.GetAll(); studentsList.ForEach(student => { studDbSet.GetLabsOfStudent(student.studentID).ForEach(lab => { alltasksList.Where(s => s.lab_labID == lab.labID).ToList().ForEach(task => { taskdone taskDone = new taskdone { isDone = 1, student_studentID = student.studentID, task_taskID = task.taskID }; taskDoneDbSet.AddOne(taskDone); }); }); }); }
private void FillTask() { List <lab> labs = labsDbset.GetAll(); List <labdate> labDates = labdatesDbSet.GetAll(); labs.ForEach(lab => { var indexLab = labs.IndexOf(lab); labDates.Where(s => s.lab_labID == indexLab).ToList().ForEach(date => { var indexLabDate = labDates.IndexOf(date); task tmpTask = new task { lab_labID = indexLab, taskNumber = indexLabDate + 1, dueDate = date.date }; taskDbSet.AddOne(tmpTask); }); }); }
private void FillTaskDone() { List <task> alltasksList = taskDbSet.GetAll(); List <student> studentsList = studDbSet.GetAll(); studentsList.ForEach(student => { studDbSet.GetLabsOfStudent(student.studentID).ForEach(lab => { alltasksList.Where(s => s.lab_labID == lab.labID).ToList().ForEach(task => { taskdone taskDone = new taskdone { isDone = 1, student_studentID = student.studentID, task_taskID = task.taskID }; taskDoneDbSet.AddOne(taskDone); Console.WriteLine($"Student {student.firstName} has Lab { lab.labID} and tasks {task.taskNumber}"); }); }); }); Console.WriteLine("- - - - - - - Finished - - - - -"); }
private void FillTask() { List <lab> labs = labsDbset.GetAll(); List <labdate> labDates = labdatesDbSet.GetAll(); labs.ForEach(lab => { var indexLab = labs.IndexOf(lab); labDates.Where(s => s.lab_labID == indexLab).ToList().ForEach(date => { var indexLabDate = labDates.IndexOf(date); task tmpTask = new task { lab_labID = indexLab, taskNumber = indexLabDate + 1, dueDate = date.date }; taskDbSet.AddOne(tmpTask); Console.WriteLine($"fill Task {tmpTask.taskID} taskDueDate {tmpTask.dueDate} in lab {tmpTask.lab_labID}"); }); }); Console.WriteLine("- - - - - - - Finished - - - - -"); }
private void FillStudent() { firstNameStudent.ForEach(firstName => { var index = firstNameStudent.IndexOf(firstName); student tmpStud = new student { salutation = salutationStudent[index], firstName = firstName, lastName = lastNameStudent[index], email = emailStudent[index], matricelNumber = matricelnumberStudent[index], studyCourse = studyCourseStudent[index], semester = semesterStudent[index] }; studDbSet.AddOne(tmpStud); if (index % 2 == 0) { studDbSet.AddStudToLab(tmpStud, labsDbset.GetById(1)); } else { studDbSet.AddStudToLab(tmpStud, labsDbset.GetById(2)); } }); }
public void addCourse(course course) { CourseContext.AddOne(course); }