private void Zoom() { CategoriaDTO categoriaDTO = dgvCategoria.Rows[selectedRowIndex].DataBoundItem as CategoriaDTO; frmCategoriaCadastrar tela = new frmCategoriaCadastrar(); tela.Zoom(categoriaDTO); tela.Show(); }
private void menu_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { if (e.ClickedItem.Text == "Cadastrar") { frmCategoriaCadastrar tela = new frmCategoriaCadastrar(); tela.Show(); Listar(); } else if (e.ClickedItem.Text == "Zoom") { Zoom(); } }
private void Alterar() { CategoriaDTO categoriaDTO = dgvCategoria.Rows[selectedRowIndex].DataBoundItem as CategoriaDTO; frmCategoriaCadastrar tela = new frmCategoriaCadastrar(); tela.Alterar(categoriaDTO); tela.Show(); string resposta = tela.Resposta; if (resposta == "Alterado") { CategoriaDTO categoriaATU = categoriaBusiness.Consultar_ID(categoriaDTO.ID_Categoria); _ = new DataGridViewRow(); DataGridViewRow row = dgvCategoria.Rows[selectedRowIndex]; row.Cells[1].Value = categoriaATU.Categoria; dgvCategoria.Refresh(); } }