public ActionResult AddDeliveryAddress(DeliveryAddressView deliveryAddressView) { DeliveryAddressAddRequest request = new DeliveryAddressAddRequest(); request.Address = deliveryAddressView; request.CustomerIdentityToken = _formsAuthentication.GetAuthenticationToken(); _customerService.AddDeliveryAddress(request); return Checkout(); }
public DeliveryAddressAddResponse AddDeliveryAddress(DeliveryAddressAddRequest request) { DeliveryAddressAddResponse response = new DeliveryAddressAddResponse(); Customer customer = _customerRepository.FindBy(request.CustomerIdentityToken); DeliveryAddress deliveryAddress = new DeliveryAddress(); deliveryAddress.Customer = customer; UpdateDeliveryAddressFrom(request.Address, deliveryAddress); customer.AddAddress(deliveryAddress); _customerRepository.Save(customer); _uow.Commit(); response.DeliveryAddress = deliveryAddress.ConvertToDeliveryAddressView(); return response; }