Removed unused methods.

This commit is contained in:
David Britch 2017-10-25 16:56:38 +01:00
parent 03e61fae9d
commit 771962f054
3 changed files with 4 additions and 43 deletions

View File

@ -10,7 +10,6 @@ namespace eShopOnContainers.Core.Services.Order
Task CreateOrderAsync(Models.Orders.Order newOrder, string token);
Task<ObservableCollection<Models.Orders.Order>> GetOrdersAsync(string token);
Task<Models.Orders.Order> GetOrderAsync(int orderId, string token);
Task<ObservableCollection<Models.Orders.CardType>> GetCardTypesAsync(string token);
Task<bool> CancelOrderAsync(int orderId, string token);
BasketCheckout MapOrderToBasket(Models.Orders.Order order);
}

View File

@ -55,15 +55,8 @@ namespace eShopOnContainers.Core.Services.Order
private static List<OrderItem> MockOrderItems = new List<OrderItem>()
{
new OrderItem { OrderId = Guid.NewGuid(), ProductId = Common.Common.MockCatalogItemId01, Discount = 15, ProductName = ".NET Bot Blue Sweatshirt (M)", Quantity = 1, UnitPrice = 16.50M, PictureUrl = Device.RuntimePlatform != Device.Windows ? "fake_product_01.png" : "Assets/fake_product_01.png" },
new OrderItem { OrderId = Guid.NewGuid(), ProductId = Common.Common.MockCatalogItemId03, Discount = 0, ProductName = ".NET Bot Black Sweatshirt (M)", Quantity = 2, UnitPrice = 19.95M, PictureUrl = Device.RuntimePlatform != Device.Windows ? "fake_product_03.png" : "Assets/fake_product_03.png" }
};
private static List<CardType> MockCardTypes = new List<CardType>()
{
new CardType { Id = 1, Name = "Amex" },
new CardType { Id = 2, Name = "Visa" },
new CardType { Id = 3, Name = "MasterCard" },
new OrderItem { OrderId = Guid.NewGuid(), ProductId = Common.Common.MockCatalogItemId01, Discount = 15, ProductName = ".NET Bot Blue Sweatshirt (M)", Quantity = 1, UnitPrice = 16.50M, PictureUrl = Device.RuntimePlatform != Device.Windows ? "fake_product_01.png" : "Assets/fake_product_01.png" },
new OrderItem { OrderId = Guid.NewGuid(), ProductId = Common.Common.MockCatalogItemId03, Discount = 0, ProductName = ".NET Bot Black Sweatshirt (M)", Quantity = 2, UnitPrice = 19.95M, PictureUrl = Device.RuntimePlatform != Device.Windows ? "fake_product_03.png" : "Assets/fake_product_03.png" }
};
private static BasketCheckout MockBasketCheckout = new BasketCheckout()
@ -114,19 +107,9 @@ namespace eShopOnContainers.Core.Services.Order
}
}
public async Task<ObservableCollection<CardType>> GetCardTypesAsync(string token)
{
await Task.Delay(500);
if (!string.IsNullOrEmpty(token))
return MockCardTypes.ToObservableCollection();
else
return new ObservableCollection<CardType>();
}
public BasketCheckout MapOrderToBasket(Models.Orders.Order order)
{
return MockBasketCheckout;
return MockBasketCheckout;
}
public Task<bool> CancelOrderAsync(int orderId, string token)

View File

@ -34,7 +34,7 @@ namespace eShopOnContainers.Core.Services.Order
await _requestProvider.GetAsync<ObservableCollection<Models.Orders.Order>>(uri, token);
return orders;
}
public async Task<Models.Orders.Order> GetOrderAsync(int orderId, string token)
@ -58,27 +58,6 @@ namespace eShopOnContainers.Core.Services.Order
}
}
public async Task<ObservableCollection<Models.Orders.CardType>> GetCardTypesAsync(string token)
{
try
{
UriBuilder builder = new UriBuilder(GlobalSetting.Instance.OrdersEndpoint);
builder.Path = "api/v1/orders/cardtypes";
string uri = builder.ToString();
ObservableCollection<Models.Orders.CardType> cardTypes =
await _requestProvider.GetAsync<ObservableCollection<Models.Orders.CardType>>(uri, token);
return cardTypes;
}
catch
{
return new ObservableCollection<Models.Orders.CardType>();
}
}
public BasketCheckout MapOrderToBasket(Models.Orders.Order order)
{
return new BasketCheckout()