public string AdminGetAllCustomers() { var BankAdminBLL = new BankAdminBLL(); var jsonSerializer = new JavaScriptSerializer(); return(jsonSerializer.Serialize(BankAdminBLL.getAllCustomers())); }
public string AdminDeleteCustomer(string id) { var BankAdminBLL = new BankAdminBLL(); var jsonSerializer = new JavaScriptSerializer(); return(jsonSerializer.Serialize(BankAdminBLL.adminDeleteCustomer(id))); }
public ActionResult AdminEditAccount(string accNumber) { var bankBLL = new BankAdminBLL(); Account account = bankBLL.findAccount(accNumber); Session["AccountNumber"] = (string)accNumber; return(View(account)); }
public string AdminCreateNewAccount(string nid) { BankAdminBLL BankAdminBLL = new BankAdminBLL(); List <Account> customerAccounts = BankAdminBLL.newAccount(nid); var jsonSerializer = new JavaScriptSerializer(); return(jsonSerializer.Serialize(customerAccounts)); }
public ActionResult AdminRegisterCustomer(Customer inCustomer) { var db = new BankAdminBLL(); string password = inCustomer.password; if (!db.adminRegisterCustomer(inCustomer)) { return(View(inCustomer)); } return(RedirectToAction("AdminOverview")); }
public ActionResult AdminEditCustomer(Customer customer) { var BankAdminBLL = new BankAdminBLL();; if (!BankAdminBLL.adminEditCustomer(customer)) { return(View(customer)); } return(RedirectToAction("AdminOverview", "Bank")); }
public ActionResult AdminLogin(Admin admin) { var bankAdminBLL = new BankAdminBLL(); if (bankAdminBLL.isAdminLoginCorrect(admin)) { Session["AdminLoggedIn"] = true; return(RedirectToAction("AdminOverview", "Bank")); } Session["AdminLoggedIn"] = null; return(View()); }
public ActionResult AdminEditAccount(Account account) { var bankBLL = new BankAdminBLL(); if (!bankBLL.adminEditAccount(account, (string)Session["AccountNumber"])) { return(View(account)); } string nid = bankBLL.findAccount(account.accountNumber).nID; System.Diagnostics.Debug.Write("TEST nid" + nid); return(Redirect("/Bank/AdminCustomerDetails/?nid=" + nid)); }
public string AdminDeleteBankAccount(string accountNumber) { var BankAdminBLL = new BankAdminBLL(); List <Account> remainingAccounts = BankAdminBLL.adminDeleteAccount(accountNumber); foreach (Account i in remainingAccounts) { System.Diagnostics.Debug.WriteLine(i.accountNumber + "\n"); } var jsonSerializer = new JavaScriptSerializer(); return(jsonSerializer.Serialize(remainingAccounts)); }
public ActionResult AdminEditCustomer(string nid) { if (Session["AdminLoggedIn"] != null) { if ((bool)Session["AdminLoggedIn"]) { var BankAdminBLL = new BankAdminBLL(); Customer customer = BankAdminBLL.findCustomer(nid); return(View(customer)); } } Session["AdminLoggedIn"] = null; return(RedirectToAction("AdminLogin", "Bank")); }
public ActionResult AdminOverview() { if (Session["AdminLoggedIn"] != null) { bool AdminLoggedIn = (bool)Session["AdminLoggedIn"]; if (AdminLoggedIn) { var BankAdminBLL = new BankAdminBLL(); List <Customer> allCustomers = BankAdminBLL.getAllCustomers(); return(View(allCustomers)); } } Session["AdminLoggedIn"] = null; return(RedirectToAction("AdminLogin", "Bank")); }