Пример #1
0
 public IEnumerable <Account> GetAccountList()
 {
     using (var db = new LeechDAContext(_options))
     {
         return(db.Account.ToList());
     }
 }
Пример #2
0
 public IEnumerable <Instrum> GetInstrumList()
 {
     using (var db = new LeechDAContext(_options))
     {
         return(db.Instrum.ToList());
     }
 }
Пример #3
0
 public IEnumerable <Holding> GetHoldingList(int accountID)
 {
     using (var db = new LeechDAContext(_options))
     {
         return(db.Holding.Where(r => r.AccountID == accountID).ToList());
     }
 }
Пример #4
0
 public Cash GetCash(int accountID)
 {
     using (var db = new LeechDAContext(_options))
     {
         return(db.Cash.FirstOrDefault(r => r.AccountID == accountID));
     }
 }
Пример #5
0
        public IEnumerable <Trade> GetTradeList(int accountID)
        {
            using (var db = new LeechDAContext(_options))
            {
                var list = db.Trade.Where(r => r.AccountID == accountID);

                return(list.Select(r => new Trade()
                {
                    TradeID = r.TradeID,
                    OrderID = r.OrderID,
                    Time = StorageLib.ToDateTime(r.Time),
                    InsID = r.InsID,
                    BuySell = (BuySell)r.BuySell,
                    LotCount = r.LotCount,
                    Price = r.Price,
                    AccountID = r.AccountID,
                    Comm = r.Comm,
                    TradeNo = r.TradeNo
                }).ToList());
            }
        }
Пример #6
0
        public IEnumerable <Order> GetOrderList(int accountID)
        {
            using (var db = new LeechDAContext(_options))
            {
                var list = db.Order.Where(r => r.AccountID == accountID);

                return(list.Select(r => new Order()
                {
                    OrderID = r.OrderID,
                    Time = StorageLib.ToDateTime(r.Time),
                    InsID = r.InsID,
                    BuySell = (BuySell)r.BuySell,
                    LotCount = r.LotCount,
                    Price = r.Price,
                    Status = (OrderStatus)r.Status,
                    AccountID = r.AccountID,
                    StopOrderID = r.StopOrderID,
                    OrderNo = r.OrderNo
                }).ToList());
            }
        }
Пример #7
0
        public IEnumerable <StopOrder> GetStopOrderList(int accountID)
        {
            using (var db = new LeechDAContext(_options))
            {
                var list = db.StopOrder.Where(r => r.AccountID == accountID);

                return(list.Select(r => new StopOrder()
                {
                    StopOrderID = r.StopOrderID,
                    Time = StorageLib.ToDateTime(r.Time),
                    InsID = r.InsID,
                    BuySell = (BuySell)r.BuySell,
                    StopType = (StopOrderType)r.StopType,
                    EndTime = StorageLib.ToDateTime(r.EndTime),
                    AlertPrice = r.AlertPrice,
                    Price = r.Price,
                    LotCount = r.LotCount,
                    Status = (StopOrderStatus)r.Status,
                    AccountID = r.AccountID,
                    CompleteTime = StorageLib.ToDateTime(r.CompleteTime),
                    StopOrderNo = r.StopOrderNo
                }).ToList());
            }
        }