}//collect info cancel request private static void CollectInfoQueryRequst(string a) { switch (a) { case "1": //buysellquery int id; Console.WriteLine("Please enter the ID request\n"); do { id = Myconvert(Console.ReadLine()); //force the user to give legal id (only nums) }while (id == -1); MarketItemQuery data1 = client.SendQueryBuySellRequest(id); //call to Logic layer func Console.WriteLine(data1.ToString()); //print data on a certain deal break; case "2": //user query MarketUserData data2 = client.SendQueryUserRequest(); Console.WriteLine(data2.ToString()); break; case "3": //market query int commodity; Console.WriteLine("Please enter the Commodity\n"); do { commodity = Myconvert(Console.ReadLine()); //force the user to give legal commidity (only nums) }while (commodity == -1); MarketCommodityOffer data3 = client.SendQueryMarketRequest(commodity); //call to Logic layer func Console.WriteLine(data3.ToString()); break; } //switch return; } //collect info query
private void Commodity(int input) { global::Program.MarketClient marketClient = new global::Program.MarketClient(); try { MarketCommodityOffer respCommodityOffer = (MarketCommodityOffer)marketClient.SendQueryMarketRequest(input); this.textBoxOutput.Text = respCommodityOffer.ToString(); this.textBoxOutput.Visibility = Visibility.Visible; } catch { MessageBoxResult popup = MessageBox.Show("Could not fetch info about commodity #" + input, "Confirmation"); } }