예제 #1
0
 public ActionResult Signup(Users model)
 {
     using (var context = new RNTAEntities())
     {
         context.Users.Add(model);
         context.SaveChanges();
     }
     return(RedirectToAction("Login"));
 }
예제 #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"));
         }
     }
 }