示例#1
0
 public AlertManager(IJanelUnitOfWork unitOfWork, IScheduleManager scheduleManager, INotificationManager notificationManager, IDateTimeManager dateTimeManager)
 {
     _unitOfWork          = unitOfWork;
     _scheduleManager     = scheduleManager;
     _notificationManager = notificationManager;
     _dateTimeManager     = dateTimeManager;
 }
 public VotingPeriodsViewModelBuilder(
     EndowmentRepositories endowmentRepositories, 
     IDateTimeManager dateTimeManager)
 {
     _endowmentRepositories = endowmentRepositories;
     _dateTimeManager = dateTimeManager;
 }
示例#3
0
 protected SyncAgent(IDataStore dataStore, ISyncTransport transport, IDateTimeManager dateTimeManager, IOrmLogger logger)
 {
     Transport       = transport;
     DateTimeManager = dateTimeManager;
     DataStore       = dataStore;
     Logger          = logger;
 }
示例#4
0
 /// <summary>
 ///     DI
 /// </summary>
 /// <param name="guidManager"></param>
 /// <param name="dateTimeManager"></param>
 public ProjectFactory(
     IGuidManager guidManager,
     IDateTimeManager dateTimeManager)
 {
     _guidManager = guidManager;
     _dateTimeManager = dateTimeManager;
 }
示例#5
0
 public FibonacciNumberMessageBuilder(
     IDateTimeManager dateTimeManager,
     IGuidManager guidManager)
 {
     this.dateTimeManager = dateTimeManager;
     this.guidManager     = guidManager;
 }
示例#6
0
        /// <summary>
        /// Create a new sync session
        /// </summary>
        /// <param name="dataStore">Datastore used to getting last sync info</param>
        /// <param name="dateTimeManager">Object used to get datetime value</param>
        /// <returns>New sync session</returns>
        public static SyncSessionInfo Create(IDataStore dataStore, IDateTimeManager dateTimeManager)
        {
            var syncSessionRepo = new SyncSessionInfoRepository(dataStore);
            var last            = syncSessionRepo.GetLastSession();

            return(Create(dateTimeManager, last));
        }
示例#7
0
 public ChangesFinder(
     IIdentityService identityService,
     IDateTimeManager dateTimeManager)
 {
     _identityService = identityService;
     _dateTimeManager = dateTimeManager;
 }
 /// <summary>
 ///     DI
 /// </summary>
 /// <param name="guidManager"></param>
 /// <param name="dateTimeManager"></param>
 public TempDepositoryFactory(
     IGuidManager guidManager,
     IDateTimeManager dateTimeManager)
 {
     _guidManager = guidManager;
     _dateTimeManager = dateTimeManager;
 }
 public SplitThatBillContext(DbContextOptions <SplitThatBillContext> options
                             , IContextData contextData
                             , IDateTimeManager dateTimeManager)
     : base(options)
 {
     _contextData     = contextData;
     _dateTimeManager = dateTimeManager;
 }
示例#10
0
 public NotificationManager(IScheduleManager scheduleManager, IJanelUnitOfWork janelUnitOfWork, IDateTimeManager dateTimeManager, IHttpContextAccessor contextAccessor)
 {
     _scheduleManager      = scheduleManager;
     _janelUnitOfWork      = janelUnitOfWork;
     _dateTimeManager      = dateTimeManager;
     _contextAccessor      = contextAccessor;
     _ongoingNotifications = new List <Notification>();
 }
示例#11
0
 public FormConnector(IUnitOfWorkFactory unitOfWorkFactory,
                      IDateTimeManager dateTimeManager,
                      IMappingManager mappingManager)
 {
     this.dateTimeManager = dateTimeManager;
     this.mappingManager  = mappingManager;
     context = unitOfWorkFactory.Create();
 }
 public HealthWiseDbContext(DbContextOptions <HealthWiseDbContext> options,
                            IDateTimeManager dateTimeManager,
                            IContextData contextData
                            ) : base(options)
 {
     _dateTimeManager = dateTimeManager;
     _contextData     = contextData;
 }
