Example #1
0
 public IdeaController(IIdeaRepository ideas, IUserRepository users, ISettingsRepository settings, IImageRepository imageRepository, IFeatureRepository features)
 {
     _ideas    = ideas;
     _users    = users;
     _settings = settings;
     _features = features;
 }
        public FeatureTaskActor(
            IEventAggregator eventAggregator,
            IFeatureRepository repository,
            IDataService dataService,
            Guid taskId,
            bool isSubTaskActor = false)
            : base(eventAggregator, taskId)
        {
            this.eventAggregator.Subscribe(this);

            executingActors     = new Dictionary <string, IActorRef>();
            this.repository     = repository;
            this.dataService    = dataService;
            this.isSubTaskActor = isSubTaskActor;

            jobsCompleted = new Dictionary <KeyValuePair <string, string>, bool>();

            Receive <Confirmation>(message => HandleConfirmation(message));
            Receive <DeactivateFeaturesRequest>(message => HandleDeactivateFeaturesRequest(message));
            Receive <FeatureToggleRequest>(message => HandleFeatureToggleRequest(message));
            Receive <UpgradeFeaturesRequest>(message => HandleUpgradeFeaturesRequest(message));
            Receive <FeatureDeactivationCompleted>(message => HandleFeatureDeactivationCompleted(message));
            Receive <FeatureActivationCompleted>(message => HandleFeatureActivationCompleted(message));
            Receive <FeatureUpgradeCompleted>(message => HandleFeatureUpgradeCompleted(message));
        }
Example #3
0
 public FeaturesController(VegaDbContext context, IMapper mapper, IFeatureRepository featureRepository, IUnitOfWork unitOfWork)
 {
     this.mapper            = mapper;
     this.featureRepository = featureRepository;
     this.context           = context;
     this.unitOfWork        = unitOfWork;
 }
Example #4
0
        public MainWindowViewModel(IFeatureRepository featureRepository, IFeatureController featureController)
        {
            _featureRepository = featureRepository;
            _featureController = featureController;

            var canGenerateMonster = this
                                     .WhenAnyValue(x => x.Name, x => x.SelectedQuality,
                                                   (name, quality) => !string.IsNullOrWhiteSpace(name) && quality >= 0);

            GenerateMonsterCommand = ReactiveCommand.Create(GenerateMonster, canGenerateMonster);

            SetMonsterQualityCommand = ReactiveCommand.Create <string, Unit>((p) =>
            {
                SelectedQuality = int.Parse(p);
                return(Unit.Default);
            });

            Features = GetFeatureViewModels();

            this.WhenAnyValue(x => x.IsGroup)
            .Subscribe(b =>
            {
                if (b)
                {
                    _featureController.AddFeature(new MassAttackFeature());
                    _featureController.AddFeature(new GroupFeature());
                }
                else
                {
                    _featureController.RemoveFeature(new GroupFeature());
                    GroupCount = null;
                }
            });
        }
Example #5
0
 /// <summary>
 /// this is the default constructor for the Skill service
 /// </summary>
 /// <param name="unityContainer">object of unity container interface for dependency injection </param>
 public FeatureService(IFeatureRepository featureRepository, ILevelRepository levelRepository, IEmployeeRepository employeeRepository, ILevelService levelService)
 {
     _levelRepository    = levelRepository;
     _featureRepository  = featureRepository;
     _employeeRepository = employeeRepository;
     _levelService       = levelService;
 }
Example #6
0
        public LoadTaskActor(IEventAggregator eventAggregator, IFeatureRepository repository,
                             string title, Guid id, Location startLocation)
            : base(eventAggregator, title, id)
        {
            locationActors         = new Dictionary <Guid, IActorRef>();
            this.repository        = repository;
            featureDefinitionActor =
                Context.ActorOf(Context.DI().Props <FeatureDefinitionActor>());


            FarmFeatureDefinitions = new ProgressModule(
                5d / 100,
                0d,
                1);

            Farm = new ProgressModule(
                5d / 100,
                FarmFeatureDefinitions.MaxCumulatedQuota,
                1);
            WebApps = new ProgressModule(
                10d / 100,
                Farm.MaxCumulatedQuota);

            SitesAndWebs = new ProgressModule(
                1d - WebApps.MaxCumulatedQuota,
                WebApps.MaxCumulatedQuota);

            Receive <LocationsLoaded>(message => HandleLocationsLoaded(message));
            Receive <FarmFeatureDefinitionsLoaded>(message => FarmFeatureDefinitionsLoaded(message));

            InitiateLoadTask(startLocation);
        }
