public NewsService(
			INewsRepository newsRepository,
			ICacheManager cacheStrategy)
        {
            _newsRepository = newsRepository;
            _cacheStrategy = cacheStrategy;
        }
 public EventsController(IUserProcessor userProcessor, INewsRepository newsRepository, INotifier notifier, IProjectProcessor projectProcessor)
 {
     this.userProcessor = userProcessor;
     this.newsRepository = newsRepository;
     this.notifier = notifier;
     this.projectProcessor = projectProcessor;
 }
Beispiel #3
0
 public SearchController(INewsRepository newsRepository, ITipRepository tipRepository, IAllContentRepository allContentRepository, IRecipeRepository recipeRepository)
 {
     _newsRepository = newsRepository;
     _tipRepository = tipRepository;
     _allContentRepository = allContentRepository;
     _recipeRepository = recipeRepository;
 }
        protected override void CreateChildControls()
        {
            _model = new NewsRepository(NewsString.NewsListURL);
            _presenter = new NewsPresenter(this, _model);
            _presenter.initNews();

            CssRegistration.Register("/_layouts/Css/news.css");

            Control control = Page.LoadControl(_ascxPath);
            if (control != null) {
                ((NewsAnnouncementWebPartUserControl)control).webPart = this;
                //DataGrid gridView = (DataGrid)control.FindControl("newsDataGrid");
                //gridView.DataSource = _listNews;
                //gridView.DataBind();
                NewsUtil.WebPart = this;
                this.PropertyValue = NewsString.GroupContribute;

                //Find repeater
                object oRepeater = control.FindControl("repeater");
                if (oRepeater != null)
                {
                    Repeater repeater = (Repeater)oRepeater;
                    setDataSourceToRepeater(repeater);
                }
            }
            Controls.Add(control);
        }
 protected override void CreateInitialData()
 {
     _newsRepository = Locator.GetService<INewsRepository>();
     var news = new[]
                    {
                        new News
                            {
                                Date = new DateTime(2010,1,1),
                                Title = "News 1",
                                ShortDescription = "News 1"
                            },
                        new News
                            {
                                Date = new DateTime(2012,10,10),
                                Title = "News 2",
                                ShortDescription = "News 2"
                            },
                        new News
                            {
                                Date = DateTime.Now,
                                Title = "News 3",
                                ShortDescription = "News 3"
                            },
                        new News
                            {
                                Date = DateTime.Now,
                                Title = "News 4",
                                ShortDescription = "News 4"
                            }
                    };
     foreach (var obj in news)
     {
         _newsRepository.Add(obj);
     }
 }
Beispiel #6
0
 public HomeController(IFeaturesRepository featuresRepository, INewsRepository newsRepository, ICareersRepository careersRepository, IProgrammingLanguagesRepository programmingLanguagesRepository)
 {
     this.featuresRepository = featuresRepository;
     this.newsRepository = newsRepository;
     this.careersRepository = careersRepository;
        this.programmingLanguagesRepository = programmingLanguagesRepository;
 }
 public ManageContentsController(INewsRepository newsRepository, ITipRepository tipRepository, IQuestionRepository questionRepository, IRecipeRepository recipeRepository)
 {
     _newsRepository = newsRepository;
     _tipRepository = tipRepository;
     _recipeRepository = recipeRepository;
     _questionRepository = questionRepository;
 }
        public IndexController()
        {
            this.unitOfWork = new UnitOfWork();

            this.newsCategoryRepository = RepositoryFactory.GetRepository<INewsCategoryRepository, NewsCategory>(this.unitOfWork);

            this.newsRepository = RepositoryFactory.GetRepository<INewsRepository, News>(this.unitOfWork);
        }
Beispiel #9
0
        public NewsController(INewsRepository NewsRepository, IUserAccountRepository DefineUserRepository)
        {
            _RNews = NewsRepository;
            _RDefineUser = DefineUserRepository;

            ENews = new NewsExtentions(_RNews, _RDefineUser);
            EDefineUser = new UserAccountExtentions(_RDefineUser);
        }
 public StatisticsController(IQuestionRepository questionRepository, ITipRepository tipRepository, INewsRepository newsRepository, IUserRepository userRepository, IRecipeRepository recipeRepository)
 {
     _questionRepository = questionRepository;
     _tipRepository = tipRepository;
     _newsRepository = newsRepository;
     _userRepository = userRepository;
     _recipeRepository = recipeRepository;
 }
