public ActionResult Step4(int id = 0, string shipping_type = "") { Customer c = new Customer {ID = id}; c.Get(); ViewBag.customer = c; string error = (TempData["message"] != null) ? (string)TempData["message"] : null; ViewBag.error = error; List<Address> addresses = c.GetAddresses(); ViewBag.addresses = addresses; Cart currentCart = c.Carts.Where(x => x.payment_id == 0).First<Cart>(); List<Country> countries = UDF.GetCountries(); ViewBag.countries = countries; if (shipping_type != "") { decimal shipping_price = 0; string shiptype = ""; string[] typesplit = shipping_type.Split('|'); shiptype = typesplit[0]; shipping_price = Convert.ToDecimal(typesplit[1]); currentCart.setShippingType(shiptype, shipping_price); } // We need to calculate the tax now that we know the shipping state ViewBag.cart = currentCart; return View("Add-Billing"); }
public ActionResult Step3(int id = 0) { Customer c = new Customer { ID = id }; c.Get(); ViewBag.customer = c; string error = (TempData["message"] != null) ? (string)TempData["message"] : null; ViewBag.error = error; List<Address> addresses = c.GetAddresses(); ViewBag.addresses = addresses; Cart currentCart = c.Carts.Where(x => x.payment_id == 0).First<Cart>(); ViewBag.cart = currentCart; List<Country> countries = UDF.GetCountries(); ViewBag.countries = countries; ShippingResponse shippingresponse = new ShippingResponse(); shippingresponse = currentCart.getShipping(); ViewBag.shippingresponse = shippingresponse; return View("Add-Shipping"); }