public DataTable GetExpenses(GetExpenses request)
        {
            List <SqlParameter> parameters = new List <SqlParameter>();

            parameters.Add(new SqlParameter()
            {
                DbType = DbType.Date, ParameterName = "fromDate", Value = request.FromDate
            });
            parameters.Add(new SqlParameter()
            {
                DbType = DbType.Date, ParameterName = "toDate", Value = request.ToDate
            });
            parameters.Add(new SqlParameter()
            {
                DbType = DbType.Int32, ParameterName = "accountId", Value = request.AccountId
            });

            DataSet ds = SQLHelper.ExecuteProcedure("HomeTransactions", "GetHomeTransactions", CommandType.StoredProcedure, parameters);

            if (ds != null)
            {
                return(ds.Tables[0]);
            }
            return(null);
        }
Esempio n. 2
0
        public async Task <IActionResult> GetExpenses()
        {
            var query  = new GetExpenses();
            var result = await Mediator.Send(query);

            return(FromResult(result));
        }
Esempio n. 3
0
 public ExpenseTracker GetBudget(GetExpenses request)
 {
     try
     {
         return(MapBudget((new ExpensesTrackerDataAccess()).GetBudget(request)));
     }
     catch (Exception ex)
     {
     }
     return(null);
 }
Esempio n. 4
0
 public List <Expenses> GetExpenses(GetExpenses request)
 {
     try
     {
         return(MapExpenses((new ExpensesTrackerDataAccess()).GetExpenses(request)));
     }
     catch (Exception ex)
     {
     }
     return(null);
 }
Esempio n. 5
0
        public async Task <RequestResult <ExpenseDto> > Handle(GetExpenses request, CancellationToken cancellationToken)
        {
            var result = new RequestResult <ExpenseDto>();

            var expenses = ExpenseRepository
                           .GetAllWithUsers();

            result.SetCollection(Mapper.Map <List <ExpenseDto> >(expenses));

            return(result);
        }
Esempio n. 6
0
        public HttpResponseMessage GetBudget(GetExpenses request)
        {
            ExpenseTracker result = new ExpensesTrackerRepository().GetBudget(request);

            return(Request.CreateResponse(HttpStatusCode.OK, result));
        }
Esempio n. 7
0
        public HttpResponseMessage GetTransaction(GetExpenses request)
        {
            List <Expenses> result = new ExpensesTrackerRepository().GetExpenses(request);

            return(Request.CreateResponse(HttpStatusCode.OK, result));
        }