예제 #1
0
 private void BtnEditar_Click(object sender, EventArgs e)
 {
     if (GridDados.CurrentRow == null)
     {
         Paginas.SelectTab(0);
         MessageBox.Show("Não existe Registro para Edição", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     else
     {
         PopularCampos(int.Parse(GridDados.CurrentRow.Cells[0].Value.ToString()));
         Genero.IncReg = false;
         StaFormEdicao = true;
         FrmPrincipal.ControleBotoes(true);
         TxtGenero.Focus();
     }
 }
예제 #2
0
 private void BtnGravar_Click(object sender, EventArgs e)
 {
     if (TxtGenero.Text.Trim() != "")
     {
         Genero.IdGenero = int.Parse(TxtCodigo.Text);
         Genero.Genero   = TxtGenero.Text;
         Genero.GravarDados();
         PopularGrid();
         PopularCampos(Genero.IdGenero);
         StaFormEdicao = false;
         FrmPrincipal.ControleBotoes(false);
     }
     else
     {
         MessageBox.Show("Genero não Informado", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         TxtGenero.Focus();
     }
 }