public ActionResult Index(AccountViewModel account)
        {
            string name = Account.AllowAccount(account);

            if (name != null)
            {
                SessionHelp.Set("UserName", name);
                return(RedirectToAction("Index", "Home"));
            }

            ViewBag.error = "账号密码有误";
            return(View());
        }
Exemplo n.º 2
0
 public ActionResult Index(AccountViewModel account)
 {
     if (account.User == "shajun")
     {
         if (account.Password == "sj76606729")
         {
             SessionHelp.Set("UserName", "沙俊");
             return(RedirectToAction("Index", "Home"));
         }
     }
     else if (account.User == "shajie")
     {
         if (account.Password == "190750991jie")
         {
             SessionHelp.Set("UserName", "沙杰"); return(RedirectToAction("Index", "Home"));
         }
     }
     else if (account.User == "chenyu")
     {
         if (account.Password == "CHENYU")
         {
             SessionHelp.Set("UserName", "陈煜"); return(RedirectToAction("Index", "Home"));
         }
     }
     else if (account.User == "xichaoqun")
     {
         if (account.Password == "XICHAOQUN")
         {
             SessionHelp.Set("UserName", "奚超群"); return(RedirectToAction("Index", "Home"));
         }
     }
     else if (account.User == "123321")
     {
         if (account.Password == "123321")
         {
             SessionHelp.Set("UserName", "通用账户");
         }
     }
     else if (account.User == "wangyongming")
     {
         if (account.Password == "WANGYONGMING")
         {
             SessionHelp.Set("UserName", "王永明");
             return(RedirectToAction("Index", "Home"));
         }
     }
     ViewBag.error = "账号密码有误";
     return(View());
 }