Exemplo n.º 1
0
 public ActionResult Details()
 {
     var order = Repository.GetOrder(_shopId);
     if (order == null)
         return RedirectToAction("index");
     var vm = new OrderDetails
     {
         Name = order.Name,
         Address = order.Address,
         Postcode = order.Postcode,
         City = order.City,
         Phone = order.Phone,
         Email = order.Email
     };
     return View(vm);
 }
Exemplo n.º 2
0
 public ActionResult Details(OrderDetails vm)
 {
     var order = Repository.GetOrder(_shopId);
     if (order == null)
         return RedirectToAction("index");
     if (!ModelState.IsValid)
         return View(vm);
     order.Name = vm.Name;
     order.Address = vm.Address;
     order.Postcode = vm.Postcode;
     order.City = vm.City;
     order.Email = vm.Email;
     order.Phone = vm.Phone;
     Repository.Save();
     return RedirectToAction("confirm");
 }