public ActionResult Address() { // Null handling if (Session["loggedInState"] == null) { return Redirect("/403.html"); } // Checks if logged in bool state = (bool)Session["loggedInState"]; if (state == true) { // Creates an address model AddressModel addressModel = new AddressModel(); // Holds the new address List<Address> addressList = addressModel.GetAddressesList(); // Passes back to the view with address return View(addressList); } else { // If not logged in return Redirect("/login.html"); } }
public ActionResult create() { // Null handling if (Session["loggedInState"] == null) { return Redirect("/403.html"); } else { AddressModel addressModel = new AddressModel(); List<Address> listAddresses = addressModel.GetAddressesList(); return View(listAddresses); } }
public ActionResult newCustomer() { if (Session["loggedInState"] == null) { return Redirect("/403.html"); } else { var addresses = new AddressModel(); var addresslist = addresses.GetAddressesList(); return View(addresslist); } }