コード例 #1
0
        public TimeTrackerOptions getTimeTrackerOptions()
        {
            var timeTrackerOptions = new TimeTrackerOptions();

            config.GetSection("TimeTracker").Bind(timeTrackerOptions);
            return(timeTrackerOptions);
        }
コード例 #2
0
        public TeamHoursRepository(
            ILogger <TeamHoursRepository> logger,
            IOptions <TimeTrackerOptions> timeTrackerOptions,
            IUserContext userContext,
            GraphAppUserService graphUserService,
            GraphAppSharePointService graphSharePointService,
            GraphAppCalendarService graphCalendarService,
            GraphAppTasksService graphTasksService,
            GraphAppMailService graphMailService,
            IWorkflowService <WorkHours> workHoursWorkflowService,
            ICacheService <ListCollectionPage <TeamHours> > teamHoursCache,
            ICacheService <ListCollectionPage <GraphResultItem> > directReportsCache)
        {
            _logger                   = logger ?? throw new ArgumentNullException(nameof(logger));
            _timeTrackerOptions       = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
            _userContext              = userContext ?? throw new ArgumentNullException(nameof(userContext));
            _graphUserService         = graphUserService ?? throw new ArgumentNullException(nameof(graphUserService));
            _graphSharePointService   = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
            _graphCalendarService     = graphCalendarService ?? throw new ArgumentNullException(nameof(graphCalendarService));
            _graphTasksService        = graphTasksService ?? throw new ArgumentNullException(nameof(graphTasksService));
            _graphMailService         = graphMailService ?? throw new ArgumentNullException(nameof(graphMailService));
            _workHoursWorkflowService = workHoursWorkflowService ?? throw new ArgumentNullException(nameof(workHoursWorkflowService));
            _teamHoursCache           = teamHoursCache ?? throw new ArgumentNullException(nameof(teamHoursCache));
            _directReportsCache       = directReportsCache ?? throw new ArgumentNullException(nameof(directReportsCache));

            _teamHoursDataList = new List <TeamHours>();
        }
コード例 #3
0
 /// <summary>
 /// Constructor
 /// </summary>
 public GraphAppSharePointService(
     IGraphAuthProvider authProvider,
     IUserContext userContext,
     TimeTrackerOptions timeTrackerOptions) : base(authProvider, userContext)
 {
     _timeTrackerOptions = timeTrackerOptions ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
 }
コード例 #4
0
 public AnalyticsRepository(
     TimeTrackerOptions timeTrackerOptions,
     GraphAppSharePointService graphSharePointService)
 {
     _timeTrackerOptions     = timeTrackerOptions ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
 }
コード例 #5
0
 public TimezoneHelper(
     ILogger <TimezoneHelper> logger,
     IOptionsSnapshot <TimeTrackerOptions> timeTrackerOptions)
 {
     _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _timeZone           = GetValidatedTimezone();
 }
コード例 #6
0
 public TeamHoursService(
     IGraphAuthProvider authProvider, GraphAppSharePointService graphAppSharePointService,
     IUserContext userContext,
     TimeTrackerOptions timeTrackerOptions, TeamHoursRepository teamHoursRepository) : base(authProvider, userContext)
 {
     _timeTrackerOptions  = timeTrackerOptions ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _teamHoursRepository = teamHoursRepository ?? throw new ArgumentNullException(nameof(teamHoursRepository));
 }
コード例 #7
0
 /// <summary>
 /// Constructor
 /// </summary>
 public GraphTasksService(
     IGraphAuthProvider authProvider,
     IUserContext userContext,
     ILogger <GraphTasksService> logger,
     IOptionsSnapshot <TimeTrackerOptions> timeTrackerOptions) : base(authProvider, userContext)
 {
     _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
 }
コード例 #8
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="logger">The logging provider to use</param>
 /// <param name="timeTrackerOptions">The app settings provider</param>
 public MonthlyReportHoursService(IGraphAuthProvider authProvider,
                                  IUserContext userContext,
                                  TimeTrackerOptions timeTrackerOptions,
                                  ReportHoursRepository reportHoursRepository)
 {
     _timeTrackerOptions    = timeTrackerOptions ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _reportHoursRepository = reportHoursRepository ?? throw new ArgumentNullException(nameof(reportHoursRepository)); // For HR
     //_notificationsRepository = notificationRepository ?? throw new ArgumentNullException(nameof(notificationRepository));
 }
コード例 #9
0
 /// <summary>
 /// Constructor
 /// </summary>
 public WorkflowServiceHelper(
     TimeTrackerOptions timeTrackerOptions,
     GraphAppUserService graphUserService,
     GraphAppSharePointService graphSharePointService,
     UserProfileRepository userProfileRepository)
 {
     _timeTrackerOptions     = timeTrackerOptions ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _graphUserService       = graphUserService ?? throw new ArgumentNullException(nameof(graphUserService));
     _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
     _userProfileRepository  = userProfileRepository ?? throw new ArgumentNullException(nameof(userProfileRepository));
 }