Example #7
0
 public ProjectService(IProjectRepository projectRepository, IUnitOfWork unitOfWork, IRoleCheck roleCheck, IFeatureRepository featureRepository)
 {
     _projectRepository = projectRepository;
     _unitOfWork        = unitOfWork;
     _roleCheck         = roleCheck;
     _featureRepository = featureRepository;
 }
Example #8
0
 public CompanySetupController(IModuleRepository _module_repo, ICompanyRepository _comp_repo, IUserRepository _user_repo, IFeatureRepository fearepo)
 {
     module_repo = _module_repo;
     comp_repo   = _comp_repo;
     user_repo   = _user_repo;
     fea_repo    = fearepo;
 }
Example #9
0
 public FeatureService(IFeatureRepository featureRepository, IRoleFeatureRepository roleFeatureRepository,
                       IUnitOfWork unitOfWork)
 {
     _featureRepository     = featureRepository;
     _roleFeatureRepository = roleFeatureRepository;
     _unitOfWork            = unitOfWork;
 }
Example #10
0
        public FeatureDefinitionTaskActor(
            IEventAggregator eventAggregator,
            IFeatureRepository repository,
            IDataService dataService,
            Guid taskId)
            : base(eventAggregator, taskId)
        {
            this.eventAggregator.Subscribe(this);

            this.repository  = repository;
            this.dataService = dataService;

            subTaskActor = Context.ActorOf(
                FeatureTaskActor.Props(
                    eventAggregator,
                    repository,
                    dataService,
                    Id,
                    true),
                "FeatureTaskActor-" + Id);

            featureDefinitionActor = Context.ActorOf(
                FeatureDefinitionActor.Props(dataService), "FeatureDefinitionActor-" + Id);

            FeatureDeactivations = new List <ActivatedFeatureSpecial>();

            Receive <Confirmation>(message => HandleConfirmation(message));
            Receive <DeinstallationRequest>(message => HandleDeinstallationRequest(message));
            Receive <DeinstallationCompleted>(message => HandleDeinstallationCompleted(message));
            Receive <ProgressMessage>(message => HandleActivatedFeatureDeactivationCompleted(message));
        }
Example #11
0
 public VehiclesController(IMapper mapper, IVehicleRepository vehicleRepository, IFeatureRepository featureRepository, IUnitOfWork unitOfWork)
 {
     this.mapper            = mapper;
     this.vehicleRepository = vehicleRepository;
     this.featureRepository = featureRepository;
     this.unitOfWork        = unitOfWork;
 }
 public InventoryGenerator(IVehicleRepository vehicleRepository, IFeatureRepository featureRepository, IStockNumberGenerator stockNumberGenerator)
 {
     randomValue          = new Random();
     VehicleRepository    = vehicleRepository;
     FeatureRepository    = featureRepository;
     StockNumberGenerator = stockNumberGenerator;
 }
 public IdeaController(IIdeaRepository ideas, IUserRepository users, ISettingsRepository settings, IImageRepository imageRepository, IFeatureRepository features)
 {
     _ideas = ideas;
     _users = users;
     _settings = settings;
     _features = features;
 }
Example #14
0
 public ArticlesController(IFeatureRepository featureRepository, IBlogPostRepository blogPostRepository, IUserRepository userRepository)
     : base(userRepository)
 {
     _blogPostRepository = blogPostRepository;
     _featureRepository = featureRepository;
     _featureService = new FeatureService(_featureRepository);
 }
 //, IFictionRepository fictionRepository)
 //IFictionRepository fictionRepository;
 public HomeController(IFeatureRepository featureRepository, IWebcastRepository webcastRepository, IHintTagRepository hintTagRepository)
 {
     this.featureRepository = featureRepository;
     this.webcastRepository = webcastRepository;
     this.hintTagRepository = hintTagRepository;
     //this.fictionRepository = fictionRepository;
 }
