public ActionResult Logueo(Usuario user) { using (SistemaDBContext db = new SistemaDBContext()) { //Filtro solamente por la clave primaria (Username) //var usr = db.SISUsuarios.Where(u => u.Username == user.Username && u.Password == user.Password).FirstOrDefault(); var usr = db.Usuarios.Where(u => u.CodUsr == user.CodUsr.ToUpper()).FirstOrDefault(); if (usr != null) { string pwddecript = ""; if (usr.PwdUsr.Trim() != null) { //llamo a función para desencriptar password pwddecript = DecryptPwd(usr.PwdUsr); } if ((string.IsNullOrEmpty(user.PwdUsr)) || (user.PwdUsr.Trim() == pwddecript)) { //CREO VARIABLES DE SESIÓN Session["Codusr"] = usr.CodUsr.ToString(); Session["Nomusr"] = usr.NomUsr.ToString(); return(RedirectToAction("Resumen", "ComisionesBP", null)); } else { ModelState.AddModelError("", "Usuario o Contraseña Incorrecta"); } } else { ModelState.AddModelError("", "Usuario o Contraseña Incorrecta"); } } return(View()); }
public CrimesController(SistemaDBContext context) { _context = context; }
public UsersController(SistemaDBContext context) { _context = context; }
public StatusController(SistemaDBContext context) { _context = context; }