Esempio n. 1
0
        private async void ItemName_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter && ItemName.TextLength > 0)
            {
                inventoryItemBindingSource.DataSource = await InventoryManager.GetItemStockAsync(ItemName.Text);

                bindingSource1.DataSource = await InventoryManager.GetItemCheckInsAsync(ItemName.Text);

                bindingSource2.DataSource = await InventoryManager.GetItemCheckOutsAsync(ItemName.Text);

                Current.ClearSelection();
                InventoryIn.ClearSelection();
                InventoryOut.ClearSelection();
                IsTime = true;
            }
        }
Esempio n. 2
0
        private async void Current_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Delete && e.Shift && Login.Role != "Operator")
            {
                DataGridViewRow row = Current.CurrentRow;
                if (row != null)
                {
                    InventoryItem item = inventoryItemBindingSource.List[row.Index] as InventoryItem;
                    InventoryManager.DeleteInventoryItem(item);
                    MessageBox.Show($"{item.ItemName} was successfully deleted.", ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    inventoryItemBindingSource.DataSource = await InventoryManager.GetItemStockAsync(ItemName.Text);

                    bindingSource1.DataSource = await InventoryManager.GetItemCheckInsAsync(ItemName.Text);

                    bindingSource2.DataSource = await InventoryManager.GetItemCheckOutsAsync(ItemName.Text);

                    Current.ClearSelection();
                    InventoryIn.ClearSelection();
                    InventoryOut.ClearSelection();
                }
            }
        }