public ActionResult Edit(int id, EstudanteRemoto.Estudante estudante) { if (ModelState.IsValid) { service.atualiza(estudante); return(RedirectToAction("Index")); } return(View(estudante)); }
public ActionResult Create(EstudanteRemoto.Estudante estudante) { if (ModelState.IsValid) { service.adiciona(estudante); return(RedirectToAction("Index")); } return(View(estudante)); }
// GET: Estudante/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EstudanteRemoto.Estudante estudante = service.detalhe(id); if (estudante == null) { return(HttpNotFound()); } return(View(estudante)); }
// GET: Estudantes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } //Estudante estudante = db.Estudantes.Find(id); EstudanteRemoto.Estudante estudante = service.procura(id); service.remove(estudante); if (estudante == null) { return(HttpNotFound()); } return(View(estudante)); }
public ActionResult DeleteConfirmed(int?id) { EstudanteRemoto.Estudante estudante = service.procura(id); service.remove(estudante); return(RedirectToAction("Index")); }