Example #16
0
        // private IActorRef viewModelSyncActorRef;
        public AppViewModel(IWindowManager windowManager, IEventAggregator eventAggregator, IFeatureRepository repository)
        {
            DisplayName = "Feature Admin 3 for SharePoint 2013";

            this.windowManager = windowManager;

            this.eventAggregator = eventAggregator;
            this.eventAggregator.Subscribe(this);

            this.repository = repository;

            StatusBarVm = new StatusBarViewModel(eventAggregator);

            FeatureDefinitionListVm = new FeatureDefinitionListViewModel(eventAggregator, repository);

            LocationListVm = new LocationListViewModel(eventAggregator, repository);

            ActivatedFeatureVm = new ActivatedFeatureViewModel(eventAggregator);

            LogVm = new LogViewModel(eventAggregator);

            InitializeActors();

            InitializeFarmLoad();
        }
Example #17
0
        private void Initialize(IFeatureRepository repository, string username)
        {
            try
            {
                var features = repository.GetByUsername(username);

                if (String.IsNullOrWhiteSpace(username) == false)
                {
                    var featuresForThisUser =
                        (
                            from temp in features
                            where String.IsNullOrWhiteSpace(temp.Username) == false
                            select temp
                        ).ToList();

                    foreach (var userSpecificFeature in featuresForThisUser)
                    {
                        // if there's a user-specific feature config, remove the non-user-specific feature
                        RemoveGenericUserFeatureConfiguration(features, userSpecificFeature);
                    }
                }

                Initialize(features);
            }
            catch (SqlException)
            {
                Console.WriteLine("FeatureManager got a SqlException.");
            }
        }
 public ApplicationFeatureDomainServiceTest()
 {
     _mediator = Substitute.For <IMediator>();
     _applicationFeatureRepository    = Substitute.For <IApplicationFeatureRepository>();
     _featureRepository               = Substitute.For <IFeatureRepository>();
     _applicationFeatureDomainService = new ApplicationFeatureDomainService(_mediator, _applicationFeatureRepository, _featureRepository);
 }
Example #19
0
 public ArticlesController(IFeatureRepository featureRepository, IBlogPostRepository blogPostRepository, IUserRepository userRepository)
     : base(userRepository)
 {
     _blogPostRepository = blogPostRepository;
     _featureRepository  = featureRepository;
     _featureService     = new FeatureService(_featureRepository);
 }
Example #20
0
 public HomeController(IUpgradeRepository upgradeRepository, IFeatureRepository featureRepository, IUserRepository userRepository, ILogger <CoursesController> logger)
 {
     _upgradeRepository = upgradeRepository;
     _featureRepository = featureRepository;
     _userRepository    = userRepository;
     _logger            = logger;
 }
        public void TearUp()
        {
            var mockRepository = new Mock<IFeatureRepository>();
            mockRepository.Setup(x => x.ActiveFeatures()).Returns(fakeFeatures);

            this.featureRepository = mockRepository.Object;
        }
 public FeatureService(IFeatureRepository featureRepository, IFeatureSetRepository fsRepo, IFeatureSetListRepository fslRepo,
                       IFeatureSetAccessRepository fsaRepo)
 {
     this.repository = featureRepository;
     this.fsaRepo    = fsaRepo;
     this.fslRepo    = fslRepo;
     this.fsRepo     = fsRepo;
 }
Example #23
0
        public FeatureService(IFeatureRepository featureRepository, TcpContext context)
        {
            _featureRepository = featureRepository;

            _features    = context.Set <Feature>();
            _userStories = context.Set <UserStory>();
            _tasks       = context.Set <TaskItem>();
        }
 public FeatureService(IFeatureRepository featureRepository, IFeatureSetRepository fsRepo, IFeatureSetListRepository fslRepo,
             IFeatureSetAccessRepository fsaRepo)
 {
     this.repository = featureRepository;
     this.fsaRepo = fsaRepo;
     this.fslRepo = fslRepo;
     this.fsRepo = fsRepo;
 }
 public HistogramController(IHistogramRepository repository, IUserEventRepository userEventRepository, IGenerate<Histogram> generateHistogram, IFeatureRepository featureRepository, IBackgroundJobClient backgroundJobClient)
 {
     this.repository = repository;
     this.userEventRepository = userEventRepository;
     this.generateHistogram = generateHistogram;
     this.featureRepository = featureRepository;
     this.backgroundJobClient = backgroundJobClient;
 }
        public FeatureService(IFeatureRepository featureRepository, IReferenceGenerator referenceGenerator)
        {
            Check.If(featureRepository).IsNotNull();
            Check.If(referenceGenerator).IsNotNull();

            _featureRepository = featureRepository;
            _referenceGenerator = referenceGenerator;
        }
 public NewslettersController(IFeatureRepository featureRepository, INewsletterRepository newsletterRepository, INewsletterSubscriberRepository newsletterSubscriberRepository, IBlogPostRepository blogPostRepository, IBlogRepository blogRepository, IUserRepository userRepository)
     : base(userRepository)
 {
     _blogPostRepository = blogPostRepository;
     _newsletterSubscriberRepository = newsletterSubscriberRepository;
     _newsletterService = new NewsletterService(newsletterRepository);
     _blogRepository = blogRepository;
 }
 public NewslettersController(IFeatureRepository featureRepository, INewsletterRepository newsletterRepository, INewsletterSubscriberRepository newsletterSubscriberRepository, IBlogPostRepository blogPostRepository, IBlogRepository blogRepository, IUserRepository userRepository) :
     base(userRepository)
 {
     _blogPostRepository             = blogPostRepository;
     _newsletterSubscriberRepository = newsletterSubscriberRepository;
     _newsletterService = new NewsletterService(newsletterRepository);
     _blogRepository    = blogRepository;
 }
 public ApplicationFeatureDomainService(
     IMediator mediator,
     IApplicationFeatureRepository applicationFeatureRepository,
     IFeatureRepository featureRepository) : base(mediator)
 {
     _applicationFeatureRepository = applicationFeatureRepository;
     _featureRepository            = featureRepository;
 }
