Esempio n. 1
0
 public ActionResult Index(CustomForm model)
 {
     if (ModelState.IsValid)
     {
         CustomForm form = new CustomForm();
         CustomCart cart = new CustomCart();
         cart.Description        = model.Description != null ? model.Description : form.getDefaultDescription();
         cart.BillingSurname     = model.LastName;
         cart.BillingFirstnames  = model.FirstName;
         cart.BillingAddress1    = model.Address1;
         cart.BillingAddress2    = model.Address2;
         cart.BillingCity        = model.City;
         cart.BillingCountry     = form.getDefaultCountry();
         cart.DeliverySurname    = model.LastName;
         cart.DeliveryFirstnames = model.FirstName;
         cart.DeliveryAddress1   = model.Address1;
         cart.DeliveryAddress2   = model.Address2;
         cart.DeliveryCity       = model.City;
         cart.DeliveryCountry    = form.getDefaultCountry();
         cart.BillingPostCode    = model.PostCode;
         cart.DeliveryPostCode   = model.PostCode;
         cart.BasketXml          = form.getDefaultItemXML();
         cart.Phone = model.Phone;
         cart.DOB   = model.DOB.ToShortDateString();
         Session[cart.CURRENT_USER_SHOPPINGCART] = cart;
         return(RedirectToAction("Confirm"));
     }
     return(View(model));
 }