コード例 #1
0
        public JsonResult Query(string queryString)
        {
            List <Transaction> transactions = TransactionEngine.GetTransactions(queryString).ToList();

            transactions.RemoveAll(transaction => transaction == null);
            Logger.LogDummyData();
            return(Json(transactions));
        }
コード例 #2
0
        /// <summary>
        /// Given the raw <see cref="HubPortal.Api.Models.TransactionLookupData"/> posted by the
        /// client, will return a list of transactions that satisfy those criteria.
        /// </summary>
        /// <param name="searchData">Raw data from client's post request</param>
        /// <returns>List of transactions</returns>
        public static IEnumerable <Transaction> GetTransactions(TransactionLookupData searchData)
        {
            if (searchData.SearchType == "" || searchData.SearchType == null)
            {
                throw new Exception("Search Type not defined");
            }

            IEnumerable <Transaction> transactions = new List <Transaction>();
            IQuery query = QueryBuilder.GetQuery(Symbols.FINDALL, Symbols.TRANSACTION);

            ParseSearchType(query, searchData);
            ParseTransactionDetails(query, searchData);
            ParseLookup(query, searchData);

            return(TransactionEngine.GetTransactions(query));
        }