Beispiel #11
0
 public NewsManagementServices(INewsRepository newsRepository, ILogger logger)
 {
     if (newsRepository == null)
         throw new ArgumentNullException("newsRepository");
     if (logger == null)
         throw new ArgumentNullException("logger");
     this._newsRepository = newsRepository;
     this._logger = logger;
 }
Beispiel #12
0
 public NewsModuleTests()
 {
     _repository = A.Fake<INewsRepository>();
     _browser = new Browser(config =>
     {
         config.Module<NewsModule>();
         config.Dependency(_repository);
     });
 }
Beispiel #13
0
 public HomeController(IUnitOfWork uow, INewsRepository newsRepository, IServiceRepository ServiceRepository,
     ISeoMngRepository SeoRepository,
     IUserAccountRepository userAccountRepository)
 {
     _uow = uow;
     _RService = ServiceRepository;
     _rNewsRepository = newsRepository;
     _RSeoMng = SeoRepository;
     _rAccountRepository = userAccountRepository;
 }
 public ManageSpamController(INewsCommentRepository newsCommentRepository, ITipCommentRepository tipCommentRepository, IRecipeCommentRepository recipeCommentRepository, IQuestionRepository questionRepository, IAnswerRepository answerRepository, INewsRepository newsRepository, ITipRepository tipRepository, IRecipeRepository recipeRepository)
 {
     _newsCommentRepository = newsCommentRepository;
     _tipCommentRepository = tipCommentRepository;
     _recipeCommentRepository = recipeCommentRepository;
     _questionRepository = questionRepository;
     _answerRepository = answerRepository;
     _newsRepository = newsRepository;
     _tipRepository = tipRepository;
     _recipeRepository = recipeRepository;
 }
Beispiel #15
0
 public AboutController(ICommandBus commandBus,
                        IMenuRepository menuRepository,
                        IPartRepository partRepository,
                        IStaffRepository staffRepository,
                        IOfficePhotoRepository officePhotoRepository,
                        INewsRepository newsRepository)
     : base(commandBus, menuRepository, partRepository)
 {
     this.staffRepository = staffRepository;
     this.officePhotoRepository = officePhotoRepository;
     this.newsRepository = newsRepository;
 }
Beispiel #16
0
 public HomeController()
 {
     this.unitOfWork = new UnitOfWork();
     this.newsCategoryRepository = RepositoryFactory.GetRepository<INewsCategoryRepository, NewsCategory>(this.unitOfWork);
     this.newsRepository = RepositoryFactory.GetRepository<INewsRepository, News>(this.unitOfWork);
     this.deliverNoticeRepository = RepositoryFactory.GetRepository<IDeliverNoticeRepository, DeliverNotice>(this.unitOfWork);
     this.businessCheckNoticeRespository = RepositoryFactory.GetRepository<IBusinessCheckNoticeRepository, BusinessCheckNotice>(this.unitOfWork);
     this.pipeIncomeRecordRepository = RepositoryFactory.GetRepository<IPipeIncomeRecordRepository, PipeIncomeRecord>(this.unitOfWork);
     this.pipeNeedNoticeRepository = RepositoryFactory.GetRepository<IPipeNeedNoticeRepository, PipeNeedNotice>(this.unitOfWork);
     this.outgoingNoticeRepository = RepositoryFactory.GetRepository<IOutgoingNoticeRepository, OutgoingNotice>(this.unitOfWork);
     this.normalCheckTaskRepository = RepositoryFactory.GetRepository<INormalCheckTaskRepository, NormalCheckTask>(this.unitOfWork);
     this.ReturningNoticeRepository = RepositoryFactory.GetRepository<IReturningNoticeRepository, ReturningNotice>(this.unitOfWork);
 }
