Beispiel #1
0
 private void BtnNovo_Click(object sender, EventArgs e)
 {
     StaFormEdicao = true;
     Paginas.SelectTab(1);
     LimpaDados();
     FrmPrincipal.ControleBotoes(true);
     TxtAgente.Focus();
 }
Beispiel #2
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()));
         StaFormEdicao = true;
         FrmPrincipal.ControleBotoes(true);
         TxtAgente.Focus();
     }
 }
Beispiel #3
0
 private void BtnGravar_Click(object sender, EventArgs e)
 {
     if (TxtAgente.Text.Trim() != "")
     {
         AgCobrador.IdAgente = int.Parse(TxtCodigo.Text);
         AgCobrador.Agente   = TxtAgente.Text;
         AgCobrador.GravarDados();
         PopularGrid();
         PopularCampos(AgCobrador.IdAgente);
         StaFormEdicao = false;
         FrmPrincipal.ControleBotoes(false);
     }
     else
     {
         MessageBox.Show("Agente não Informada", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         TxtAgente.Focus();
     }
 }