Exemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "ID,Descricao,Preco,UltimaCompra,Estoque")] Teste teste)
 {
     if (ModelState.IsValid)
     {
         db.Entry(teste).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(teste));
 }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "ContaId,Nome")] Conta conta)
 {
     if (ModelState.IsValid)
     {
         db.Entry(conta).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(conta));
 }
Exemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "PerfilId,Nome,ContaId")] Perfil perfil)
 {
     if (ModelState.IsValid)
     {
         db.Entry(perfil).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ContaId = new SelectList(db.Contas, "ContaId", "Nome", perfil.ContaId);
     return(View(perfil));
 }
Exemplo n.º 4
0
 public ActionResult Edit([Bind(Include = "SetorId,Nome,PerfilId")] Setor setor)
 {
     if (ModelState.IsValid)
     {
         db.Entry(setor).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.PerfilId = new SelectList(db.Perfils, "PerfilId", "Nome", setor.PerfilId);
     return(View(setor));
 }