Example #1
0
 public ActionResult Edit([Bind(Include = "ClienteId,Nombres,Direccion,Telefono,FechaCreacion,Email")] Clientes clientes)
 {
     if (ModelState.IsValid)
     {
         db.Entry(clientes).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(clientes));
 }
Example #2
0
        public static bool Guardar(Clientes cliente)
        {
            bool retorno = false;

            using (var db = new EjemploDb())
            {
                try
                {
                    db.Cliente.Add(cliente);
                    db.SaveChanges();
                    retorno = true;
                }
                catch (Exception)
                {
                    throw;
                }
            }
            return(retorno);
        }