Exemple #1
0
        private void bEstornar_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtLotid.Text.Length == 0)
                {
                    DialogHelper.Alerta("Selecione um pagamento para estornar o pagamento");
                    dgvLotes.Focus();
                    //
                }
                else
                {
                    if (DialogHelper.Confirmacao("Confirma estorno do pagamento?"))
                    {
                        if (receberRepository.EstornarRecebimento(Receber))
                        {
                            txtLotid.Text      = "";
                            txtValorPago.Text  = "";
                            txtValorTotal.Text = "";
                            var selec = cbbCliente.SelectedIndex;
                            bFiltro.PerformClick();
                            cbbCliente.SelectedIndex = selec;
                            dgvLotes.Rows.RemoveAt(pos);

                            DialogHelper.Informacao("Estorno concluído");
                            LimparLabels();
                        }
                        else
                        {
                            DialogHelper.Erro("Erro!");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }