private void btnInsert_Click(object sender, EventArgs e) { switch (currenTagPage) { case TabPage.tabPageCustomers: if (myfrmCustomers == null || myfrmCustomers.IsDisposed) { myfrmCustomers = new frmCustomers(myBusiness); myfrmCustomers.MdiParent = this.MdiParent; } //myfrmCustomers.Text = "Maintenance for " + this.Text; myfrmCustomers.Show(); break; case TabPage.tabPageEmployees: if (myfrmEmployees == null || myfrmEmployees.IsDisposed) { myfrmEmployees = new frmEmployees(myBusiness); myfrmEmployees.MdiParent = this.MdiParent; } //myfrmEmployees.Text = "Maintenance for " + this.Text; myfrmEmployees.Show(); break; case TabPage.tabPageProducts: if (myfrmProducts == null || myfrmProducts.IsDisposed) { myfrmProducts = new frmProducts(myBusiness); myfrmProducts.MdiParent = this.MdiParent; } //myfrmProducts.Text = "Maintenance for " + this.Text; myfrmProducts.Show(); break; case TabPage.tabPageShippers: if (myfrmShippers == null || myfrmShippers.IsDisposed) { myfrmShippers = new frmShippers(myBusiness); myfrmShippers.MdiParent = this.MdiParent; } //myfrmShippers.Text = "Maintenance for " + this.Text; myfrmShippers.Show(); break; case TabPage.tabPageSuppliers: if (myfrmSuppliers == null || myfrmSuppliers.IsDisposed) { myfrmSuppliers = new frmSuppliers(myBusiness); myfrmSuppliers.MdiParent = this.MdiParent; } //myfrmSuppliers.Text = "Maintenance for " + this.Text; myfrmSuppliers.Show(); break; case TabPage.tabPageCategories: if (myfrmCategories == null || myfrmCategories.IsDisposed) { myfrmCategories = new frmCategories(myBusiness); myfrmCategories.MdiParent = this.MdiParent; } //myfrmCategories.Text = "Maintenance for " + this.Text; myfrmCategories.Show(); break; } }
private void addNewCustomerToolStripMenuItem_Click(object sender, EventArgs e) { if (myfrmCustomers == null || myfrmCustomers.IsDisposed) { myfrmCustomers = new frmCustomers(this.business); myfrmCustomers.MdiParent = this; } myfrmCustomers.Show(); }
private void dgCustomers_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == dgCustomers.Columns["ColCustomerEdit"].Index && e.RowIndex >= 0) { if (myfrmCustomers == null || myfrmCustomers.IsDisposed) { int index = e.RowIndex; String EditingItemID = (String)dgCustomers.Rows[index].Cells[1].Value; myfrmCustomers = new frmCustomers(EditingItemID, myBusiness); myfrmCustomers.MdiParent = this.MdiParent; } myfrmCustomers.Show(); } }