Esempio n. 1
0
        public ActionResult Edit(TeacherComposeViewModel viewModel)
        {
            var teacher = DecomposeStudentViewModel(viewModel.Teacher);
            Site.TeacherManager.Update(teacher, viewModel.Teacher.SelectedGroups);

            return RedirectToAction("List");
        }
Esempio n. 2
0
        public ActionResult Edit(string id)
        {
            var teacher = TeacherManager.Get(id);
            if (teacher == null)
                return HttpNotFound("Teacher with specified ID was not found.");
            var viewModel = new TeacherComposeViewModel(Map<Teacher, TeacherViewModel>(teacher));

            IsEditing = true;
            return View("Create", viewModel);
        }
Esempio n. 3
0
 public ActionResult Create()
 {
     var viewModel = new TeacherComposeViewModel(null);
     return View(viewModel);
 }