Exemplo n.º 1
0
 public ActionResult Signup(Users model)
 {
     using (var context = new RNTAEntities())
     {
         context.Users.Add(model);
         context.SaveChanges();
     }
     return(RedirectToAction("Login"));
 }
Exemplo n.º 2
0
 public ActionResult Login(Users model)
 {
     using (var context = new RNTAEntities())
     {
         bool isValid = context.Users.Any(x => x.AppUserName == model.AppUserName && x.Password == model.Password);
         if (true)
         {
             FormsAuthentication.SetAuthCookie(model.AppUserName, false);
             return(RedirectToAction("Index", "Employees"));
         }
     }
 }