示例#1
0
 public ActionResult Edit(int id, EstudanteRemoto.Estudante estudante)
 {
     if (ModelState.IsValid)
     {
         service.atualiza(estudante);
         return(RedirectToAction("Index"));
     }
     return(View(estudante));
 }
示例#2
0
        public ActionResult Create(EstudanteRemoto.Estudante estudante)
        {
            if (ModelState.IsValid)
            {
                service.adiciona(estudante);
                return(RedirectToAction("Index"));
            }

            return(View(estudante));
        }
示例#3
0
 // 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));
 }
示例#4
0
 // 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));
 }
示例#5
0
 public ActionResult DeleteConfirmed(int?id)
 {
     EstudanteRemoto.Estudante estudante = service.procura(id);
     service.remove(estudante);
     return(RedirectToAction("Index"));
 }