private void btAdicionar_Click(object sender, EventArgs e) { CadastroServico tela = new CadastroServico(); tela.FormClosed += Tela_FormClosed; tela.MdiParent = this.MdiParent; tela.Show(); }
private void btAlterar_Click(object sender, EventArgs e) { if (dgServico.SelectedRows.Count == 0) { MessageBox.Show("Selecione um serviço"); return; } long servicoId = (long)dgServico.SelectedRows[0].Cells[0].Value; CadastroServico tela = new CadastroServico(); tela.FormClosed += Tela_FormClosed; tela.ServicoId = servicoId; tela.MdiParent = this.MdiParent; tela.Show(); }