public ActionResult Login(LoginViewModel model) { Users user = UserQueries.CheckLogin(model); if (user != null) { HttpContext.Session["USER"] = user; HttpCookie userCookie = new HttpCookie("USER"); userCookie.Value = user.Username; userCookie.Expires = DateTime.Now.AddDays(30); Response.SetCookie(userCookie); if (!user.IncomeInitialized) { return(RedirectToAction("Index", "Salary")); } else if (!user.RealEstateInitialized) { return(RedirectToAction("Index", "RealEstate")); } else if (!user.BusinessInitialized) { return(RedirectToAction("Index", "Business")); } else if (!user.BankDepositInitialized) { return(RedirectToAction("Index", "BankDeposit")); } else if (!user.StockInitialized) { return(RedirectToAction("Index", "Stock")); } else if (!user.InsuranceInitialized) { return(RedirectToAction("Index", "Insurance")); } else if (!user.CarLiabilityInitialized) { return(RedirectToAction("Index", "CarLiability")); } else if (!user.CreditCardInitialized) { return(RedirectToAction("Index", "CreditCardLiability")); } else if (!user.OtherLiabilityInitialized) { return(RedirectToAction("Index", "OtherLiability")); } else if (!user.FamilyExpenseInitialized) { return(RedirectToAction("Index", "FamilyExpense")); } else if (!user.OtherExpenseInitialized) { return(RedirectToAction("Index", "OtherExpense")); } else if (!user.AvailableMoneyInitialized) { return(RedirectToAction("Index", "AvailableMoney")); } else { return(RedirectToAction("Index", "FinancialStatus")); } } else { ModelState.AddModelError("LoginError", "Sai tên đăng nhập hoặc mật khẩu"); return(View(model)); } }