Beispiel #1
0
 public void SetDetails(clsInventory prInventory)
 {
     _Inventory        = prInventory;
     _ValidationErrors = new List <string>();
     UpdateForm();
     ShowDialog();
 }
Beispiel #2
0
 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);
     }
 }
Beispiel #3
0
        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);
                }
            }
        }
Beispiel #4
0
 public static void DispatchInventoryForm(clsInventory prInventory)
 {
     _InventoryForm[prInventory.category].DynamicInvoke(prInventory);
 }
Beispiel #5
0
 internal static async Task <string> UpdateInventoryAsync(clsInventory prInventory)
 {
     return(await InsertOrUpdateAsync(prInventory, "http://localhost:60064/api/bshop/PutInventory", "PUT"));
 }