Beispiel #17
0
        public NewsModule(INewsRepository newsRepository) : base("/news")
        {
            Get["/"] = args =>
            {
                int limit = Request.Query.limit.HasValue ? Request.Query.limit : 10;

                IList<NewsItem> results = newsRepository.GetNewsItems(limit);
                return Response.AsJson(results.Select(ni => new NewsStoryDto
                {
                    Title = ni.Title,
                    Ingress = ni.Description,
                    Link = ni.Link,
                    ImageUrl = ni.EnclosureUrl,
                    Published = ni.PublishedDateAsDateTime.DateTime
                })).AsCacheable(DateTime.Now.AddHours(1));
            };
        }
 public void GetLatestNews_returnsEmptyListIfNumberOfLatestNewsIsNull()
 {
     IQueryable<News> latestNews;
     var news = Builder<News>.CreateListOfSize(10)
                        .All()
                             .With(x => x.Date = new DateTime(2010, 1, 1))
                        .Build();
     using (Mockery.Record())
     {
         Expect.Call(Session.CreateCriteria(typeof(News))).Return(CreateCriteria);
         Expect.Call(SessionProvider.GetSession()).Return(Session);
         Expect.Call(CreateCriteria.List<News>()).Return(news);
     }
     using (Mockery.Playback())
     {
         _newsRepository = new NewsRepository(SessionProvider);
         latestNews = _newsRepository.GetLatestNews();
     }
     Assert.IsNotNull(latestNews);
     Assert.IsEmpty(latestNews);
 }
 public void GetLatestNews_returnsValidNumberOfLatestNews()
 {
     IQueryable<News> latestNews;
     var news = Builder<News>.CreateListOfSize(10)
                        .All()
                             .With(x => x.Date = DateTime.Now)
                        .Random(5)
                             .With(x => x.Date = new DateTime(2010, 1, 1))
                        .Build();
     using (Mockery.Record())
     {
         Expect.Call(Session.CreateCriteria(typeof(News))).Return(CreateCriteria);
         Expect.Call(SessionProvider.GetSession()).Return(Session);
         Expect.Call(CreateCriteria.List<News>()).Return(news);
     }
     var newsTime = DateTime.Now - Constants.TIME_OF_NEWS;
     using (Mockery.Playback())
     {
         _newsRepository = new NewsRepository(SessionProvider);
         latestNews = _newsRepository.GetLatestNews();
     }
     Assert.AreEqual(latestNews.Count(), 5);
     Assert.GreaterOrEqual(latestNews.First().Date, newsTime);
 }
Beispiel #20
0
 public NewsStorage(DataContext context, INewsRepository newsRepository, IMapper mapper)
 {
     _context        = context;
     _newsRepository = newsRepository;
     _mapper         = mapper;
 }
Beispiel #21
0
 public NewsController(INewsRepository repository)
 {
     _repository = repository;
 }
Beispiel #22
0
 public NewsController()
 {
     _repo = new NewsRepository();
 }
Beispiel #23
0
 public IEnumerable <News> Get([FromServices] INewsRepository repository)
 {
     return(repository.Get());
 }
 public NewsController(INewsRepository repository)
 {
     Repository = repository;
 }
 public NewsAppService(IMapper mapper, INewsRepository newsRepository)
 {
     _mapper         = mapper;
     _newsRepository = newsRepository;
 }
Beispiel #26
0
 public NewsService(INewsRepository newsRepository)//,IDatabaseSettings settings)
 {
     _newsRepository = newsRepository;
     //  var client = new MongoClient(settings.ConnectionString);
     //  var database = client.GetDatabase(settings.Database);
 }
 public NewsObtainerService(INewsRepository newsRepo, INNNLogger <NewsObtainerService> logger, IOptions <Settings> settings)
 {
     _newsRepo = newsRepo;
     _logger   = logger;
     _settings = settings.Value;
 }
 public SortByRankService(INewsRepository newsRepository)
 {
     this.newsRepository = newsRepository;
 }
Beispiel #29
0
        public RecordService(DatabaseContext databaseContext, INewsRepository repository)
        {
            _databaseContext = databaseContext;

            _repository = repository;
        }
Beispiel #30
0
 public NewsService()
 {
     _newsRepo = new SqlNewsRepository();
 }
Beispiel #31
0
 public void Post([FromBody] News news, [FromServices] INewsRepository repository)
 {
     repository.Create(news);
 }
Beispiel #32
0
 public News Get(int id, [FromServices] INewsRepository repository)
 {
     return(repository.Get(id));
 }
Beispiel #33
0
 public NewsService(INewsRepository NewsRepository)
 {
     _NewsRepository = NewsRepository;
 }
Beispiel #34
0
 public NewsManager(INewsRepository newsRepository) : base(newsRepository)
 {
     _newsRepository = newsRepository;
 }
