private void commandButtonAdd_Click(object sender, EventArgs e) { Master.frmPromoAddEdit ifrmChild = new Master.frmPromoAddEdit(this); ifrmChild.MdiParent = Program.MainForm; Program.MainForm.RegisterChild(ifrmChild); ifrmChild.Show(); }
private void commandButtonEdit_Click(object sender, EventArgs e) { if (DataGridViewPromo.SelectedCells.Count > 0) { Guid rowID = (Guid)DataGridViewPromo.SelectedCells[0].OwningRow.Cells["RowID"].Value; Master.frmPromoAddEdit ifrmChild = new Master.frmPromoAddEdit(this, rowID); ifrmChild.MdiParent = Program.MainForm; Program.MainForm.RegisterChild(ifrmChild); ifrmChild.Show(); } else { MessageBox.Show(Messages.Error.RowNotSelected); } }