public void EditDeliveryAddressForAPI(DeliveryAddressView deliveryAddressView, string customerID)
        {
            DeliveryAddressModifyRequest request = new DeliveryAddressModifyRequest();

            request.Address = deliveryAddressView;
            request.CustomerIdentityToken = customerID;
            _customerService.ModifyDeliveryAddress(request);
        }
        public void EditDeliveryAddress(string customerId)
        {
            Task <string>       content             = this.Request.Content.ReadAsStringAsync();
            DeliveryAddressView deliveryAddressView = JsonConvert.DeserializeObject <DeliveryAddressView>(content.Result);

            this.customerController.EditDeliveryAddressForAPI(deliveryAddressView, customerId);
            return;
        }
Пример #3
0
 private void UpdateDeliveryAddressFrom(DeliveryAddressView deliveryAddressSource, DeliveryAddress deliveryAddressToUpdate)
 {
     deliveryAddressToUpdate.Name         = deliveryAddressSource.Name;
     deliveryAddressToUpdate.AddressLine1 = deliveryAddressSource.AddressLine1;
     deliveryAddressToUpdate.AddressLine2 = deliveryAddressSource.AddressLine2;
     deliveryAddressToUpdate.City         = deliveryAddressSource.City;
     deliveryAddressToUpdate.State        = deliveryAddressSource.State;
     deliveryAddressToUpdate.Country      = deliveryAddressSource.Country;
     deliveryAddressToUpdate.ZipCode      = deliveryAddressSource.ZipCode;
 }
Пример #4
0
        private void UpdateDeliveryAddressFrom(DeliveryAddressView deliveryAddressSource, DeliveryAddress deliveryAddressToUpdate)
        {
            deliveryAddressToUpdate.Name        = deliveryAddressSource.Name;
            deliveryAddressToUpdate.AddressLine = deliveryAddressSource.AddressLine;
            deliveryAddressToUpdate.City        = deliveryAddressSource.City;
            deliveryAddressToUpdate.State       = deliveryAddressSource.State;
            deliveryAddressToUpdate.Country     = deliveryAddressSource.Country;
            deliveryAddressToUpdate.ZipCode     = deliveryAddressSource.ZipCode;

            deliveryAddressToUpdate.ThrowExceptionIfInvalid();
        }
Пример #5
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());
        }
Пример #6
0
        public ActionResult AddDeliveryAddress(DeliveryAddressView deliveryAddressView)
        {
            DeliveryAddressAddRequest request = new DeliveryAddressAddRequest();

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

            _customerService.AddDeliveryAddress(request);

            return(DeliveryAddresses());
        }
Пример #7
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);
        }
Пример #8
0
        public ActionResult EditDeliveryAddress(DeliveryAddressView deliveryAddressView)
        {
            var request = new DeliveryAddressModifyRequest();

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

            _customerService.ModifyDeliveryAddress(request);

            return(DeliveryAddresses().Result);
        }
Пример #9
0
        private Address ConvertToAddress(DeliveryAddressView deliveryAddressSource)
        {
            var newAddress = new Address(deliveryAddressSource.AddressAddressLine1,
                                         deliveryAddressSource.AddressAddressLine2,
                                         deliveryAddressSource.AddressCity,
                                         deliveryAddressSource.AddressState,
                                         deliveryAddressSource.AddressCountry,
                                         deliveryAddressSource.AddressZipCode);


            return(newAddress);
        }
Пример #10
0
        public IActionResult AddDeliveryAddress()
        {
            DeliveryAddressView deliveryAddressView = new DeliveryAddressView();

            return(View("AddDeliveryAddress", deliveryAddressView));
        }