private void btnChoose_Click(object sender, EventArgs e) { frmProduct owner = (frmProduct)this.Owner; owner.SetCategoryID(txtCatID.Text); this.Close(); }
private void Products_Click(object sender, EventArgs e) { foreach (Form curForm in Application.OpenForms) { if (curForm.GetType() == typeof(frmProduct)) { curForm.Activate(); return; } } frmProduct frm = new frmProduct(); frm.MdiParent = this; frm.Dock = DockStyle.Fill; frm.Show(); }
private void btnSave_Click(object sender, EventArgs e) { if (isValidData()) { frmProduct owner = (frmProduct)this.Owner; if (isNew) { AddNewOrderDetail(); owner.LoadDataFromDatabase(); } else { UpdateOrderDetail(); owner.LoadDataFromDatabase(); } } }