public JsonResult GetSpinOffTransactions(GetBuyAndHoldTransactionsRequest request)
        {
            var _transactions = _buyAndHoldService.GetBuyAndHoldTransactions(request);

            var transactions = _transactions.Where(c => c.TransactionTypeId != 12)
                                .OrderBy(p => p.TransactionDate);
            var spinOffTransactions = _transactions.Where(c => c.TransactionTypeId == 12)
                                .OrderBy(p => p.TransactionDate);
            return Json(new { success = true, transactions = transactions, spinOffTransactions = spinOffTransactions });
        }
Пример #2
0
        public List<BuyAndHoldTransaction> GetBuyAndHoldTransactions(GetBuyAndHoldTransactionsRequest request)
        {
            var context = new InvestContext();

            IQueryable<BuyAndHoldTransaction> tx = Enumerable.Empty<BuyAndHoldTransaction>().AsQueryable();

            if (request.SecurityId.HasValue)
            {
                tx = context.BuyAndHoldTransactions.Where(p => p.SecurityId == request.SecurityId.Value);
            }
            else if (request.TickerSymbol != string.Empty)
            {
                tx = context.BuyAndHoldTransactions.Where(p => p.TickerSymbol == request.TickerSymbol);
            }

            if (request.FromDate.HasValue)
            {
                tx = tx.Where(p => p.TransactionDate >= request.FromDate.Value);
            }

            if (request.ToDate.HasValue)
            {
                tx = tx.Where(p => p.TransactionDate <= request.ToDate.Value);
            }

            return tx.OrderBy(p => p.TransactionDate).ToList();
        }
Пример #3
0
 public List<BuyAndHoldTransactionDto> GetBuyAndHoldTransactions(GetBuyAndHoldTransactionsRequest request)
 {
     var BuyAndHoldTransactionModels = _buyAndHoldDal.GetBuyAndHoldTransactions(request);
     return MapBuyAndHoldTransactions(BuyAndHoldTransactionModels);
 }
Пример #4
0
 public List<BuyAndHoldTransactionDto> GetBuyAndHoldTransactions(GetBuyAndHoldTransactionsRequest request)
 {
     return _buyAndHoldManager.GetBuyAndHoldTransactions(request);
 }
Пример #5
0
        public JsonResult GetMergerTransactions(GetBuyAndHoldTransactionsRequest request)
        {
            // var transactions = _buyAndHoldService.GetBuyAndHoldTransactions(new GetBuyAndHoldTransactionsRequest { SecurityId = request.SecurityId });

            var _transactions = _buyAndHoldService.GetBuyAndHoldTransactions(request);

            var transactions = _transactions.Where(c => c.TransactionTypeId != 7 && c.TransactionTypeId != 8 && c.TransactionTypeId != 9)
                                .OrderBy(p => p.TransactionDate);
            var mergerTransactions = _transactions.Where(c => c.TransactionTypeId == 7 || c.TransactionTypeId == 8 || c.TransactionTypeId == 9)
                                .OrderBy(p => p.TransactionDate);
            //return Json(transactions = transactions);
            return Json(new { success = true, transactions = transactions, mergerTransactions = mergerTransactions });
            // return Json(JsonResponseFactory.SuccessResponse(), JsonRequestBehavior.AllowGet);
        }