public ActionResult Add(GroupSet group)
 {
     var teacherId = _authenticationService.GetUserIdFromRequest(Request);
     _applicationService.AddGroup(group, teacherId);
     var groups = _applicationService.GetGroupsByTeacherId(teacherId);
     return View("List", groups);
 }
Пример #2
0
 public StudentListViewModel MapToStudentListViewModel(GroupSet group, List<StudentSet> students)
 {
     var studentListViewModel = new StudentListViewModel()
     {
         Group = group,
         Students = students
     };
     return studentListViewModel;
 }
 public void EditGroup(GroupSet group, string teacherId)
 {
     group.Teacher_Id = Int32.Parse(teacherId);
     _databaseService.EditGroup(group);
 }
 public StudentListViewModel()
 {
     Group = new GroupSet();
     Students = new List<StudentSet>();
 }
 public void RemoveGroup(GroupSet groupSet)
 {
     context.GroupSet.Remove(groupSet);
     context.SaveChanges();
 }
 public void EditGroup(GroupSet groupSet)
 {
     context.GroupSet.AddOrUpdate(groupSet);
     context.SaveChanges();
 }
 public void AddGroup(GroupSet groupSet)
 {
     context.GroupSet.Add(groupSet);
     context.SaveChanges();
 }