示例#1
0
        private void PopulaListaPagos()
        {
            int cont = 0;

            lstUltPagamento.Items.Clear();
            PagamentoDAL     pDal = new PagamentoDAL();
            List <Pagamento> list = pDal.RetornaReceitaPagaBySocio(int.Parse(lblIdSocio.Text));

            foreach (Pagamento p in list)
            {
                cont += 1;
                ListViewItem item;
                item      = new ListViewItem();
                item.Text = p.DataPagamento.ToString().Substring(0, 10);
                item.SubItems.Add(p.Valor.ToString("F2"));
                item.SubItems.Add(p.ValorPago.ToString("F2"));
                item.SubItems.Add(p.Documento.ToString());
                item.SubItems.Add(p.DataVencimento.ToString().Substring(0, 10));
                item.SubItems.Add(p.Desconto.ToString("F2"));
                item.SubItems.Add(p.Juros.ToString("F2"));
                item.SubItems.Add(p.ValorDescJuros.ToString("F2"));
                item.SubItems.Add(p.ObsPagamento.ToString());
                lstUltPagamento.Items.Add(item);
            }
            lblPagamentos.Text = cont.ToString();
        }
 public static List <Pagamento> ConsultarPorID(int id)
 {
     try
     {
         return(PagamentoDAL.ConsultarPorID(id));
     }
     catch (Exception)
     {
         throw;
     }
 }
 public static List <Pagamento> ConsultarTodos()
 {
     try
     {
         return(PagamentoDAL.ConsultarPorCategoria(""));
     }
     catch (Exception)
     {
         throw;
     }
 }
 public static List <Pagamento> ConsultarPorCategoria(string categoria)
 {
     try
     {
         return(PagamentoDAL.ConsultarPorCategoria(categoria));
     }
     catch (Exception)
     {
         throw;
     }
 }
 public IList <ViewFinLancamentoPagarDTO> selectViewFinLancamentoPagarPagina(int primeiroResultado, int quantidadeResultados, ViewFinLancamentoPagarDTO ViewFinLancamentoPagar)
 {
     try
     {
         IList <ViewFinLancamentoPagarDTO> resultado = null;
         using (ISession session = NHibernateHelper.getSessionFactory().OpenSession())
         {
             PagamentoDAL DAL = new PagamentoDAL(session);
             resultado = DAL.selectPagina(primeiroResultado, quantidadeResultados, ViewFinLancamentoPagar);
         }
         return(resultado);
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : ""));
     }
 }
 public ViewFinLancamentoPagarDTO salvarAtualizarViewFinLancamentoPagar(ViewFinLancamentoPagarDTO ViewFinLancamentoPagar)
 {
     try
     {
         using (ISession session = NHibernateHelper.getSessionFactory().OpenSession())
         {
             PagamentoDAL DAL = new PagamentoDAL(session);
             DAL.saveOrUpdate(ViewFinLancamentoPagar);
             session.Flush();
         }
         return(ViewFinLancamentoPagar);
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message + (ex.InnerException != null ? " " + ex.InnerException.Message : ""));
     }
 }
示例#7
0
        private void cmdBaixar_Click(object sender, EventArgs e)
        {
            if (lblIdParcela.Text.Equals("identificador"))
            {
                MessageBox.Show("Selecione a mensalidade", "Mensagem");
                return;
            }
            if (mskDataPagamentoBaixa.Text == "  /  /")
            {
                MessageBox.Show("Informe a data de pagamento.", "Mensagem");
                return;
            }
            bool         gravou = false;
            PagamentoDAL pDAL   = new PagamentoDAL();

            try
            {
                Pagamento p = new Pagamento()
                {
                    Documento      = long.Parse(txtDocumentoBaixa.Text),
                    DataVencimento = DateTime.Parse(mskVencimentoBaixa.Text),
                    Valor          = double.Parse(txtValorBaixa.Text),
                    Desconto       = double.Parse(txtDescontoBaixa.Text),
                    Juros          = double.Parse(txtJurosBaixa.Text),
                    ValorDescJuros = double.Parse(txtValorDescJurosBaixa.Text),
                    ValorPago      = double.Parse(txtValorPagoBaixa.Text),
                    DataPagamento  = DateTime.Parse(mskDataPagamentoBaixa.Text),
                    ObsPagamento   = txtObsPagamentoBaixa.Text,
                    IdSocio        = int.Parse(lblIdSocio.Text),
                    IdReceita      = int.Parse(lblIdParcela.Text)
                };
                gravou = pDAL.InsertPagamento(p);
            }
            catch (SystemException ex)
            {
                string exception = ex.Message.ToString();
                gravou = false;
                frmTDM_Menssagem frmErro = new frmTDM_Menssagem("Revise os dados", 2, exception);
                frmErro.ShowDialog();
            }
            if (gravou)
            {
                try
                {
                    gravou = pDAL.UpdateReceita(long.Parse(lblIdParcela.Text));
                    frmTDM_Menssagem frmSucesso = new frmTDM_Menssagem("Cadastrado com sucesso!", 1, "");
                    frmSucesso.ShowDialog();
                    PopulaLista();
                    PopulaListaPagos();

                    DialogResult dr = new DialogResult();
                    dr = MessageBox.Show("Deseja imprimir comprovante de pagamento?", "Mensagem", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (dr == DialogResult.Yes)
                    {
                        InitializeReport();
                        AbreHTML();
                        Cabecalho();
                        FechaHTML();
                        Process.Start(path);
                        LimparBaixa();
                    }
                    else
                    {
                        LimparBaixa();
                    }
                }
                catch (SystemException ex)
                {
                    string exception = ex.Message.ToString();
                    gravou = false;
                    frmTDM_Menssagem frmErro = new frmTDM_Menssagem("Revise os dados", 2, exception);
                    frmErro.ShowDialog();
                }
            }
        }
 public PagamentoBLL()
 {
     _DAL = new PagamentoDAL();
 }