public IActionResult Login(AccountViewModel account) { if (ModelState.IsValid) { if (account.CheckAccount(account.Username, account.Password)) { account.user = account.GetUser(account); account = account.GetByName(account); ViewData["Username"] = account.Username; TempData["Un"] = account.Username; TempData["oid"] = "x"; if (account.user.isStore) { return(View("Store", account)); } return(View(account)); } } return(View("Login")); }