private void btnAddCategory_Click(object sender, EventArgs e) { Form f = Application.OpenForms["frmAddCategory"]; if (f == null) { forBrowseCategoryVO.setFunctionFor = 1; frmAddCategory fac = new frmAddCategory(); fac.Text = "Add categoryr"; fac.MdiParent = MdiParent; fac.Show(); } else { MessageBox.Show("The Add Category Form is Already Opened!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void frmAddItem_Load(object sender, EventArgs e) { if (forAddItemDAO.toRetrieveItemCategory() == 2) { DialogResult dialogresult = MessageBox.Show("Please Insert Item Category First", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); if (dialogresult == DialogResult.OK) { Form f = Application.OpenForms["frmAddCategory"]; if (f == null) { frmAddCategory fac = new frmAddCategory(); fac.MdiParent = MdiParent; fac.Show(); } } } }
private void lvCategory_DoubleClick(object sender, EventArgs e) { if (lvCategory.SelectedItems.Count != 0) { Form f = Application.OpenForms["frmAddCategory"]; if (f == null) { forBrowseCategoryVO.setFunctionFor = 2; frmAddCategory fac = new frmAddCategory(); fac.Text = "Edit Category"; fac.MdiParent = MdiParent; fac.Show(); } else { MessageBox.Show("The Edit Category Form is Already Opened!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }