Example #1
0
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         if (verificaCampos())
         {
             usuario u = new usuario
             {
                 id    = (int)dataGridView1.CurrentRow.Cells[0].Value,
                 user  = txt_user.Text,
                 senha = txt_senha.Text,
                 tipo  = cb_tipo.Text
             };
             usuarioDAO udao = new usuarioDAO();
             udao.altera(u);
             uc_usuarios_Load(null, null);
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Erro ao alterar");
     }
 }