public ActionResult ViewAccountsByID(AccountModel accountModel) { if (Convert.ToString(Session["key"]) != "admin") { return(RedirectToAction("Login", "Home")); } Admin_Api adminApi = new Admin_Api(); IEnumerable <AccountModel> model = null; if (accountModel.account_ID != 0) { model = adminApi.GetAccountsByID(accountModel); } return(View("~/Views/Administrator/AdminViewAccounts.cshtml", model)); }