Example #30
0
 public EthnicityService(IEthnicityRepository repository,
                         IEthnicityFeatureRepository ethinicityFeatureRepository,
                         IFeatureRepository featureRepository)
     : base(repository)
 {
     _ethnicityRepository         = repository;
     _ethinicityFeatureRepository = ethinicityFeatureRepository;
     _featureRepository           = featureRepository;
 }
Example #31
0
        //IBrandRepository repo = new BrandRepository(new InventoryDb());
        //IBrandRepository repo;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["id"] != null)
            {
                if (Session["id"].Equals("Admin"))
                {
                    featureRepo = new FeatureRepository(db);
                    if (!IsPostBack)
                    {
                        BindData();
                        //if (gvFeatureDetails.ro)
                        //{
                        //    gvFeatureDetails.DataSource = featureRepo.GetAll().ToList();
                        //    gvFeatureDetails.DataBind();
                        //}
                        //else
                        //{
                        //    //Empty DataTable to execute the “else-condition”
                        //    DataTable dt = new Datatable();
                        //    gvFeatureDetails.DataSource = dt;
                        //    gvFeatureDetails.DataBind();
                        //}
                        //DataTable FromTable = new DataTable();

                        ////if (gvFeatureDetails.Rows.Count > 0)
                        //{
                        //    gvFeatureDetails.DataSource = featureRepo.GetAll().ToList();
                        //    gvFeatureDetails.DataBind();
                        //}
                        //else
                        //{
                        //    FromTable.Rows.Add(FromTable.NewRow());
                        //    gvFeatureDetails.DataSource = FromTable;
                        //    gvFeatureDetails.DataBind();
                        //    int TotalColumns = gvFeatureDetails.Rows[0].Cells.Count;
                        //    gvFeatureDetails.Rows[0].Cells.Clear();
                        //    gvFeatureDetails.Rows[0].Cells.Add(new TableCell());
                        //    gvFeatureDetails.Rows[0].Cells[0].ColumnSpan = TotalColumns;
                        //    gvFeatureDetails.Rows[0].Cells[0].Text = "No records Found";
                        //}
                        //ddlbrandid.DataSource = featureRepo.GetAll().ToList();
                        //ddlbrandid.DataSource=Product;;
                        //ddlbrandid.DataTextField = "BrandName";
                        //ddlbrandid.DataValueField = "BrandId";
                        // ddlbrandid.DataBind();
                    }
                }
                else
                {
                    lblMsg.Text = "you don't have permission for this page";
                }
            }
            else
            {
                Response.Redirect("~/Login/Login.aspx");
            }
        }
 public TimeSeriesController(ApiDataContext context, ITimeSeriesRepository timeSeriesRepository, IUserEventRepository userEventRepository, IGenerate<TimeSeries> generateTimeSeries, IFeatureRepository featureRepository, IBackgroundJobClient backgroundJobClient)
 {
     this.context = context;
     this.timeSeriesRepository = timeSeriesRepository;
     this.userEventRepository = userEventRepository;
     this.generateTimeSeries = generateTimeSeries;
     this.featureRepository = featureRepository;
     this.backgroundJobClient = backgroundJobClient;
 }
 /// <summary>
 /// this is the default constructor for level controller
 /// </summary>
 public LevelService(ILevelRepository levelRepository, IDepartmentDesignationRepository departmentDesignationRepository, IFeatureRepository featureRepository, IDesignationRepository designationRepository, IDepartmentRepository departmentRepository, IDesignationLevelRepository designationLevelRepository)
 {
     _levelRepository = levelRepository;
     _departmentDesignationRepository = departmentDesignationRepository;
     _featureRepository          = featureRepository;
     _designationRepository      = designationRepository;
     _departmentRepository       = departmentRepository;
     _designationLevelRepository = designationLevelRepository;
 }
