private void cmdBaixa_Click(object sender, EventArgs e)
 {
     if (wp_Baixar)
     {
         DialogResult xSimNao = MessageBox.Show("Confirma a Baixa ?", "Atenção", MessageBoxButtons.YesNo);
         if (xSimNao == DialogResult.Yes)
         {
             CaixaGeralMovimento CaixaMov = new CaixaGeralMovimento(int.Parse(txtCaixaID.Text),
                                                                    "BAIXA",
                                                                    "REF BAIXA(CP)-ID:" + cp.Id.ToString() + " TIT. " + cp.Documento.ToString() + " - " + lblFornecedor.Text,
                                                                    decimal.Parse(txtValorPago.Text), 0);
             if (CaixaMov.Salvar(int.Parse(txtCaixaID.Text)))
             {
                 TransfereDadosClasse();
                 cp.Baixar(wp_Baixar);
             }
             else
             {
                 MessageBox.Show("Problemas na baixa, verifique !", "Erro");
                 txtValorPago.Focus();
             }
         }
     }
     else
     {
         DialogResult xSimNao = MessageBox.Show("Confirma o Estorno ?", "Atenção", MessageBoxButtons.YesNo);
         if (xSimNao == DialogResult.Yes)
         {
             TransfereDadosClasse();
             cp.Baixar(wp_Baixar);
         }
     }
 }
示例#2
0
        private void cmdBaixa_Click(object sender, EventArgs e)
        {
            if (txtValorPago.Text == "" || txtValorPago.Text != txtValorDocumento.Text)
            {
                MessageBox.Show("Informe o valor correto para Baixar o Título !");
                txtJuros.Focus();
                return;
            }
            if (wp_Baixar)
            {
                DialogResult xSimNao = MessageBox.Show("Confirma a Baixa ?", "Atenção", MessageBoxButtons.YesNo);
                if (xSimNao == DialogResult.Yes)
                {
                    CaixaGeralMovimento CaixaMov = new CaixaGeralMovimento(int.Parse(txtCaixaId.Text),
                                                                           "BAIXA", "REF BAIXA(CR)-ID:" + cp.Id.ToString() +
                                                                           " TIT. " + cp.Documento.ToString() + " - " + lblCliente.Text
                                                                           , 0, decimal.Parse(txtValorPago.Text));
                    if (CaixaMov.Salvar(int.Parse(txtCaixaId.Text)))
                    {
                        TransfereDadosClasse();
                        cp.Baixar(wp_Baixar);
                    }
                    else
                    {
                        MessageBox.Show("Problemas na baixa, verifique !", "Erro");
                        txtValorPago.Focus();
                    }

                    this.Close();
                }
            }
            else
            {
                DialogResult xSimNao = MessageBox.Show("Confirma o Estorno ?", "Atenção", MessageBoxButtons.YesNo);
                if (xSimNao == DialogResult.Yes)
                {
                    TransfereDadosClasse();
                    cp.Baixar(wp_Baixar);
                    this.Close();
                }
            }
        }