public async Task <IActionResult> Index() { Service1.AuctionServiceClient client = new Service1.AuctionServiceClient(); var result = await client.GetAllAuctionItemsAsync(); return(View(result)); }
public async Task <IActionResult> About(string name) { Service1.AuctionServiceClient client = new Service1.AuctionServiceClient(); var result = await client.GetAllAuctionItemsAsync(); var res2 = result.Where(x => x.currentBid.bidCustomName == name); return(View("index", res2)); }
public async Task <IActionResult> Details(Service1.AuctionItem item) { Service1.AuctionServiceClient client = new Service1.AuctionServiceClient(); bool success = await client.ProvideBidAsync(item.itemNumber, item.currentBid.bidPrice, item.currentBid.bidCustomName, item.currentBid.bidCustomPhone); string x; if (success) { x = "Bid created"; } else { x = "Something went wrong"; } ViewBag.Response = x; return(View()); }
public async Task <IActionResult> Details(int id) { Service1.AuctionServiceClient client = new Service1.AuctionServiceClient(); var result = await client.GetAllAuctionItemsAsync(); var singleItem = result.Where(x => x.itemNumber == id).SingleOrDefault(); if (singleItem != null) { return(View(singleItem)); } else { Response.Redirect("/"); } return(View()); }