Esempio n. 1
0
        private void mnuNovo_Click(object sender, EventArgs e)
        {
            var frm = new FormCadastroUsuario();

            if (frm.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            CarregarGridView();
        }
Esempio n. 2
0
 private void btnEditar_Click(object sender, EventArgs e)
 {
     if (gridView.SelectedRows.Count > 0)
     {
         var id  = Convert.ToInt32(gridView.SelectedRows[0].Cells[0].Value);
         var obj = new UsuarioDAO().BuscarPorId(id);
         var frm = new FormCadastroUsuario(obj);
         if (frm.ShowDialog() != DialogResult.OK)
         {
             return;
         }
     }
 }
Esempio n. 3
0
 private void Editar()
 {
     if (gridView.SelectedRows.Count > 0)
     {
         var id  = Convert.ToInt32(gridView.SelectedRows[0].Cells[0].Value);
         var obj = new UsuarioDAO().BuscarPorId(id);
         var frm = new FormCadastroUsuario(obj);
         if (frm.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         CarregarGridView();
     }
 }