private void checkInventoryToolStripMenuItem_Click(object sender, EventArgs e) { Form f = Application.OpenForms["frmInventoryCheck"]; if (f == null) { frmInventoryCheck fic = new frmInventoryCheck(); fic.MdiParent = MdiParent; fic.Show(); } else { MessageBox.Show("Add Inventory Check Form is Already Open", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void txtItemCode_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (forTransactionDAO.toRetrieveItem(txtItemCode.Text)) { if (forTransactionVO.getItemQuantity > Convert.ToInt32(txtQuantity.Text)) { double totalPrice = (forTransactionVO.getPriceAt) * (Convert.ToInt32(txtQuantity.Text)); ListViewItem lv = new ListViewItem(txtItemCode.Text); lv.SubItems.Add(forTransactionVO.getItemName); lv.SubItems.Add(txtQuantity.Text); lv.SubItems.Add(forTransactionVO.getPriceAt.ToString()); lv.SubItems.Add(totalPrice.ToString()); lvItemList.Items.Add(lv); grandTotal = grandTotal + totalPrice; txtItemCode.Clear(); lblTotalContent.Text = grandTotal.ToString(); txtQuantity.Text = "1"; } else { DialogResult dialog = MessageBox.Show("The item you trasact is out of stock\nPlease check the inventory\nDo you want to check?", "Information", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dialog == DialogResult.Yes) { Form f = Application.OpenForms["frmInventoryCheck"]; if (f == null) { frmInventoryCheck fic = new frmInventoryCheck(); fic.MdiParent = MdiParent; fic.Show(); } else { MessageBox.Show("The Item Check Form is Already Opened", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } } } }