Beispiel #1
0
 public PlotTemplateService(
     DqdvContext db,
     TemplatePlotter templatePlotter,
     ChartSettingProvider chartSettingProvider,
     ICacheProvider cacheProvider)
 {
     _db = db;
     _templatePlotter      = templatePlotter;
     _chartSettingProvider = chartSettingProvider;
     _cacheProvider        = cacheProvider;
 }
Beispiel #2
0
        ////////////////////////////////////////////////////////////
        // Constructors
        ////////////////////////////////////////////////////////////

        /// <inheritdoc />
        /// <summary>
        /// Initialize a new instance of <see cref="T:WebApp.Controller.Api.ViewController" />
        /// </summary>
        /// <param name="db"></param>
        /// <param name="plotTemplateService"></param>
        /// <param name="exporter"></param>
        /// <param name="selectProjectListQuery"></param>
        public ViewController(
            DqdvContext db,
            PlotTemplateService plotTemplateService,
            ChartExporter exporter,
            SelectProjectListQuery selectProjectListQuery)
        {
            _db = db;
            _plotTemplateService    = plotTemplateService;
            _exporter               = exporter;
            _selectProjectListQuery = selectProjectListQuery;
        }
Beispiel #3
0
        ////////////////////////////////////////////////////////////
        // Constructors
        ////////////////////////////////////////////////////////////

        /// <summary>
        /// Initialize a new instance of <see cref="ProjectService"/>
        /// </summary>
        /// <param name="db">Instance of <see cref="DqdvContext"/></param>
        /// <param name="projectPlotCache">Instance of <see cref="ProjectPlotCache"/></param>
        /// <param name="jobClient">Instance of <see cref="IBackgroundJobClient"/></param>
        /// <param name="options">Background job options</param>
        public ProjectService(
            DqdvContext db,
            ProjectPlotCache projectPlotCache,
            IBackgroundJobClient jobClient,
            IOptions options)
        {
            _db = db;
            _projectPlotCache = projectPlotCache;
            _jobClient        = jobClient;
            _options          = options;
        }
Beispiel #4
0
        public static IEnumerable <Project> GetAllUserProjects(this DqdvContext @this, string userId)
        {
            List <Project> projects = new List <Project>();
            AppUser        user     = @this.Users.FirstOrDefault(p => p.Id == userId);

            if (user != null)
            {
                projects.AddRange(user.Projects);
                projects.AddRange(user.SharedProjects);
            }
            return(projects);
        }
Beispiel #5
0
 public ProjectController(
     IStorage storage,
     DqdvContext db,
     ProjectService projectService,
     IBackgroundJobClient jobClient,
     IOptions options)
 {
     _storage        = storage;
     _db             = db;
     _jobClient      = jobClient;
     _options        = options;
     _projectService = projectService;
 }
Beispiel #6
0
        ////////////////////////////////////////////////////////////
        // Constructors
        ////////////////////////////////////////////////////////////

        /// <inheritdoc />
        /// <summary>
        /// Initialize a new instance of <see cref="T:WebApp.Controller.Api.ChartTemplateController" />
        /// </summary>
        /// <param name="db"></param>
        /// <param name="plotTemplateService"></param>
        /// <param name="chartSettingProvider"></param>
        /// <param name="exporter"></param>
        /// <param name="selectProjectListQuery"></param>
        public PlotController(
            DqdvContext db,
            PlotTemplateService plotTemplateService,
            ChartSettingProvider chartSettingProvider,
            ChartExporter exporter,
            SelectProjectListQuery selectProjectListQuery)
        {
            _db = db;
            _plotTemplateService    = plotTemplateService;
            _exporter               = exporter;
            _selectProjectListQuery = selectProjectListQuery;
            _chartSettingProvider   = chartSettingProvider;
        }
Beispiel #7
0
        public static IEnumerable <PlotTemplate> GetAllUserPlotTemplates(this DqdvContext @this, string userId, string templateUserId)
        {
            List <PlotTemplate> templates = new List <PlotTemplate>();
            var user         = @this.Users.FirstOrDefault(p => p.Id == userId);
            var templateUser = @this.Users.FirstOrDefault(p => p.Id == templateUserId);

            if (user != null && templateUser != null)
            {
                templates.AddRange(templateUser.PlotTemplates);
                templates.AddRange(user.PlotTemplates);
                templates.AddRange(user.SharedTemplates);
            }
            return(templates);
        }
Beispiel #8
0
 public ChartController(
     IStorage storage,
     DqdvContext db,
     ChartSettingProvider chartSettingProvider,
     PlotTemplateService plotTemplateService,
     Func <PlotType, ChartPlotterBase> chartPlotterFactory,
     ChartExporter exporter,
     SelectProjectListQuery selectProjectListQuery)
 {
     _storage = storage;
     _db      = db;
     _chartSettingProvider   = chartSettingProvider;
     _chartPlotterFactory    = chartPlotterFactory;
     _exporter               = exporter;
     _selectProjectListQuery = selectProjectListQuery;
     _plotTemplateService    = plotTemplateService;
 }
Beispiel #9
0
 public static IQueryable <Project> GetProjects(this DqdvContext @this, string userId)
 {
     return(@this.Projects
            .AsExpandable()
            .Where(p => p.UserId == userId));
 }
Beispiel #10
0
 public static IQueryable <PlotTemplate> GetPlotTemplates(this DqdvContext @this, string userId)
 {
     return(@this.PlotTemplates
            .AsExpandable()
            .Where(p => p.UserId == userId));
 }
Beispiel #11
0
 public ProjectsController(DqdvContext db, IBackgroundJobClient jobClient, IOptions options)
 {
     _db        = db;
     _jobClient = jobClient;
     _options   = options;
 }
Beispiel #12
0
        ////////////////////////////////////////////////////////////
        // Constructors
        ////////////////////////////////////////////////////////////

        public ChartSettingProvider(DqdvContext db, ICacheProvider cacheProvider)
        {
            _cacheProvider = cacheProvider;
            _db            = db;
        }
Beispiel #13
0
        private static void MigrateDatabase()
        {
            var connectionString = ConfigurationManager.ConnectionStrings["Default"];

            DqdvContext.Migrate(connectionString.ConnectionString, connectionString.ProviderName);
        }
Beispiel #14
0
        ////////////////////////////////////////////////////////////
        // Constructors
        ////////////////////////////////////////////////////////////

        /// <inheritdoc />
        /// <summary>
        /// Initialize a new instance of <see cref="T:WebApp.Controllers.Api.UserPreferencesController" />
        /// </summary>
        /// <param name="db"></param>
        /// <param name="cacheProvider"></param>
        public UserPreferencesController(DqdvContext db, ICacheProvider cacheProvider)
        {
            _db            = db;
            _cacheProvider = cacheProvider;
        }
Beispiel #15
0
 public ProjectDataRepository(DqdvContext db, ProjectPlotCache cache)
 {
     _db    = db;
     _cache = cache;
 }
Beispiel #16
0
        ////////////////////////////////////////////////////////////
        // Constructors
        ////////////////////////////////////////////////////////////

        public UserPreferencesService(DqdvContext db)
        {
            _db = db;
        }