示例#1
0
 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));
 }
示例#2
0
        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));
        }
示例#3
0
        // 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));
        }