private void sfButton1_Click(object sender, EventArgs e) { if (gridView.SelectedRows.Count > 0) { if (typeForm == "NewForm") { string code = gridView.SelectedRows[0].Cells[1].Value.ToString(); NewForm parentForm = new NewForm(username); ((NewForm)this.Owner).btnRoleClick(code); this.Close(); } else if (typeForm == "EditForm") { string code = gridView.SelectedRows[0].Cells[1].Value.ToString(); EditForm parentForm = new EditForm(username, this.id); ((EditForm)this.Owner).btnRoleClick(code); this.Close(); } } else { MessageBox.Show("Pilih transaksi yang akan ditambahkan!"); } }