示例#1
0
 //
 // GET: /Account/
 public ActionResult Login(string username, string password)
 {
     if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password))
     {
         EmployeeBll bll = new EmployeeBll();
         Employee    emp = bll.getbyAccountAndPwd(username.Trim(), password.Trim());
         if (emp != null)
         {
             FormsAuthentication.SetAuthCookie(username, false);
             return(Redirect(Url.Action("index", "Home")));
         }
         else
         {
             return(View());
         }
     }
     return(View());
 }