Пример #1
0
        public List <Share> GetShareListByZone(int zoneId)
        {
            List <Share> sList = new List <Share>();

            Zone z = new ZoneBLL(_unit).GetByID(zoneId);

            sList = this.GetShareListByTradingDate(z.TradingDate);

            return(sList);
        }
Пример #2
0
        private int GetDateToProcess(Account acc)
        {
            int dateToProcess = DateHelper.DateToInt(DateTime.Now);

            if (acc.ZoneId.HasValue)
            {
                Zone z = new ZoneBLL(_unit).GetByID(acc.ZoneId.Value);
                dateToProcess = z.TradingDate;
            }

            return(dateToProcess);
        }
Пример #3
0
        public Zone SetZoneNextDay(int zoneID)
        {
            Zone         dayZone = null;
            ZoneBLL      bll     = new ZoneBLL(_unit);
            TradeManager tm      = new TradeManager(_unit);

            dayZone = bll.GetByID(zoneID);

            dayZone.TradingDate = (int)(new IndicatorBLL(_unit)).GetNextTradingDate(dayZone.TradingDate);

            bll.Update(dayZone);


            return(dayZone);
        }
Пример #4
0
        /// <summary>
        /// Gets the latest trading date by share zone.
        /// </summary>
        /// <param name="shareId">The share identifier.</param>
        /// <param name="zoneId">The zone identifier.</param>
        /// <returns></returns>
        public int GetLatestTradingDateByShareZone(int shareId, int?zoneId)
        {
            int tradingDate = -1;

            if (zoneId.HasValue)
            {
                Zone z = new ZoneBLL(_unit).GetByID(zoneId.Value);
                tradingDate = z.TradingDate;
            }
            else
            {
                var t = GetLastTicker(shareId, null);
                if (t != null)
                {
                    tradingDate = t.TradingDate;
                }
            }

            return(tradingDate);
        }
Пример #5
0
        private string getRecordFolder(Record rec)
        {
            string recordFolder = string.Empty;


            rec.FileName = GetTargetFileName(rec);

            if (rec.ZoneId.HasValue)
            {
                Zone z = new ZoneBLL(_unit).GetByID(rec.ZoneId.Value);
                recordFolder = Path.Combine(Upload_Path, "Z" + z.Name);
            }
            else
            {
                recordFolder = Path.Combine(Upload_Path, "ZCurrent");
            }

            recordFolder = Path.Combine(recordFolder, rec.Owner);

            return(recordFolder);
        }