public void SetDetails(clsInventory prInventory) { _Inventory = prInventory; _ValidationErrors = new List <string>(); UpdateForm(); ShowDialog(); }
private void btnAddInventory_Click(object sender, EventArgs e) { try { string lcReply = new InputBox(clsInventory.FACTORY_PROMPT, clsInventory.ItemCategories).Answer; clsInventory lcInventory = clsInventory.NewInventory(lcReply); if (!string.IsNullOrEmpty(lcReply)) // not cancelled? { if (lcInventory != null) //valid inventory created? { lcInventory.branchCode = _Branch.branchCode; frmInventory.DispatchInventoryForm(lcInventory); if (!string.IsNullOrEmpty(lcInventory.description)) // not cancelled? { refreshFormFromDB(_Branch.branchCode); UpdateDisplay(); } } } } catch (Exception ex) { MessageBox.Show(ex.Message + "\n" + ex.StackTrace); } }
private async void btnDeleteInventory_Click(object sender, EventArgs e) { int lcIndex = lstBoxInventory.SelectedIndex; if (lcIndex >= 0 && MessageBox.Show("are you sure?", "deleting inventory", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { clsInventory lcInventory = lstBoxInventory.SelectedValue as clsInventory; try { MessageBox.Show(await ServiceClient.DeleteInventoryAsync(lcInventory.itemID)); refreshFormFromDB(_Branch.branchCode); frmMain.Instance.UpdateDisplay(); } catch (Exception ex) { MessageBox.Show(ex.Message + "\n" + ex.StackTrace); } } }
public static void DispatchInventoryForm(clsInventory prInventory) { _InventoryForm[prInventory.category].DynamicInvoke(prInventory); }
internal static async Task <string> UpdateInventoryAsync(clsInventory prInventory) { return(await InsertOrUpdateAsync(prInventory, "http://localhost:60064/api/bshop/PutInventory", "PUT")); }