Exemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "IdMoneda,Codigo,Nombre")] MEJJ_Moneda mEJJ_Moneda)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mEJJ_Moneda).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(mEJJ_Moneda));
 }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "IdArticulo,Descripcion,Modelo,Precio,Color,Tamanio")] MEJJ_Articulo mEJJ_Articulo)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mEJJ_Articulo).State = EntityState.Modified;
         db.SaveChanges();
         TempData["type"]    = "success";
         TempData["message"] = "Se edito exitosamente";
         return(RedirectToAction("Index"));
     }
     return(View(mEJJ_Articulo));
 }
Exemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "IdCliente,Cedula,Telefono,Direccion,DiasCredito,Nombre,Mail")] MEJJ_Cliente mEJJ_Cliente)
 {
     if (ModelState.IsValid)
     {
         mEJJ_Cliente.DiasCredito     = 30;
         db.Entry(mEJJ_Cliente).State = EntityState.Modified;
         db.SaveChanges();
         TempData["type"]    = "success";
         TempData["message"] = "Se edito exitosamente";
         return(RedirectToAction("Index"));
     }
     return(View(mEJJ_Cliente));
 }
Exemplo n.º 4
0
        public ActionResult Edit([Bind(Include = "IdEmpleado,Nombre,Cedula,Mail,Telefono,Direccion,IdRol,Contraseña")] MEJJ_Empleado mEJJ_Empleado)
        {
            if (ModelState.IsValid)
            {
                mEJJ_Empleado.IdRol = 1;
                var correoUnico = db.MEJJ_Empleado.Where(x => x.Mail == mEJJ_Empleado.Mail && x.IdEmpleado != mEJJ_Empleado.IdEmpleado).FirstOrDefault();
                if (correoUnico != null)
                {
                    mEJJ_Empleado.LoginErrorMessage = "El correo ya esta en uso";
                    return(View(mEJJ_Empleado));
                }
                else
                {
                    mEJJ_Empleado.Contraseña      = Crypto.Hash(mEJJ_Empleado.Contraseña);
                    db.Entry(mEJJ_Empleado).State = EntityState.Modified;
                    db.SaveChanges();
                    TempData["type"]    = "success";
                    TempData["message"] = "Se edito exitosamente";
                    return(RedirectToAction("Index"));
                }
            }

            return(View(mEJJ_Empleado));
        }