Beispiel #35
0
 public NewsController(Context context)
 {
     this.newsRepository  = new NewsRepository(context);
     this.imageRepository = new ImageRepository(context);
 }
Beispiel #36
0
 public NewsController(INewsRepository newsRepository, ILoggerFactory loggerFactory)
 {
     _repository = newsRepository;
     _logger = loggerFactory.GetCurrentClassLogger();
 }
Beispiel #37
0
 public NewsEditingPersistence(INewsRepository itemRepository, ICategoryRepository categoryRepository)
 {
     _newsRepository     = itemRepository;
     _categoryRepository = categoryRepository;
 }
Beispiel #38
0
 public NewsController(INewsRepository newsRepository, IUserRepository userRepository, ICategoryRepository categoryRepository)
 {
     _newsRepository     = newsRepository;
     _userRepository     = userRepository;
     _categoryRepository = categoryRepository;
 }
 public SameNewsTIViewComponent(INewsRepository _newsRepository)
 {
     newsRepository = _newsRepository;
 }
Beispiel #40
0
 public NewsManager(INewsRepository newsRepsitory)
 {
     _newsRespository = newsRepsitory;
 }
 public GetAllNews(INewsRepository newsRepository)
 {
     _newsRepository = newsRepository;
 }
 public NewsPresenter(INewsView view, INewsRepository model)
 {
     _view = view;
     _model = model;
 }
Beispiel #43
0
 public NewsController(INewsRepository newsRepository)
 {
     _newsRepository = newsRepository;
 }
Beispiel #44
0
 public NewsService(INewsRepository newsRepository, ICategoryRepository categoryRepository)
 {
     _newsRepository     = newsRepository;
     _categoryRepository = categoryRepository;
 }
 public NewsController(INewsRepository _newsRepository)
 {
     newsRepository = _newsRepository;
 }
Beispiel #46
0
 public NewsPageModel(ILogger <NewsPageModel> logger, INewsRepository newsRepository, IOptions <WebSettings> webSettingsValue)
 {
     this.logger         = logger;
     this.newsRepository = newsRepository;
     webSettings         = webSettingsValue.Value;
 }
Beispiel #47
0
 //private readonly static ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
 public NewsService( IUnitOfWork unitwork, INewsRepository newsRepository, INewsCategoryRepository newsCategoryRepository )
 {
     this.unitwork = unitwork;
     this.newsRepository = newsRepository;
     this.newsCategoryRepository = newsCategoryRepository;
 }
Beispiel #48
0
 public NewsService(INewsRepository newsProvider)
 {
     _newsProvider = newsProvider;
 }
 public MessagesController()
 {
     _newsRepository = new NewsRepository();
     _newsMapper = new NewsMapper();
 }
Beispiel #50
0
 public NewsController(INewsRepository newsRepository)
 {
     this.repository = newsRepository;
 }
Beispiel #51
0
 public void Dispose()
 {
     _newsRespository.Dispose();
     _newsRespository = null;
 }
Beispiel #52
0
 public NewsService(INewsRepository newsRepository)
 {
     _newsRepository = newsRepository;
 }
Beispiel #53
0
 public NewsController(INewsRepository newsRepository)
 {
   this._newsRepository = newsRepository;
 }
Beispiel #54
0
 public NewsManager()
 {
     _newsRepository = new NewsRepository();
 }
Beispiel #55
0
 public NewsController()
 {
     _repository = new NewsRepository();
 }
Beispiel #56
0
 public MessagesController()
 {
     _newsRepository = new NewsRepository();
     _newsMapper     = new NewsMapper();
 }
Beispiel #57
0
 public NewsBuilder(INewsRepository newsRepository, INewsStorage newsStorage)
 {
     _newsRepository = newsRepository;
     _newsStorage    = newsStorage;
 }
Beispiel #58
0
 public NewsController(ILayoutRepository layoutRepository, INewsRepository newsRepository) : base(layoutRepository)
 {
     this._newsRepository = newsRepository;
 }
Beispiel #59
0
 public NewsResource(INewsRepository newsRepository)
 {
     this.newsRepository = newsRepository;
 }
Beispiel #60
0
 public NewsService(INewsRepository newsRepository)
 {
     this.newsRepository = newsRepository;
 }