コード例 #10
0
 public RefreshHoursTask(
     TimeTrackerOptions timeTrackerOptions,
     GraphAppUserService graphUserService,
     GraphAppSharePointService graphSharePointService,
     Microsoft.Azure.WebJobs.ExecutionContext context)
 {
     _timeTrackerOptions     = timeTrackerOptions ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _graphUserService       = graphUserService ?? throw new ArgumentNullException(nameof(graphUserService));
     _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
     _context = context ?? throw new ArgumentNullException(nameof(context));
 }
コード例 #11
0
 /// <summary>
 /// Constructor
 /// </summary>
 public GraphAppTasksService(
     IGraphAuthProvider authProvider,
     IUserContext userContext,
     // ILogger<GraphAppTasksService> logger,
     TimeTrackerOptions timeTrackerOptions,
     string userObjectIdentifier) : base(authProvider, userContext)
 {
     // _logger = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions   = timeTrackerOptions ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _userObjectIdentifier = userObjectIdentifier;
 }
コード例 #12
0
 public AnalyticsRepository(
     ILogger <AnalyticsRepository> logger,
     IOptions <TimeTrackerOptions> timeTrackerOptions,
     GraphAppUserService graphUserService,
     GraphAppSharePointService graphSharePointService)
 {
     _logger                 = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions     = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _graphUserService       = graphUserService ?? throw new ArgumentNullException(nameof(graphUserService));
     _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
 }
コード例 #13
0
        public DirectReportsMemoryCache(
            ILogger <DirectReportsMemoryCache> logger,
            IOptionsSnapshot <TimeTrackerOptions> timeTrackerOptions,
            IMemoryCache memoryCache)
        {
            _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
            _timeTrackerOptions = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
            _memoryCache        = memoryCache ?? throw new ArgumentNullException(nameof(memoryCache));

            _cacheTime = _timeTrackerOptions.WorkHoursCacheMinutes;
        }
コード例 #14
0
        public NotificationsMemoryCache(
            ILogger <NotificationsMemoryCache> logger,
            IOptions <TimeTrackerOptions> timeTrackerOptions,
            IMemoryCache memoryCache)
        {
            _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
            _timeTrackerOptions = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
            _memoryCache        = memoryCache ?? throw new ArgumentNullException(nameof(memoryCache));

            _cacheTime = _timeTrackerOptions.NotificationsCacheMinutes;
        }
コード例 #15
0
 /// <summary>
 /// Constructor
 /// </summary>
 public GraphAppUserService(
     IGraphAuthProvider authProvider,
     IUserContext userContext,
     ILogger <GraphAppUserService> logger,
     IOptions <TimeTrackerOptions> timeTrackerOptions,
     IHostingEnvironment hostingEnvironment) : base(authProvider, userContext)
 {
     _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _hostingEnvironment = hostingEnvironment ?? throw new ArgumentNullException(nameof(hostingEnvironment));
 }
コード例 #16
0
        public ReportHoursMemoryCache(
            ILogger <ReportHoursMemoryCache> logger,
            IOptions <TimeTrackerOptions> timeTrackerOptions,
            IMemoryCache memoryCache)
        {
            _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
            _timeTrackerOptions = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
            _memoryCache        = memoryCache ?? throw new ArgumentNullException(nameof(memoryCache));

            _cacheTime = _timeTrackerOptions.WorkHoursCacheMinutes; // TODO: Add setting for this one in timetrackeroptions
        }
コード例 #17
0
        public AutoSubmitWorkHoursTask(
            TimeTrackerOptions timeTrackerOptions,
            GraphAppUserService graphUserService,
            GraphAppSharePointService graphSharePointService)
        {
            _timeTrackerOptions     = timeTrackerOptions ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
            _graphUserService       = graphUserService ?? throw new ArgumentNullException(nameof(graphUserService));
            _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));

            _schedule = _timeTrackerOptions.CutoffDayEmployee;
        }
コード例 #18
0
 public TimerHoursRepository(
     ILogger <TimerHoursRepository> logger,
     IOptions <TimeTrackerOptions> timeTrackerOptions,
     GraphAppSharePointService graphSharePointService,
     IUserContext userContext
     )
 {
     _logger                 = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions     = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
     _userContext            = userContext ?? throw new ArgumentNullException(nameof(userContext));
 }
