public ActionResult CreateTuteur(TuteurModels model) { if (ModelState.IsValid) { using (TuteurRepository repository = new TuteurRepository()) { Tutors a = new Tutors { Id = Guid.NewGuid(), FirstName = model.firstName, LastName = model.lastName, Mail = model.mail, PostCode = model.postCode, Comment = model.comment, Town = model.town, Tel = model.tel, Address = model.address, // eleves = }; repository.Add(a); repository.Save(); } return(RedirectToAction("ReadTuteurs")); } return(View(model)); }
public ActionResult DeleteTuteur(TuteurModels model) { using (TuteurRepository repository = new TuteurRepository()) { repository.DeleteById(model.id); repository.Save(); } return(View("Index")); }
public ActionResult EditTuteur(TuteurModels model) { using (TuteurRepository repository = new TuteurRepository()) { Tutors x = repository.GetTutorById(model.id); x.FirstName = model.firstName; x.LastName = model.lastName; x.Mail = model.mail; x.PostCode = model.postCode; x.Comment = model.comment; x.Town = model.town; x.Tel = model.tel; x.Address = model.address; // eleves = if (ModelState.IsValid) { repository.Save(); } return(RedirectToAction("ReadTuteurs")); } }