public ActionResult LogIn(string username, string password)
        {
            AccountModels account = new AccountModels();
            var login = (from log in db.accounts
                         where (username == log.username)
                         select log).First();

            if ((login != null && account.IsValid(login.password, password)))
            {
                account.username = login.username;
                account.id_account = login.id_account;
                Session["id_account"] = login.id_account;
                FormsAuthentication.SetAuthCookie(login.username, false);
                //return RedirectToAction("LogIn");
                return RedirectToAction("Index", "Account", new { _idAccount = Session["id_account"] });
            }
            else
            {
                ModelState.AddModelError("", "Invalid username or password");
                return View(account);
                //return RedirectToAction("Index", new { _idAccount = account.id_account });
            }
        }
 public ActionResult LogIn()
 {
     AccountModels model = new AccountModels();
     return View(model);
 }