public ActionResult Edit(int id, CursoRemoto.Curso curso) { if (ModelState.IsValid) { service.atualiza(curso); return(RedirectToAction("Index")); } return(View(curso)); }
public ActionResult Create(CursoRemoto.Curso curso) { if (ModelState.IsValid) { service.adiciona(curso); return(RedirectToAction("Index")); } return(View(curso)); }
// GET: Curso/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CursoRemoto.Curso cursos = service.procura(id); if (cursos == null) { return(HttpNotFound()); } return(View(cursos)); }
// GET: Curso/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CursoRemoto.Curso curso = service.detalhe(id); if (curso == null) { return(HttpNotFound()); } return(View(curso)); }
public ActionResult DeleteConfirmed(int id) { CursoRemoto.Curso curso = service.procura(id); service.remove(curso); return(RedirectToAction("Index")); }