Exemplo n.º 1
0
        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");
            }
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
 public ActionResult newCustomer()
 {
     if (Session["loggedInState"] == null)
     {
         return Redirect("/403.html");
     }
     else
     {
         var addresses = new AddressModel();
         var addresslist = addresses.GetAddressesList();
         return View(addresslist);
     }
 }