コード例 #19
0
 public TeamHoursController(
     ILogger <TeamHoursController> logger,
     IOptionsSnapshot <TimeTrackerOptions> timeTrackerOptions,
     IRepository <UserProfile> userProfileRepository,
     IViewModelService <TeamHoursViewModel> teamHoursService,
     IDataService dataServiceClient)
 {
     _logger                = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions    = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _userProfileRepository = userProfileRepository ?? throw new ArgumentNullException(nameof(userProfileRepository));
     _teamHoursService      = teamHoursService ?? throw new ArgumentNullException(nameof(teamHoursService));
     _dataServiceClient     = dataServiceClient ?? throw new ArgumentNullException(nameof(dataServiceClient));
 }
コード例 #20
0
 public TeamHoursService(
     ILogger <TeamHoursService> logger,
     IOptionsSnapshot <TimeTrackerOptions> timeTrackerOptions,
     IRepository <UserProfile> userProfileRepository,
     IRepository <TeamHours> teamHoursRepository,
     LocService sharedLocalizer)
 {
     _logger                = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions    = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _userProfileRepository = userProfileRepository ?? throw new ArgumentNullException(nameof(userProfileRepository));
     _teamHoursRepository   = teamHoursRepository ?? throw new ArgumentNullException(nameof(teamHoursRepository));
     _sharedLocalizer       = sharedLocalizer;
 }
コード例 #21
0
 public ReportHoursRepository(
     ILogger <ReportHoursRepository> logger,
     IOptions <TimeTrackerOptions> timeTrackerOptions,
     GraphAppUserService graphUserService,
     GraphAppSharePointService graphSharePointService,
     ICacheService <ListCollectionPage <ReportHours> > reportHoursCache)
 {
     _logger                 = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions     = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _graphUserService       = graphUserService ?? throw new ArgumentNullException(nameof(graphUserService));
     _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
     _reportHoursCache       = reportHoursCache ?? throw new ArgumentNullException(nameof(reportHoursCache));
 }
コード例 #22
0
 /// <summary>
 /// Constructor
 /// </summary>
 public WorkHoursWorkflowService(
     TimeTrackerOptions timeTrackerOptions,
     GraphAppUserService graphUserService,
     GraphAppSharePointService graphSharePointService,
     WorkflowServiceHelper workflowServiceHelper,
     string objectIdentifier)
 {
     _timeTrackerOptions     = timeTrackerOptions ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _graphUserService       = graphUserService ?? throw new ArgumentNullException(nameof(graphUserService));
     _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
     _workflowServiceHelper  = workflowServiceHelper ?? throw new ArgumentNullException(nameof(workflowServiceHelper));
     _objectIdentifier       = objectIdentifier;
 }
コード例 #23
0
 /// <summary>
 /// Constructor
 /// </summary>
 public WorkflowServiceHelper(
     ILogger <WorkflowServiceHelper> logger,
     IOptions <TimeTrackerOptions> timeTrackerOptions,
     GraphAppUserService graphUserService,
     GraphAppSharePointService graphSharePointService,
     IRepository <Notifications> notificationsRepository,
     IRepository <UserProfile> userProfileRepository)
 {
     _logger                 = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions     = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _graphUserService       = graphUserService ?? throw new ArgumentNullException(nameof(graphUserService));
     _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
     _userProfileRepository  = userProfileRepository ?? throw new ArgumentNullException(nameof(userProfileRepository));
 }
コード例 #24
0
 public UserProfileRepository(
     TimeTrackerOptions timeTrackerOptions,
     IUserContext userContext,
     GraphAppUserService graphUserService,
     GraphAppSharePointService graphSharePointService,
     string objectIdentifier
     )
 {
     _timeTrackerOptions     = timeTrackerOptions ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _userContext            = userContext ?? throw new ArgumentNullException(nameof(userContext));
     _graphUserService       = graphUserService ?? throw new ArgumentNullException(nameof(graphUserService));
     _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
     _objectIdentifier       = objectIdentifier;
 }
コード例 #25
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="logger">The logging provider to use</param>
 public AnalyticsController(
     ILogger <MonthlyReportHoursController> logger,
     IOptionsSnapshot <TimeTrackerOptions> timeTrackerOptions,
     IRepository <UserProfile> userProfileRepository,
     IAnalyticsServiceDashBoard <AnalyticsViewModel> analyticsservice,
     IDataService dataServiceClient
     )
 {
     _logger                = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions    = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _userProfileRepository = userProfileRepository ?? throw new ArgumentNullException(nameof(userProfileRepository));
     _analyticsService      = analyticsservice ?? throw new ArgumentNullException(nameof(analyticsservice));
     _dataServiceClient     = dataServiceClient ?? throw new ArgumentNullException(nameof(dataServiceClient));
 }
