public SellItemDialogForm(MarketForm market, MarketRecord record, int amount) { InitializeComponent(); this.Market = market; this.Item = record; this.Amount = amount; }
public string ReturnItem(MarketForm market, string username, int id, int amount, int price) { using (var wc = new WebClient() { Proxy = null }) { wc.Headers = new WebHeaderCollection(); wc.Headers.Set("password", this.ClientPassword); return(wc.DownloadString($"{APIEndpoint}/api/v1/request/return/{username}/{id}/{amount}/{price}")); } }
public string PurchaseItem(MarketForm market, string buyer, string seller, int id, int amount, int price) { using (var wc = new WebClient() { Proxy = null }) { wc.Headers = new WebHeaderCollection(); wc.Headers.Set("password", this.ClientPassword); return(wc.DownloadString($"{APIEndpoint}/api/v1/request/purchase/{buyer}/{seller}/{id}/{amount}/{price}")); } }
public Shop LoadShop(MarketForm market, string seller) { using (var wc = new WebClient() { Proxy = null }) { var response = wc.DownloadString($"{APIEndpoint}/api/v1/index/username/{seller}"); try { var deserialized = JsonConvert.DeserializeObject <MarketRecord[]>(response); return(new Shop(seller, deserialized)); } catch { MessageBox.Show($"Unable to complete request. (response: {response}"); } } return(null); }