Example #1
0
        public PaginationModel <TradesExeInformationVm> GetFormsData(OpenPositionsParamQuery paramQuery)
        {
            var result = new PaginationModel <TradesExeInformationVm>();

            var date = paramQuery.DateString.ToStandardAppDateFormat();

            var accountId = _tradeAccountRepository.GetBySearchName(paramQuery.AccountName).Id;

            var query = _tradeExeRepository.Query()
                        .Where(op => op.TradeAccountId == accountId &&
                               DbFunctions.TruncateTime(date) == DbFunctions.TruncateTime(op.ReportDate))
                        .OrderBy(op => op.Id);

            var data = query.Skip(paramQuery.PageIndex * paramQuery.PageLength).Take(paramQuery.PageLength).ToList();

            result.Data       = _mapper.Map <List <TradesExeInformationVm> >(data);
            result.DataLength = query.Count();

            return(result);
        }
Example #2
0
 public IHttpActionResult GetPortfolioOpenPositions(OpenPositionsParamQuery paramQuery)
 {
     return(Ok(_tradeAccountService.GetPortfolioOpenPositions(paramQuery)));
 }
Example #3
0
 public IHttpActionResult GetFormsData([FromBody] OpenPositionsParamQuery paramQuery)
 {
     return(Ok(_tradeAccountService.GetFormsData(paramQuery)));
 }