Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ScanReportManager"/> class.
 /// </summary>
 /// <param name="clientUser">The client user.</param>
 public ScanReportManager(ClientUser clientUser)
 {
     this.currentUser    = clientUser;
     this.repository     = new ScanReportRepository(clientUser);
     this.config         = new SysConfig();
     this.keywordManager = new CompanyKeywordManager(this.config, this.currentUser);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the news list based on source.
        /// </summary>
        /// <param name="sourceList">The source list.</param>
        /// <param name="endTime">The end time.</param>
        /// <returns>List&lt;NewsBrief&gt;.</returns>
        public List <NewsBrief> GetNewsListBasedOnSource(List <string> sourceList, DateTime endTime)
        {
            List <NewsBrief> result       = null;
            var startTime                 = endTime.AddDays(-7);
            var scanReportRepository      = new ScanReportRepository(this.currentClientUser);
            var NUMBEROFNEWSSHOWFORSOURCE = 5;
            var newsStream                = scanReportRepository.GetNewsStreamBasedOnSource(
                sourceList,
                NUMBEROFNEWSSHOWFORSOURCE,
                startTime,
                endTime,
                this.currentClientUser.UserFilter);

            if (newsStream != null && newsStream.Any())
            {
                result = ModelConverter.ToNewsBriefList(newsStream.ToList());
            }
            return(result);
        }