public ActionResult Edit([Bind(Include = "id,nome,sobrenome,titulacao,cursoId")] ProfessorRemoto.Professor professor) { if (ModelState.IsValid) { service.atualiza(professor); return(RedirectToAction("Index")); } return(View(professor)); }
// GET: Professores/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ProfessorRemoto.Professor professor = service.procura(id); if (professor == null) { return(HttpNotFound()); } return(View(professor)); }
public ActionResult DeleteConfirmed(int id) { ProfessorRemoto.Professor professor = service.procura(id); service.remove(professor); return(RedirectToAction("Index")); }