コード例 #26
0
 public UserProfileRepository(
     ILogger <UserProfileRepository> logger,
     IOptions <TimeTrackerOptions> timeTrackerOptions,
     IUserContext userContext,
     GraphAppUserService graphUserService,
     GraphAppSharePointService graphSharePointService,
     ICacheService <UserProfile> memoryCacheService)
 {
     _logger                 = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions     = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _userContext            = userContext ?? throw new ArgumentNullException(nameof(userContext));
     _graphUserService       = graphUserService ?? throw new ArgumentNullException(nameof(graphUserService));
     _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
     _memoryCacheService     = memoryCacheService ?? throw new ArgumentNullException(nameof(memoryCacheService));
 }
コード例 #27
0
ファイル: HomeController.cs プロジェクト: ineba/Timesheet-1
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="logger">The logging provider to use</param>
 /// <param name="timeTrackerOptions">The app settings provider</param>
 /// <param name="dataServiceClient">Data Service client</param>
 public HomeController(
     ILogger <HomeController> logger,
     IOptionsSnapshot <TimeTrackerOptions> timeTrackerOptions,
     IRepository <MiddleTier.Models.UserProfile> userProfileRepository,
     GraphAppSharePointService graphSharePointService,
     IDataService dataServiceClient,
     LocService sharedLocalizer, ICacheService <ListCollectionPage <WorkHours> > cacheService)
 {
     _logger                 = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions     = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
     _dataServiceClient      = dataServiceClient ?? throw new ArgumentNullException(nameof(dataServiceClient));
     _sharedLocalizer        = sharedLocalizer ?? throw new ArgumentNullException(nameof(logger));
     _userProfileRepository  = userProfileRepository ?? throw new ArgumentNullException(nameof(userProfileRepository));
     _cacheService           = cacheService ?? throw new ArgumentNullException(nameof(cacheService));
 }
コード例 #28
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="logger">The logging provider to use</param>
 public MonthlyReportHoursController(
     ILogger <MonthlyReportHoursController> logger,
     IOptionsSnapshot <TimeTrackerOptions> timeTrackerOptions,
     IRepository <UserProfile> userProfileRepository,
     IMonthlyReportHoursService <MyMonthlyHoursViewModel> reportHoursService,
     //    IMonthlyReportHoursService<MyMonthlyHoursViewModel> uxReportHoursService,
     IDataService dataServiceClient
     )
 {
     _logger                = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions    = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _userProfileRepository = userProfileRepository ?? throw new ArgumentNullException(nameof(userProfileRepository));
     _reportHoursService    = reportHoursService ?? throw new ArgumentNullException(nameof(reportHoursService));
     // _uxReportHoursService = uxReportHoursService ?? throw new ArgumentNullException(nameof(uxReportHoursService));
     _dataServiceClient = dataServiceClient ?? throw new ArgumentNullException(nameof(dataServiceClient));
 }
コード例 #29
0
 public AnalyticsService(
     ILogger <TimeTrackerDataService> logger,
     IOptionsSnapshot <TimeTrackerOptions> timeTrackerOptions,
     IRepository <WorkHours> workHoursRepository,
     IRepository <Analytics> analyticsRepository,
     GraphAppSharePointService graphSharePointService,
     LocService sharedLocalizer
     )
 {
     _logger                 = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions     = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _workHoursRepository    = workHoursRepository ?? throw new ArgumentNullException(nameof(workHoursRepository));
     _analyticsRepository    = analyticsRepository ?? throw new ArgumentNullException(nameof(analyticsRepository));
     _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
     _sharedLocalizer        = sharedLocalizer ?? throw new ArgumentNullException(nameof(logger));
 }
コード例 #30
0
 /// <summary>
 /// Constructor
 /// </summary>
 public WorkHoursWorkflowService(
     ILogger <WorkHoursWorkflowService> logger,
     IOptionsSnapshot <TimeTrackerOptions> timeTrackerOptions,
     GraphAppUserService graphUserService,
     GraphAppSharePointService graphSharePointService,
     WorkflowServiceHelper workflowServiceHelper,
     IRepository <Notifications> notificationsRepository,
     IRepository <UserProfile> userProfileRepository,
     ICacheService <ListCollectionPage <WorkHours> > cacheService)
 {
     _logger                  = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions      = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _graphUserService        = graphUserService ?? throw new ArgumentNullException(nameof(graphUserService));
     _graphSharePointService  = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
     _workflowServiceHelper   = workflowServiceHelper ?? throw new ArgumentNullException(nameof(workflowServiceHelper));
     _notificationsRepository = notificationsRepository ?? throw new ArgumentNullException(nameof(notificationsRepository));
     _userProfileRepository   = userProfileRepository ?? throw new ArgumentNullException(nameof(userProfileRepository));
     _cacheService            = cacheService ?? throw new ArgumentNullException(nameof(cacheService));
 }