예제 #1
0
파일: MarketItem.cs 프로젝트: BFMS/BFMS
 public MarketItem(RunnerDescription rd)
 {
     RunnerName = rd.RunnerName;
     SelectionId = rd.SelectionId;
 }
예제 #2
0
파일: DBAccess.cs 프로젝트: BFMS/BFMS
        public List<RunnerDescription> GetRunnerDesc(string marketId)
        {
            List<RunnerDescription> res = new List<RunnerDescription>();
            try
            {
                using (var ctx = new bfmsEntities())
                {
                    int minRefrNr = (from run in ctx.runners where (run.MarketId == marketId) select run.RefreshNr).Min();
                    var data = (from run in ctx.runners
                                where (run.MarketId == marketId) && (run.RunnerStatus == "ACTIVE") && (run.RefreshNr == minRefrNr)
                                orderby run.AvgPrice
                                //select new { book, run=run.AvgPrice as VolPrice,run, vol }).ToList();
                                select new { run } ).ToList();

                    foreach (var row in data)
                    {
                        RunnerDescription rd = new RunnerDescription();
                        rd.SelectionId = row.run.SelectionId;
                        rd.RunnerName = row.run.Name;
                        res.Add(rd);
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Fatal(Util.FormatExc(ex));

            }

            return res;
        }