Example #1
0
 public ActionResult Edit([Bind(Include = "cod_usuario,txt_user,txt_password,txt_nombre,txt_apellido,nro_doc,cod_rol,sn_activo")] User user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.cod_rol = new SelectList(db.Rols, "cod_rol", "txt_desc", user.cod_rol);
     return(View(user));
 }
Example #2
0
 public ActionResult Edit([Bind(Include = "Id,UserName,ModificationDate,CreatationDate,Password,IdUserType")] User user)
 {
     if (ModelState.IsValid)
     {
         user.CreatationDate   = DateTime.Now;
         user.ModificationDate = DateTime.Now;
         db.Entry(user).State  = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.IdUserType = new SelectList(db.UserType, "Id", "Name", user.IdUserType);
     return(View(user));
 }