static async Task Main() { var helper = new ChannelEngineHelper(); var orders = await helper.GetOutstandingOrders(); Console.WriteLine("Found {0} orders in progress", orders.Count); Console.WriteLine(); var top5Lines = helper.TakeTopNProductsFromOrders(orders, 5); Console.WriteLine("Products in outstanding orders:"); foreach (var line in top5Lines) { Console.WriteLine("Product: {0} \t{1} \t {2} \t{3}", line.Name, line.Gtin, line.MerchantProductNumber, line.Quantity); } Console.ReadKey(); Console.WriteLine("Setting quantity for top product to 25..."); string result = await helper.UpdateStockForProduct(top5Lines[0].MerchantProductNumber, 25); Console.WriteLine(result); Console.WriteLine("... all done. Press any key to end this program."); }
public async Task <ActionResult> Details(int updateStock, string productNo) { await helper.UpdateStockForProduct(productNo, updateStock); return(Redirect("Details?merchantProductNumber=" + productNo)); }