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); }
public async Task <IActionResult> GetExpenses() { var query = new GetExpenses(); var result = await Mediator.Send(query); return(FromResult(result)); }
public ExpenseTracker GetBudget(GetExpenses request) { try { return(MapBudget((new ExpensesTrackerDataAccess()).GetBudget(request))); } catch (Exception ex) { } return(null); }
public List <Expenses> GetExpenses(GetExpenses request) { try { return(MapExpenses((new ExpensesTrackerDataAccess()).GetExpenses(request))); } catch (Exception ex) { } return(null); }
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); }
public HttpResponseMessage GetBudget(GetExpenses request) { ExpenseTracker result = new ExpensesTrackerRepository().GetBudget(request); return(Request.CreateResponse(HttpStatusCode.OK, result)); }
public HttpResponseMessage GetTransaction(GetExpenses request) { List <Expenses> result = new ExpensesTrackerRepository().GetExpenses(request); return(Request.CreateResponse(HttpStatusCode.OK, result)); }