Example #34
0
        public TaskManagerActor(IEventAggregator eventAggregator, IFeatureRepository repository)
        {
            this.eventAggregator = eventAggregator;
            this.eventAggregator.Subscribe(this);
            this.repository = repository;
            taskActors      = new Dictionary <Guid, IActorRef>();

            Receive <LoadTask>(message => Handle(message));
        }
 public FeatureController(ILectuerRepository lectuerRepository, ICatalogRepository catalogRepository,
     ISubtypeRepository subtypeRepository, IDynastyRepository dynastyRepository,
     IFeatureRepository featureRepository)
 {
     this.lectuerRepository = lectuerRepository;
     this.catalogRepository = catalogRepository;
     this.subtypeRepository = subtypeRepository;
     this.dynastyRepository = dynastyRepository;
     this.featureRepository = featureRepository;
 }
Example #36
0
        public BaseListViewModel(IEventAggregator eventAggregator, IFeatureRepository repository) :
            base(eventAggregator, repository)
        {
            ScopeFilters = new ObservableCollection <Scope>(Common.Constants.Search.ScopeFilterList);

            lastUpdateInitiatedSearch = DateTime.Now;

            // https://github.com/Fody/PropertyChanged/issues/269
            ActivationProcessed += (s, e) => SelectionChanged();
        }
Example #37
0
        public UserService()
        {
            var dbFactory = new DbFactory();    //("iCafe-" + "CompanyCode", "CompanyCode-" + "branchcode");

            this.userRepository       = new UserRepository(dbFactory);
            this.roleRepository       = new RoleRepository(dbFactory);
            this.featureRepository    = new FeatureRepository(dbFactory);
            this.roleAccessRepository = new RoleAccessRepository(dbFactory);
            this.unitOfWork           = new UnitOfWork(dbFactory);
        }
Example #38
0
 protected void BindData()
 {
     try
     {
         featureRepo = new FeatureRepository(db);
         var data = featureRepo.GetAll().OrderByDescending(o => o.FeatureId).ToList();
         if (data.Count == 0)
         {
             data.Add(new Domain.Feature()
             {
                 FeatureId = 0, FeatureName = "", FeatureDescription = ""
             });
             gvFeatureDetails.DataSource = data;
             gvFeatureDetails.DataBind();
             gvFeatureDetails.Rows[0].Visible = false;
             gvFeatureDetails.ShowFooter      = true;
         }
         else
         {
             gvFeatureDetails.DataSource = data;
             gvFeatureDetails.DataBind();
         }
         ////conn.Open();
         //string cmdstr = "Select * from EmployeeDetails";
         //SqlCommand cmd = new SqlCommand(cmdstr, conn);
         //SqlDataAdapter adp = new SqlDataAdapter(cmd);
         //adp.Fill(ds);
         //cmd.ExecuteNonQuery();
         //FromTable = ds.Tables[0];
         //if (FromTable.Rows.Count > 0)
         //{
         //    gvFeatureDetails.DataSource = FromTable;
         //    gvFeatureDetails.DataBind();
         //}
         //else
         //{
         //    FromTable.Rows.Add(FromTable.NewRow());
         //    gvFeatureDetails.DataSource = FromTable;
         //    gvFeatureDetails.DataBind();
         //    int TotalColumns = gvFeatureDetails.Rows[0].Cells.Count;
         //    gvFeatureDetails.Rows[0].Cells.Clear();
         //    gvFeatureDetails.Rows[0].Cells.Add(new TableCell());
         //    gvFeatureDetails.Rows[0].Cells[0].ColumnSpan = TotalColumns;
         //    gvFeatureDetails.Rows[0].Cells[0].Text = "No records Found";
         //}
     }
     catch (Exception ex)
     {
         Response.Write(ex.Message);
     }
     finally
     {
         //conn.Close();
     }
 }
