public ActionResult RemoveAddress(int addressid) { var address = CustomerAddress.FromDto(_getCustomerAddress.GetCustomerAddressById(addressid)); var customerId = address.CustomerId; _deleteCustomerAddress.Delete(address); var customerDTO = CustomerDTO.FromCustomer(_getCustomer.GetById(customerId)); return(View("ManageAccount", customerDTO)); }
public CheckoutSummaryDTO GetCheckoutSummary(int newOrderId) { var order = _getOrder.GetById(newOrderId); var customer = _getCustomer.GetById(order.CustomerId); var orderItems = _getOrderItems.Get(newOrderId).Select(oi => new OrderItemDTO() { Quantity = oi.Quantity, Description = oi.Description, Price = oi.Price, ProductId = oi.ProductId, Status = oi.Status, OrderId = oi.OrderId }); return(new CheckoutSummaryDTO { OrderNumber = newOrderId.ToString("000000000"), DeliveryUpToNWorkingDays = 4, Total = order.TotalPrice, CustomerInfo = CustomerDTO.FromCustomer(customer), DeliveryAddress = _getCustomerAddress.GetCustomerAddressById(order.DeliveryAddressId), PaymentOption = _getPaymentOption.GetPaymentOptionById(order.PaymentOptionId), OrderItems = orderItems }); }