Exemple #1
0
        public Saldo GetSaldo(SaldoFilter filter)
        {
            Saldo saldo = new Saldo();

            saldo.Estatisticas = GetEstatisticas(filter);
            saldo.SaldoContas  = ListSaldoContas(filter).ToList();

            return(saldo);
        }
Exemple #2
0
        public GenericResult <IEnumerable <SaldoConta> > ListSaldoContas(SaldoFilter filter)
        {
            GenericResult <IEnumerable <SaldoConta> > result = new GenericResult <IEnumerable <SaldoConta> >();

            try
            {
                result.Result = service.ListSaldoContas(filter);
            }
            catch (Exception ex)
            {
                result.Errors = new string[] { ex.Message };
            }

            return(result);
        }
Exemple #3
0
        public GenericResult <Estatisticas> GetEstatisticas(SaldoFilter filter)
        {
            GenericResult <Estatisticas> result = new GenericResult <Estatisticas>();

            try
            {
                result.Result = service.GetEstatisticas(filter);
            }
            catch (Exception ex)
            {
                result.Errors = new string[] { ex.Message };
            }

            return(result);
        }
Exemple #4
0
        public IEnumerable <SaldoConta> ListSaldoContas(SaldoFilter filter)
        {
            var result          = connection.Query("Exec GetListSaldoConta @todasConta, @text", filter);
            var listSaldoContas = new List <SaldoConta>();

            foreach (var row in result)
            {
                SaldoConta saldo = new SaldoConta();

                saldo.Conta        = contaRep.GetById(row.contaId);
                saldo.TotalVendido = row.totalVendido;
                saldo.Saldo        = row.saldo;

                listSaldoContas.Add(saldo);
            }

            return(listSaldoContas);
        }
Exemple #5
0
        public Estatisticas GetEstatisticas(SaldoFilter filter)
        {
            var result = connection.QueryFirstOrDefault <Estatisticas>("Exec GetEstatisticas @todasConta, @text", filter);

            return(result);
        }
Exemple #6
0
 public GenericResult <IEnumerable <SaldoConta> > ListSaldoContas([FromBody] SaldoFilter filter)
 {
     return(appService.ListSaldoContas(filter));
 }
Exemple #7
0
 public GenericResult <Estatisticas> GetEstatisticas([FromBody] SaldoFilter filter)
 {
     return(appService.GetEstatisticas(filter));
 }