Example #39
0
 /// <summary>
 /// Props provider
 /// </summary>
 /// <param name="eventAggregator">the event aggregator</param>
 /// <param name="repository">feature repository</param>
 /// <param name="dataService">SharePoint data service</param>
 /// <param name="id">task Id</param>
 /// <returns></returns>
 /// <remarks>
 /// see also https://getakka.net/articles/actors/receive-actor-api.html
 /// </remarks>
 public static Props Props(
     IEventAggregator eventAggregator,
     IFeatureRepository repository,
     IDataService dataService,
     Guid id)
 {
     return(Akka.Actor.Props.Create(() => new LoadTaskActor(
                                        eventAggregator,
                                        repository,
                                        dataService,
                                        id)));
 }
Example #40
0
 /// <summary>
 /// Props provider
 /// </summary>
 /// <param name="eventAggregator">caliburn micro event aggregator</param>
 /// <param name="repository">feature repository</param>
 /// <param name="id">task id</param>
 /// <returns></returns>
 /// <remarks>
 /// see also https://getakka.net/articles/actors/receive-actor-api.html
 /// </remarks>
 public static Props Props(
     IEventAggregator eventAggregator,
     IFeatureRepository repository,
     IDataService dataService,
     Guid taskId)
 {
     return(Akka.Actor.Props.Create(() =>
                                    new FeatureDefinitionTaskActor(
                                        eventAggregator,
                                        repository,
                                        dataService,
                                        taskId)));
 }
 public HomeController(IWebcastRepository webcastRepository, IFeatureRepository featureRepository,
     ICatalogRepository catalogRepository, ILectuerRepository lectuerRepository,
     ISubtypeRepository subtypeRepository, IDynastyRepository dynastyRepository,IAtkRepository atkRepository)
     //IFictionRepository fictionRepository
 {
     this.webcastRepository = webcastRepository;
     this.featureRepository = featureRepository;
     this.catalogRepository = catalogRepository;
     this.lectuerRepository = lectuerRepository;
     this.subtypeRepository = subtypeRepository;
     this.dynastyRepository = dynastyRepository;
     //this.fictionRepository = fictionRepository;
     this.atkRepository = atkRepository;
 }
Example #42
0
        public FeatureModule(IIdeaRepository ideas, IFeatureRepository features)
            : base("/idea")
        {
            _ideas = ideas;
            _features = features;

            Post["/{idea}/feature"] = _ =>
            {
                int id = _.Idea;
                var feature = new Feature
                                {
                                    Time = DateTime.UtcNow,
                                    Text = Request.Form.feature
                                };
                _features.Add(id, feature);

                return Response.AsRedirect(string.Format("/idea/{0}#{1}", id, feature.Id));
            };
        }
Example #43
0
        public FeatureModule(IFeatureRepository features, IUserRepository users)
            : base("/idea")
        {
            _features = features;

            this.RequiresAuthentication();

            Post["/{idea}/feature"] = _ =>
            {
                int id = _.Idea;
                var feature = new Feature
                                {
                                    Time = DateTime.UtcNow,
                                    Text = Request.Form.feature,
                                    User = Context.GetCurrentUser(users)
                                };
                _features.Add(id, feature);

                return Response.AsRedirect(string.Format("/idea/{0}#{1}", id, feature.Id));
            };
        }
Example #44
0
 public HomeController(IFeatureRepository featureRepository)
 {
     this.featureRepository = featureRepository;
 }
		public FranchiseSetController(IFranchiseSetRepository franchisesetRepository, IFeatureRepository featureRepository)
		{
			this.franchisesetRepository = franchisesetRepository;
			this.featureRepository = featureRepository;
		}
Example #46
0
 public FeatureService(IFeatureRepository featureRepository)
 {
     _featureRepository = featureRepository;
 }
 public HistogramController(ApiDataContext context, IFeatureRepository featureRepository, IBackgroundJobClient backgroundJobClient)
     : this(new HistogramRepository(context), new UserEventRepository(context), new GenerateFeatureDecorator<Histogram>(new GenerateHistogram(), featureRepository), featureRepository, backgroundJobClient)
 {
 }
 public FeatureService(IFeatureRepository aFeatureRepository)
 {
     theFeatureRepo = aFeatureRepository;
 }
 public TimeSeriesController(ApiDataContext context, IFeatureRepository featureRepository)
     : this(context, new TimeSeriesRepository(context), new UserEventRepository(context), new GenerateFeatureDecorator<TimeSeries>(new GenerateTimeSeries(),featureRepository), featureRepository, new BackgroundJobClient())
 {
 }
