Пример #1
0
        public ActionResult SignIn(UserModel us)
        {
            if(us != null)
            {
                var user = from u in db.users
                           where u.email.Equals(us.email) && u.password.Equals(us.password)
                           select u;

                if (user.ToArray().Length > 0)
                {
                    FormsAuthentication.SetAuthCookie(us.email,false);
                    return RedirectToAction("/");
                }
            } 
            return View();
        }
Пример #2
0
 public ActionResult SignUp(UserModel user)
 {
     db.users.Add(user);
     db.SaveChanges();
     return RedirectToAction("/");
 }