예제 #1
0
        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)
            {
            }
        }
예제 #2
0
        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());
            }
        }
예제 #3
0
 public void SetDetails(clsBag prBag)
 {
     _Bag = prBag;
     updateForm();
     ShowDialog();
 }
예제 #4
0
 internal async static Task <string> InsertBagAsync(clsBag _Bag)
 {
     return(await InsertOrUpdateAsync(_Bag, "http://localhost:60064/api/Bag/PostBag", "POST"));
 }
예제 #5
0
 public static void DispatchWorkForm(clsBag prBag)
 {
     _BagsForm[prBag.bag_catergory].DynamicInvoke(prBag);
 }