示例#13
0
        public static void InitSyncSessionInfo(IDataStore datastore, IDateTimeManager dateTimeProvider)
        {
            var session = SyncSessionInfo.Create(dateTimeProvider, null);

            session.HasSuccess = true;
            var syncSessionRepo = new SyncSessionInfoRepository(datastore);

            datastore.AddTypeSafe <SyncSessionInfo>();
            syncSessionRepo.Save(session);
        }
 public TimeRecorder(
     IDateTimeManager dateTimeManager,
     ILogger logger,
     IReader reader,
     IUnitOfWork unitOfWork)
 {
     _dateTimeManager = dateTimeManager ?? throw new ArgumentNullException(nameof(dateTimeManager), $"{nameof(dateTimeManager)} must not be null.");
     _logger          = logger ?? throw new ArgumentNullException(nameof(logger), $"{nameof(logger)} must not be null.");
     _reader          = reader ?? throw new ArgumentNullException(nameof(reader), $"{nameof(reader)} must not be null.");
     _unitOfWork      = unitOfWork ?? throw new ArgumentNullException(nameof(reader), $"{nameof(reader)} must not be null.");
 }
示例#15
0
 public ProjectHandler(
     IEntityRepository<IEndowmentEntity> entityRepository,
     IProjectFactory projectFactory,
     IProjectRepository projectRepository,
     IDateTimeManager dateTimeManager)
 {
     _entityRepository = entityRepository;
     _projectFactory = projectFactory;
     _projectRepository = projectRepository;
     _dateTimeManager = dateTimeManager;
 }
示例#16
0
 public UserService(IUserCommands userCommands, IUserQueries userQueries, IDateTimeManager dateTimeManager,
                    [ImportMany] IEnumerable <Lazy <IPasswordStrategy, IPrioritisedMefMetaData> > passwordStrategies,
                    IPasswordPolicy passwordPolicy, IOAuthRegisteredClientCollection oAuthRegisteredClientCollection)
 {
     _userCommands     = userCommands;
     _userQueries      = userQueries;
     _dateTimeManager  = dateTimeManager;
     _passwordStrategy = passwordStrategies.OrderByDescending(x => x.Metadata.Priority).First().Value;
     _passwordPolicy   = passwordPolicy;
     _oAuthRegisteredClientCollection = oAuthRegisteredClientCollection;
 }
 /// <summary>
 ///     DI
 /// </summary>
 /// <param name="acceptedProjectRepository"></param>
 /// <param name="acceptedProjectFactory"></param>
 /// <param name="entityRepository"></param>
 /// <param name="dateTimeManager"></param>
 public AcceptedProjectHandler(
     IAcceptedProjectRepository acceptedProjectRepository,
     IAcceptedProjectFactory acceptedProjectFactory,
     IEntityRepository<IEndowmentEntity> entityRepository,
     IDateTimeManager dateTimeManager)
 {
     _acceptedProjectRepository = acceptedProjectRepository;
     _acceptedProjectFactory = acceptedProjectFactory;
     _entityRepository = entityRepository;
     _dateTimeManager = dateTimeManager;
 }
示例#18
0
        /// <summary>
        /// Create a new sync session
        /// </summary>
        /// <param name="dateTimeManager">Object used to get datetime value</param>
        /// <param name="last">Last sync info</param>
        /// <returns>New sync session</returns>
        public static SyncSessionInfo Create(IDateTimeManager dateTimeManager, ISyncSessionInfo last)
        {
            var lowBoundary = last != null
                ? last.HighBoundaryAnchor
                : new DateTime(1973, 1, 1, 0, 0, 0, DateTimeKind.Utc);

            var result = new SyncSessionInfo
            {
                LowBoundaryAnchor  = lowBoundary,
                HighBoundaryAnchor = dateTimeManager.UtcNow
            };

            return(result);
        }
