private void BtnNovo_Click(object sender, EventArgs e) { StaFormEdicao = true; Paginas.SelectTab(1); LimpaDados(); FrmPrincipal.ControleBotoes(true); TxtFormaPgto.Focus(); }
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); TxtFormaPgto.Focus(); } }
private void BtnGravar_Click(object sender, EventArgs e) { if (TxtFormaPgto.Text.Trim() != "") { FormaPgto.IdFormaPgto = int.Parse(TxtCodigo.Text); FormaPgto.FormaPgto = TxtFormaPgto.Text; FormaPgto.NumParcelas = int.Parse(TxtNumParcelas.Value.ToString()); FormaPgto.PrimParcela = int.Parse(TxtPrimParcela.Value.ToString()); FormaPgto.Intervalo = int.Parse(TxtIntervalo.Value.ToString()); FormaPgto.IdTpDocumento = int.Parse(LstTipoDoc.SelectedValue.ToString()); FormaPgto.IdServidor = int.Parse(TxtIdServidor.Value.ToString()); FormaPgto.VlrParcelamento = TxtVlrParc.Value; if (Cb_Financeiro.Checked) { FormaPgto.Financeiro = 1; } else { FormaPgto.Financeiro = 0; } if (Cb_Baixa.Checked) { FormaPgto.Baixa = 1; } else { FormaPgto.Baixa = 0; } if (Cb_VerDebito.Checked) { FormaPgto.VerDebito = 1; } else { FormaPgto.VerDebito = 0; } if (Cb_VerCredito.Checked) { FormaPgto.VerCredito = 1; } else { FormaPgto.VerCredito = 0; } if (Chk_Ativo.Checked) { FormaPgto.Ativo = 1; } else { FormaPgto.Ativo = 0; } if (Cb_BloqPF.Checked) { FormaPgto.BloqPF = 1; } else { FormaPgto.BloqPF = 0; } if (Cb_LibClieNovo.Checked) { FormaPgto.LibClieNovo = 1; } else { FormaPgto.LibClieNovo = 0; } FormaPgto.Desconto = TxtDesconto.Value; FormaPgto.GravarDados(); PopularGrid(); PopularCampos(FormaPgto.IdFormaPgto); StaFormEdicao = false; FrmPrincipal.ControleBotoes(false); } else { MessageBox.Show("FormaPgto não Informada", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); TxtFormaPgto.Focus(); } }