예제 #1
0
 public void SetDetails(clsProduct prProduct)
 {
     _Product = prProduct;
     _IsNew   = string.IsNullOrEmpty(_Product.ProductName);
     updateForm();
     ShowDialog();
 }
        internal async static Task <string> DeleteProductAsync(clsProduct prProduct)
        {
            using (HttpClient lcHttpClient = new HttpClient())
            {
                HttpResponseMessage lcRespMessage = await lcHttpClient.DeleteAsync
                                                        ($"http://localhost:60064/api/inventory/DeleteProduct?ProductID={prProduct.ProductID}");

                return(await lcRespMessage.Content.ReadAsStringAsync());
            }
        }
예제 #3
0
        private void createNewProduct(string prType)
        {
            try
            {
                //frmNew.Run(null);
                clsProduct lcNewProduct = new clsProduct()
                {
                    DateModified = DateTime.Today
                };
                lcNewProduct.NewOrUsed = prType;
                lcNewProduct.Category  = lblCategoryName.Text;
                frmProductDetail.DispatchWorkForm(lcNewProduct);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "This should never occur");
            }

            refreshFormFromDB(_Category.Category);
            //  UpdateDisplay();
        }
예제 #4
0
 public static void Run(clsProduct prProduct)
 {
     Instance.SetDetails(prProduct);
 }
예제 #5
0
 public static void DispatchWorkForm(clsProduct prProduct)
 {
     _ProductsList[Convert.ToChar(prProduct.NewOrUsed)].DynamicInvoke(prProduct);
 }
 internal async static Task <string> InsertProductAsync(clsProduct _Product)
 {
     return(await InsertOrUpdateAsync(_Product, "http://localhost:60064/api/inventory/PostProduct", "POST"));
 }