示例#19
0
        public Billing(Bill bill, IMapper mapper, IDateTimeManager dateTimeManager)
        {
            TotalBillWithCharges    = bill.GetBillTotal();
            TotalCharges            = bill.GetTotalChargeRates();
            TotalBillWithoutCharges = bill.GetBillTotalWithoutCharges();

            var billItems       = bill.BillItems.ToList();
            var personBillItems = billItems.SelectMany(bi => bi.PersonBillItems).ToList();

            BillItems = billItems.GroupJoin(personBillItems,
                                            l => l.Id,
                                            r => r.BillItemId,
                                            (l, r) => new { billItem = l, personBillItem = r.FirstOrDefault() })
                        .Select(s => new PersonBillItemDto
            {
                Id     = s.personBillItem is object?s.personBillItem.Id: 0,
                Person = s.personBillItem is object?
                         new PersonDto(s.personBillItem.Person.Id, s.personBillItem.Person.Firstname, s.personBillItem.Person.Lastname) :
                             null,
                             BillItem = new BillItemDto(s.billItem.Id, s.billItem.Description, s.billItem.UnitPrice, TotalCharges, s.billItem.DiscountRate)
            })
                        .ToList();

            BillDto = new BillDto
            {
                Id = bill.Id,
                EstablishmentName = bill.EstablishmentName,
                Remarks           = bill.Remarks,
                Participants      = bill.Participants.Select(p => new BillParticipantDto(p.Id,
                                                                                         new PersonDto(p.Person.Id, p.Person.Firstname, p.Person.Lastname), personBillItems.Where(w => w.PersonId == p.PersonId).Aggregate(0.0M, (acc, curr) =>
                {
                    return(acc + (curr.PayableUnitPrice * bill.GetTotalChargeRates() + curr.PayableUnitPrice));
                })
                                                                                         )).ToList(),
                BillDate                = dateTimeManager.ConvertUTCToLocal(Instant.FromDateTimeUtc(DateTime.SpecifyKind(bill.BillDate, DateTimeKind.Utc))),
                ExtraCharges            = bill.ExtraCharges.Select(ec => mapper.Map <ExtraChargeDto>(ec)).ToList(),
                BillTotal               = bill.GetBillTotal(),
                BillTotalWithoutCharges = bill.GetBillTotalWithoutCharges(),
                TotalCharges            = bill.GetTotalChargeRates(),
                Currency                = bill.Currency
            };
        }
示例#20
0
 // ReSharper disable once MemberCanBePrivate.Global
 public SyncableRepository(IRepository <TIEntity> repository, IDateTimeManager dateTimeProvider)
 {
     Repository       = repository;
     DateTimeProvider = dateTimeProvider;
 }
示例#21
0
        private static ISyncableRepository <IEntityTombstone> CreateTombstoneRepository(IRepository <TIEntity> repo, IDateTimeManager dateTimeProvider,
                                                                                        Type tombstoneType)
        {
            var tombstoneRepository = (ISyncableRepository <IEntityTombstone>)Create(tombstoneType, typeof(IEntityTombstone));

            tombstoneRepository.Repository =
                (IRepository <IEntityTombstone>)
                Repository <TEntity, TIEntity> .Create(tombstoneType, typeof(IEntityTombstone), repo.DataStore);

            tombstoneRepository.DateTimeProvider = dateTimeProvider;
            return(tombstoneRepository);
        }
示例#22
0
        /// <summary>
        /// Decorate specified repo to make it syncable
        /// </summary>
        /// <param name="repo">Repository to decorate</param>
        /// <param name="dateTimeProvider">Instance to get system time</param>
        /// <returns>Decorated repo</returns>
        public static SyncableRepository <TEntity, TIEntity> Create(IRepository <TIEntity> repo, IDateTimeManager dateTimeProvider)
        {
            var result = new SyncableRepository <TEntity, TIEntity>(repo, dateTimeProvider);

            var tombstoneType = GetEntityTombstoneType(repo.DataStore);

            if (tombstoneType == null)
            {
                return(result);
            }

            result.TombstoneRepository = CreateTombstoneRepository(repo, dateTimeProvider, tombstoneType);
            return(result);
        }
示例#23
0
 public User_CtorDependency(IDateTimeManager dateTimeManager)
 {
     DateTimeManager = dateTimeManager;
     CreationDate = dateTimeManager.Now();
 }
 public ContentPublicationDateTimeManager(IContentPublicationStateManager contentPublicationStateManager,
                                          IDateTimeManager dateTimeManager)
 {
     _contentPublicationStateManager = contentPublicationStateManager;
     _dateTimeManager = dateTimeManager;
 }
示例#25
0
 /// <summary>
 ///     DI
 /// </summary>
 /// <param name="dateTimeManager"></param>
 public TransactionFactory(IDateTimeManager dateTimeManager)
 {
     _dateTimeManager = dateTimeManager;
 }
示例#26
0
 public SyncStatProvider(IOrmSyncObserver syncObserver, IDateTimeManager dateTimeManager, IOrmLogger logger)
 {
     _syncObserver    = syncObserver;
     _dateTimeManager = dateTimeManager;
     _logger          = logger;
 }
 /// <summary>
 ///     DI
 /// </summary>
 /// <param name="dateTimeManager"></param>
 public AcceptedProjectFactory(
     IDateTimeManager dateTimeManager)
 {
     _dateTimeManager = dateTimeManager;
 }
 public GetBillingsRequestHandler(SplitThatBillContext splitThatBillContext, IMapper mapper, IDateTimeManager dateTimeManager)
 {
     _splitThatBillContext = splitThatBillContext;
     _mapper          = mapper;
     _dateTimeManager = dateTimeManager;
 }
