public ActionResult Signup(User model)
 {
     using (var context = new FormAuthEntities())
     {
         context.Users.Add(model);
         context.SaveChanges();
     }
     return(RedirectToAction("login"));
 }
 public ActionResult Login(Models.Membership model)
 {
     using (var context = new FormAuthEntities())
     {
         //check whether username and pwd are found or not
         bool isValid = context.Users.Any(x => x.Username == model.Username && x.Password == model.Password);
         if (isValid)
         {
             FormsAuthentication.SetAuthCookie(model.Username, false);
             return(RedirectToAction("Index", "Employees"));
         }
         else
         {
             ModelState.AddModelError("", "Invalid Username & Password");
             return(View());
         }
     }
 }