// GET: Instructor/Edit/5 public ActionResult Edit(int id) { Instructor getInst = InstructorRepository.GetSingleInstructor(id); IntructorCreateNewModel model = new IntructorCreateNewModel(getInst); return(View(model)); }
public ActionResult Create(IntructorCreateNewModel model) { try { int id = InstructorRepository.InsertInstructor(model.Instructor); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public ActionResult Edit(int id, [FromForm] IntructorCreateNewModel instructorModel) { try { InstructorRepository.UpdateInstructor(instructorModel.Instructor); // TODO: Add update logic here return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
// GET: Instructor/Create public ActionResult Create() { IntructorCreateNewModel model = new IntructorCreateNewModel(); return(View(model)); }