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()); } }
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(); }
public static void Run(clsProduct prProduct) { Instance.SetDetails(prProduct); }
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")); }