/// <summary> /// Describes a Sell/Purchase by given request id. /// </summary> public static void sellBuyAction() { Console.WriteLine("> Please enter the Id of the request you wish to see information of:"); string Id = Console.ReadLine(); int id = inputCheck1(Id); if (id == -1) { return; } DAL.MarketClient m = new DAL.MarketClient(); DAL.DataEntries.IMarketItemQuery info = new DAL.DataEntries.MarketItemQuery(); bool flag = true; try { info = m.SendQueryBuySellRequest(id); } catch (DAL.Utils.MarketException mx) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(mx.Message.ToString()); Console.ResetColor(); flag = false; } catch (AggregateException ax) { ServerCrashError(); flag = false; } if (flag) { Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("The user that sent the request is " + info.getUser() + ", the request's type is " + info.getType() + ", the request's commodity id is " + info.getCommodity() + ", the request's price is " + info.getPrice() + ", the request's amount is " + info.getAmount()); Console.ResetColor(); } }
public static void sellBuyAction() { Console.WriteLine("please enter the Id of the request you want to see information about"); string Id = Console.ReadLine(); int id = ezer(Id); while (id == -1) { Id = Console.ReadLine(); id = ezer(Id); } DAL.MarketClient m = new DAL.MarketClient(); DAL.DataEntries.IMarketItemQuery info = new DAL.DataEntries.MarketItemQuery(); bool flag = true; try { info = m.SendQueryBuySellRequest(id); } catch (DAL.Utils.MarketException mx) { Console.WriteLine(mx.Message.ToString()); flag = false; } catch (AggregateException ax) { Console.WriteLine("The server isn't working at the momment, please try again later"); flag = false; } if (flag) { Console.WriteLine("The user that sent the request is: " + info.getUser() + ", the request's type is " + info.getType() + ", the request's commodity id is " + info.getCommodity() + ", the request's price is " + info.getPrice() + ", the request's amount is " + info.getAmount()); } }