示例#29
0
 public SyncableStore(IDateTimeManager timeManager, LocalBoundTransport transport, string name)
 {
     _name       = name;
     TimeManager = timeManager;
     Transport   = transport;
 }
示例#30
0
 public ChangesFinder(IDateTimeManager dateTimeManager) => _dateTimeManager = dateTimeManager;
 /// <summary>
 ///     DI
 /// </summary>
 /// <param name="dateTimeManager"></param>
 public ProjectHistoryFactory(
     IDateTimeManager dateTimeManager)
 {
     _dateTimeManager = dateTimeManager;
 }
 public ContentPublicationDateTimeManager([ImportMany] IEnumerable <Lazy <IContentPublicationStateManager, IPrioritisedMefMetaData> > contentPublicationStateManagers,
                                          IDateTimeManager dateTimeManager)
     : this(contentPublicationStateManagers.OrderByDescending(x => x.Metadata.Priority).First().Value, dateTimeManager)
 {
 }
示例#33
0
        public static async Task Seed(HealthWiseDbContext healthWiseDbContext, IContextData contextData, IDateTimeManager datetimeManager, IOptions <AppOptions> appOptions)
        {
            if (!healthWiseDbContext.BloodPressureReadings.Any())
            {
                var personId = appOptions.Value.TestUser;

                var bp1 = new BloodPressureReading(119, 82, 80);
                bp1.DateTaken = datetimeManager.Today;
                bp1.PersonId  = personId;

                var bp2 = new BloodPressureReading(113, 78, 75);
                bp2.DateTaken = datetimeManager.Today.AddDays(1);
                bp2.PersonId  = personId;

                var bp3 = new BloodPressureReading(115, 79, 82);
                bp3.DateTaken = datetimeManager.Today.AddDays(-1);
                bp3.PersonId  = personId;

                await healthWiseDbContext.BloodPressureReadings.AddRangeAsync(new[] { bp1, bp2, bp3 });

                await healthWiseDbContext.SaveChangesAsync();
            }
        }
示例#34
0
 public void Initialize(IDateTimeManager value)
 {
     _dateTimeManager = value;
 }
示例#35
0
 /// <summary>
 /// Create a new instance of Syncable repository
 /// </summary>
 /// <param name="dataStore">Datastore where data is located</param>
 /// <param name="dateTimeProvider">Instance to get system time</param>
 /// <returns>Syncable repo</returns>
 public static SyncableRepository <TEntity, TIEntity> Create(IDataStore dataStore, IDateTimeManager dateTimeProvider)
 {
     return(Create(new Repository <TEntity, TIEntity>(dataStore), dateTimeProvider));
 }
 public LoggingRunnerRepository(IDateTimeManager dateTimeManager, ILogger logger, IRunnerRepository baseRepository)
     : base(baseRepository)
 {
     _dateTimeManager = dateTimeManager ?? throw new ArgumentNullException(nameof(dateTimeManager), $"{nameof(dateTimeManager)} must not be null.");
     _logger          = logger ?? throw new ArgumentNullException(nameof(logger), $"{nameof(logger)} must not be null.");
 }
示例#37
0
 public ServerSyncAgent(IDataStore dataStore, ISyncTransport transport, IDateTimeManager dateTimeManager, IOrmLogger logger)
     : base(dataStore, transport, dateTimeManager, logger)
 {
 }
示例#38
0
 public SyncableClient(IDateTimeManager timeManager, LocalBoundTransport transport, string name)
     : base(timeManager, transport, name)
 {
 }
示例#39
0
 /// <summary>
 ///     DI
 /// </summary>
 /// <param name="guidManager"></param>
 /// <param name="dateTimeManager"></param>
 public UserFactory(IGuidManager guidManager, IDateTimeManager dateTimeManager)
 {
     _guidManager = guidManager;
     _dateTimeManager = dateTimeManager;
 }
示例#40
0
 public SyncableClient CreateClient(IDateTimeManager dateTimeProvider, string name)
 {
     return(new SyncableClient(dateTimeProvider, new LocalBoundTransport(), name));
 }
示例#41
0
 public ScheduleManager(IJanelUnitOfWork unitOfWork, IDateTimeManager dateTimeManager, IPersonManager personManager)
 {
     _unitOfWork      = unitOfWork;
     _dateTimeManager = dateTimeManager;
     _personManager   = personManager;
 }