Пример #1
0
        public override List<Show> Grab(string xmlParameters, ILogger logger)
        {
            _logger = logger;
            var doc = XDocument.Parse(xmlParameters);
            var startDayDiffElement = doc.Descendants("StartDate").FirstOrDefault();
            var endDayDiffElement = doc.Descendants("EndDate").FirstOrDefault();
            var startDayDiff = startDayDiffElement != null ? Convert.ToInt32(startDayDiffElement.Value) : 0;
            var endDayDiff = endDayDiffElement != null ? Convert.ToInt32(endDayDiffElement.Value) : 3;

            var p = new GrabParameters();
            p.FromDate = DateTime.Now.Date.AddDays(startDayDiff);
            p.ToDate = DateTime.Now.Date.AddDays(endDayDiff);
            var shows = new List<Show>();
            shows.AddRange(Grab(p));
            FixShowsEndTimeByStartTime(shows);
            return shows;
        }
Пример #2
0
        public override List <Show> Grab(string xmlParameters, ILogger logger)
        {
            _logger = logger;
            var doc = XDocument.Parse(xmlParameters);
            var startDayDiffElement = doc.Descendants("StartDate").FirstOrDefault();
            var endDayDiffElement   = doc.Descendants("EndDate").FirstOrDefault();
            var startDayDiff        = startDayDiffElement != null?Convert.ToInt32(startDayDiffElement.Value) : 0;

            var endDayDiff = endDayDiffElement != null?Convert.ToInt32(endDayDiffElement.Value) : 3;

            var p = new GrabParameters();

            p.FromDate = DateTime.Now.Date.AddDays(startDayDiff);
            p.ToDate   = DateTime.Now.Date.AddDays(endDayDiff);
            var shows = new List <Show>();

            shows.AddRange(Grab(p));
            FixShowsEndTimeByStartTime(shows);
            return(shows);
        }