public void AddDeliveryAddressForAPI(CustomerDetailView customerDetailView)
        {
            DeliveryAddressAddRequest request = new DeliveryAddressAddRequest();

            request.Address = customerDetailView.Customer.DeliveryAddressBook.First();
            request.CustomerIdentityToken = customerDetailView.Customer.IdentityToken;
            _customerService.AddDeliveryAddress(request);
        }
예제 #2
0
        public async Task <IActionResult> AddDeliveryAddress(DeliveryAddressView deliveryAddressView)
        {
            DeliveryAddressAddRequest request = new DeliveryAddressAddRequest();

            request.Address       = deliveryAddressView;
            request.CustomerEmail = _cookieAuthentication.GetAuthenticationToken();

            _customerService.AddDeliveryAddress(request);

            return(await DeliveryAddresses());
        }
예제 #3
0
        public ActionResult AddDeliveryAddress(DeliveryAddressView deliveryAddressView)
        {
            DeliveryAddressAddRequest request = new DeliveryAddressAddRequest();

            request.Address = deliveryAddressView;
            request.CustomerIdentityToken = _formsAuthentication.GetAuthenticationToken();

            _customerService.AddDeliveryAddress(request);

            return(DeliveryAddresses());
        }
예제 #4
0
        public ActionResult AddDeliveryAddress(DeliveryAddressView deliveryAddressView)
        {
            var request = new DeliveryAddressAddRequest();

            request.Address = deliveryAddressView;
            request.CustomerIdentityToken = _formsAuthentication.GetAuthenticationToken(HttpContext.User);

            _customerService.AddDeliveryAddress(request);

            return(Checkout().Result);
        }
예제 #5
0
        public DeliveryAddressAddResponse AddDeliveryAddress(DeliveryAddressAddRequest request)
        {
            DeliveryAddressAddResponse response = new DeliveryAddressAddResponse();
            Customer customer = _customerRepository.FindBy(request.CustomerIdentityToken);

            Address address = ConvertToAddress(request.Address);

            customer.AddAddress(address, request.Address.Name);

            _customerRepository.Save(customer);
            _uow.Commit();

            //response.DeliveryAddress = deliveryAddress.ConvertToDeliveryAddressView();

            return(response);
        }
예제 #6
0
        public DeliveryAddressAddResponse AddDeliveryAddress(DeliveryAddressAddRequest request)
        {
            DeliveryAddressAddResponse response = new DeliveryAddressAddResponse();
            Customer        customer            = _customerRepository.FindBy(request.CustomerEmail);
            DeliveryAddress deliveryAddress     = new DeliveryAddress();

            deliveryAddress.Customer = customer;

            UpdateDeliveryAddressFrom(request.Address, deliveryAddress);
            customer.AddAddress(deliveryAddress);
            _customerRepository.Save(customer);
            _uow.Commit();

            response.DeliveryAddress = _mapper.Map <DeliveryAddress, DeliveryAddressView>(deliveryAddress);

            return(response);
        }
예제 #7
0
        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);
        }