public ActionResult Edit([Bind(Include = "ClienteID,NombreCompleto,CorreoElectronico,Estado")] ClientesController cliente) { if (ModelState.IsValid) { db.Entry(cliente).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cliente)); }
public ActionResult Create([Bind(Include = "ClienteID,NombreCompleto,CorreoElectronico,Estado")] ClientesController cliente) { if (ModelState.IsValid) { db.Clientes.Add(cliente); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cliente)); }
// GET: Clientes/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ClientesController cliente = db.Clientes.Find(id); if (cliente == null) { return(HttpNotFound()); } return(View(cliente)); }