public ActionResult Signup(User model)
 {
     using (ExportExcelEntities context = new ExportExcelEntities())
     {
         context.Users.Add(model);
         context.SaveChanges();
     }
     return(RedirectToAction("Login"));
 }
 public ActionResult Login(UserModel model)
 {
     using (ExportExcelEntities context = new ExportExcelEntities())
     {
         bool IsValidUser = context.Users.Any(user => user.UserName.ToLower() ==
                                              model.UserName.ToLower() && user.UserPassword == model.UserPassword);
         if (IsValidUser)
         {
             FormsAuthentication.SetAuthCookie(model.UserName, false);
             return(RedirectToAction("Index", "Employees"));
         }
         ModelState.AddModelError("", "invalid Username or Password");
         return(View());
     }
 }