private async void add_Click(object sender, EventArgs e) { try { string lcReply = new InputBox(clsBag.FACTORY_PROMPT).Answer; if (!string.IsNullOrEmpty(lcReply)) // not cancelled? { clsBag lcBag = clsBag.NewWork(lcReply[0]); if (lcBag != null) // valid bag created? { if (textBox1.Enabled) // new bag not saved? { pushData(); await ServiceClient.InsertBrandAsync(_brand); textBox1.Enabled = false; } lcBag.bag_brand_id = _brand.brand_name; frmBag.DispatchWorkForm(lcBag); if (!string.IsNullOrEmpty(lcBag.bag_name)) // not cancelled? { _Instance.UpdateDisplay(); frmMain.Instance.UpdateDisplay(); } } } } catch (Exception ex) { } }
internal async static Task <string> DeleteBagAsync(clsBag prBag) { using (HttpClient lcHttpClient = new HttpClient()) { HttpResponseMessage lcRespMessage = await lcHttpClient.DeleteAsync ($"http://localhost:60064/api/Bag/DeleteBag?Name={prBag.bag_name}"); return(await lcRespMessage.Content.ReadAsStringAsync()); } }
public void SetDetails(clsBag prBag) { _Bag = prBag; updateForm(); ShowDialog(); }
internal async static Task <string> InsertBagAsync(clsBag _Bag) { return(await InsertOrUpdateAsync(_Bag, "http://localhost:60064/api/Bag/PostBag", "POST")); }
public static void DispatchWorkForm(clsBag prBag) { _BagsForm[prBag.bag_catergory].DynamicInvoke(prBag); }