Example #50
0
 public AccountController(IBlogPostRepository blogPostRepository, IFeatureRepository featureRepository, IUserRepository userRepository, IBlogRepository blogRepository)
     : base(userRepository)
 {
     _userRepository = userRepository;
 }
 public HomeController(IWebcastRepository webcastRepository, IFeatureRepository featureRepository)
 {
     this.webcastRepository = webcastRepository;
     this.featureRepository = featureRepository;
 }
 public WebcastController(IUnitOfWork unitOfWork, IWebcastRepository webcastRepository, IFeatureRepository featureRepository)
 {
     this.unitOfWork = unitOfWork;
     this.webcastRepository = webcastRepository;
     this.featureRepository = featureRepository;
 }
Example #53
0
 public FeatureBeeBuilder Use(IFeatureRepository featureRepository = null, List<IConditionEvaluator> conditionEvaluators = null)
 {
     customFeatureRepository = featureRepository;
     customConditionEvaluators = conditionEvaluators;
     return this;
 }
Example #54
0
 public FeaturesController(IFeatureRepository featureRepository)
 {
     _featureRepository = featureRepository;
 }
Example #55
0
        public UserModule(IUserRepository users, IIdeaRepository ideas, IFeatureRepository features)
        {
            _users = users;
            _ideas = ideas;
            _features = features;

            this.RequiresAuthentication();

            Get["/profile"] = _ =>
                                  {
                                      User user = Context.GetCurrentUser(_users);
                                      if (user == null) return Response.AsRedirect("/");

                                      var i = _ideas.GetAll().Where(u => u.Author.Id == user.Id).ToList();
                                      var f = _features.GetAll().Where(u => u.User.Id == user.Id).ToList();
                                      var v = _users.GetVotes(user.Id).ToList();

                                      return View["Profile/Index",
                                          new
                                          {
                                              Title = "Profile",
                                              Id = user.Id,
                                              UserName = user.UserName,
                                              Email = user.Email,
                                              Github = user.Github,
                                              Ideas = i,
                                              Features = f,
                                              Votes = v,
                                              Claims = user.Claims.ToList(),
                                              IsLoggedIn = Context.IsLoggedIn()
                                          }];
                                  };

            Get["/profile/edit"] = _ =>
                                       {
                                           User user = Context.GetCurrentUser(_users);
                                           if (user == null) return Response.AsRedirect("/");

                                           return View["Profile/Edit", new
                                                                           {
                                                                               Title = "Profile",
                                                                               Id = user.Id,
                                                                               UserName = user.UserName,
                                                                               Email = user.Email,
                                                                               Github = user.Github,
                                                                               Claims = user.Claims.ToList(),
                                                                               IsLoggedIn = Context.IsLoggedIn(),
                                                                           }];
                                       };

            Post["/profile/checkuser"] = _ =>
                                             {
                                                 string username = Request.Form.username;

                                                 var userExists = _users.FindBy(u => u.UserName == username).Any();

                                                 string msg = "";

                                                 if (username == Context.CurrentUser.UserName)
                                                     msg = "";
                                                 else if (string.IsNullOrWhiteSpace(username))
                                                     msg = Strings.UserModule_UsernameNotValid;
                                                 else if (userExists)
                                                     msg = Strings.UserModule_UsernameTaken;
                                                 else msg = Strings.UserModule_UsernameAvailable;

                                                 return Response.AsJson(new
                                                                            {
                                                                                Status = "OK",
                                                                                msg = msg
                                                                            });
                                             };

            Post["/profile/save"] = _ =>
                                        {
                                            var user = Context.GetCurrentUser(_users);
                                            user.UserName = Request.Form.username;
                                            user.Email = Request.Form.email;
                                            user.AvatarUrl = user.Email.ToGravatarUrl(40);
                                            user.Github = Request.Form.github;

                                            _users.Edit(user);

                                            return Response.AsRedirect("/profile");
                                        };
        }
 public ProfileController(IUserRepository users, IIdeaRepository ideas, IFeatureRepository features)
 {
     _users = users;
     _ideas = ideas;
     _features = features;
 }