public ExpensesController(
     IExpensesService expensesService,
     IUserResolverService userResolverService)
 {
     this.expensesService     = expensesService;
     this.userResolverService = userResolverService;
 }
Example #2
0
 public ExpensesController(IExpensesService expensesBusinessLogic, IExceptionHandler exceptionHandler, IMapper mapper, ILogger <ExpensesController> logger)
 {
     this.expensesBusinessLogic = expensesBusinessLogic ?? throw new ArgumentNullException(nameof(expensesBusinessLogic));
     this._exceptionHandler     = exceptionHandler;
     _mapper = mapper;
     _logger = logger;
 }
Example #3
0
        public ExpensesServiceTest()
        {
            this.currentTime = 14.June(2020).AddHours(11).AddMinutes(42).AsUtc();
            var timeServiceMock = new Mock <ITimeService>();

            timeServiceMock.Setup(timeService => timeService.GetCurrentUtcTime()).Returns(this.currentTime);

            var services = new ServiceCollection();

            services.AddDbContext <LuccaContext>(options => options.UseInMemoryDatabase(databaseName: "UnitTestInMemoryDatabase"), ServiceLifetime.Transient);
            this.serviceProvider = services.BuildServiceProvider();

            var luccaContext = serviceProvider.GetService <LuccaContext>();

            natashaUser = new UserInfo()
            {
                Id = Guid.Parse("C95F9FEB-31A4-46AD-B3AC-6FEC5804863F"), Currency = "RUB", FirstName = "Natasha", LastName = "Romanova"
            };
            anthonyUser = new UserInfo()
            {
                Id = Guid.Parse("32952B48-7D36-48C4-9413-F9E70B002C16"), Currency = "USD", FirstName = "Anthony", LastName = "Stark"
            };
            luccaContext.UserInfo.Add(natashaUser);
            luccaContext.UserInfo.Add(anthonyUser);
            luccaContext.SaveChanges();

            this.expensesService = new ExpensesService(serviceProvider, timeServiceMock.Object);
        }
Example #4
0
 public ExpensesController(IExpensesService expensesService,
                           ICurrencyService currencyService,
                           ILogger <ExpensesController> logger)
 {
     _expensesService = expensesService;
     _currencyService = currencyService;
     _logger          = logger;
 }
Example #5
0
 public EntityStorage(IExpensesService service)
 {
     if (service == null)
     {
         throw new ArgumentNullException(nameof(service));
     }
     m_service = service;
 }
Example #6
0
 public MyWeddingController(UserManager <ApplicationUser> userManager, IWeddingService weddingService, IGuestsService guestsService, IExpensesService expensesService, ITasksService tasksService)
 {
     this.userManager     = userManager;
     this.weddingService  = weddingService;
     this.guestsService   = guestsService;
     this.tasksService    = tasksService;
     this.expensesService = expensesService;
 }
        public ExpensesController(IExpensesService expensesService)
        {
            Guard.WhenArgument <IExpensesService>(expensesService, "Expenses service cannot be null.")
            .IsNull()
            .Throw();

            this.expensesService = expensesService;
        }
Example #8
0
 public FinanceService(
     IExpensesService expensesService,
     IIncomeService incomeService,
     ITaxService taxService)
 {
     _expensesService = expensesService ?? throw new ArgumentNullException(nameof(expensesService));
     _incomeService   = incomeService ?? throw new ArgumentNullException(nameof(incomeService));
     _taxService      = taxService ?? throw new ArgumentNullException(nameof(taxService));
 }
 public static Currency GetCurrency(this Account account, IExpensesService service)
 {
     if (service == null)
     {
         throw new ArgumentNullException("service");
     }
     if (account == null)
     {
         throw new ArgumentNullException("account");
     }
     return(service.GetCurrency(account.CurrencyId));
 }
        public HistoryViewModel(IUsersService usersService,
                                IExpensesService expensesService,
                                IIncomesService incomesService)
        {
            this.expensesService = expensesService;
            this.incomesService  = incomesService;
            this.usersService    = usersService;

            this.PopulateTransactions();

            this.DeleteTransactionCommand = new RelayCommand <object>(DeleteTransaction);
            this.EditTransactionCommand   = new RelayCommand <object>(EditTransaction);
        }
Example #11
0
 public ExpensesController(
     IPropertyService propertyService,
     IPropertyTypeService propertyTypeService,
     IAppUserService appUserService,
     IMapper mapper,
     IBuildingService buildingService,
     IExpensesService expensesService)
 {
     this.propertyService     = propertyService;
     this.propertyTypeService = propertyTypeService;
     this.appUserService      = appUserService;
     this.mapper          = mapper;
     this.buildingService = buildingService;
     this.expensesService = expensesService;
 }
 public TimesheetController(
     ITimesheetService timesheetService,
     IExpensesService expensesService,
     IPaymentService paymentService,
     ICarerService carerService,
     IRenderingService renderingService,
     ILoggingService loggingService,
     IBookingService bookingService)
 {
     this.renderingService = renderingService;
     this.timesheetService = timesheetService;
     this.expensesService  = expensesService;
     this.paymentService   = paymentService;
     this.carerService     = carerService;
     this.loggingService   = loggingService;
     this.bookingService   = bookingService;
 }
Example #13
0
        public ExpenseAddEditViewModel(IUsersService usersService,
                                       IExpensesService expensesService,
                                       IExpensesFactory expensesFactory,
                                       IModelFactory modelFactory)
        {
            this.usersService    = usersService;
            this.expensesService = expensesService;
            this.expensesFactory = expensesFactory;
            this.modelFactory    = modelFactory;

            this.SimpleExpense = this.modelFactory.CreateSimpleExpense();
            this.Date          = DateTime.Today;
            this.IsEditMode    = false;
            this.IsSaveMode    = true;

            this.SaveCommand = new RelayCommand(Save);
            this.EditCommand = new RelayCommand(Edit);
        }
Example #14
0
        public ExpensesViewModel(
            IBaseService baseService,
            IExpensesService expensesService,
            ISettingsService settingsService,
            IEventAggregator eventAggregator
            ) : base(baseService)
        {
            _baseService     = baseService;
            _expensesService = expensesService;
            _settingsService = settingsService;
            _eventAggregator = eventAggregator;

            TabName = "Utgifter";

            LivingconditionsList = _expensesService.GetLivingconditionList();

            EditButtonCommand          = new DelegateCommand(ExecuteEditButtonCommand);
            CancelEditingButtonCommand = new DelegateCommand(ExecuteCancelEditingButtonCommand);
            SaveEditedButtonCommand    = new DelegateCommand(ExecuteSaveEditedButtonCommand);

            _eventAggregator.GetEvent <NewFiefLoadedEvent>().Subscribe(ExecuteNewFiefLoadedEvent);
        }
 public LimitsCalculator(ILimitsService limitsService, IExpensesService expensesService)
 {
     _limitsService   = limitsService;
     _expensesService = expensesService;
 }
Example #16
0
 public ExpensesController(ILoggerFactory loggerFactory, IExpensesService expensesService, ILanguage language) :
     base(loggerFactory.CreateLogger <ExpensesController>(), language)
 {
     _expensesService = expensesService;
 }
 public ExpensesController(IExpensesService expensesService, IPhotoService photoService, IMapper mapper)
 {
     _expensesService = expensesService;
     _photoService    = photoService;
     _mapper          = mapper;
 }
        public AdditionalInfoViewModel(IAccountStatusService accountStatusService, IAccountStoresService accountStoresService, IStoresService storesService, IAccountCapexesService accountCapexService, IExpensesService expenseService, ICapexesService capexService, IStoresWorkService storesWorkService)
        {
            #region infrastrcture
            ConfirmationRequest = new InteractionRequest<IConfirmation>();
            #endregion infrastructure

            #region statuses
            IsChangeStatusOpen = false;
            IsStatusHistoryOpen = false;

            StatusesList = Statuses.GetStatusesList();
            StatusHistoryList = new ObservableCollection<AccountsStatusDetailsSet>();

            ChangeStatusCommand = new DelegateCommand(ChangeStatus);
            SaveNewStatusCommand = new DelegateCommand(SaveNew, CanSaveNew);
            CancelNewStatusCommand = new DelegateCommand(CancelNew);
            OpenStatusHistoryCommand = new DelegateCommand(OpenHistory);
            #endregion statuses

            #region stores
            IsEditAccountStoresOpen = false;

            AccountStoresList = new ObservableCollection<StoresSet>();
            StoresList = new ObservableCollection<StoresSet>();

            EditAccountStoresListCommand = new DelegateCommand(EditAccountStoresList, CanEdit);
            AddStoresToAccountCommand = new DelegateCommand(() => _addStoresWorker.RunWorkerAsync(), CheckStoreErrors).ObservesProperty(() => StoresForLoad);
            DeleteAccountStoreCommand = new DelegateCommand(DeleteAccountStore);
            SearchStoreNumberByNameCommand = new DelegateCommand(SearchStoreNumberByName);
            #endregion stores

            #region  services
            _accountStatusService = accountStatusService;
            _accountStoresService = accountStoresService;
            _storesService = storesService;
            _accountCapexService = accountCapexService;
            _expenseService = expenseService;
            _capexService = capexService;
            _storesWorkService = storesWorkService;
            #endregion services

            #region capexes
            AccountCapexList = new ObservableCollection<AccountsCapexInfoSet>();
            ExpensesList = new ObservableCollection<AccountsExpenseSet>(expenseService.GetExpensesList());
            CapexesList = new ObservableCollection<CapexSet>();          
            IsAddCapexOpen = false;

            OpenAddCapexToAccountCommand = new DelegateCommand(OpenAddCapexToAccount);
            CopyAvailableSumCommand = new DelegateCommand(CopyAvailableSum);
            AddCapexToAccountCommand = new DelegateCommand(AddCapexToAccount);
            DeleteCapexAccountCommand = new DelegateCommand(DeleteCapexAccount);
            #endregion capexes

            #region workers
            _worker = new BackgroundWorker();
            _worker.DoWork += LoadAccountAdditionalInfo;

            _addStoresWorker = new BackgroundWorker();
            _addStoresWorker.DoWork += LoadAddStoresToAccount;
            _addStoresWorker.RunWorkerCompleted += LoadAddStoresToAccount_Completed;            
            #endregion workers                        
        }        
Example #19
0
 public CachedEntityStorage(IExpensesService service) : base(service)
 {
 }
Example #20
0
 public ExpenseController(IMapper mapper, IExpensesService expensesService)
 {
     _mapper          = mapper;
     _expensesService = expensesService;
 }
Example #21
0
 public static long?GetDefaultId <TEntity>(this IExpensesService service)
 {
     return(service.GetValue(Prefix + typeof(TEntity).Name)?.ToInt64());
 }
Example #22
0
 public static long?GetDefaultSubcategoryId(this IExpensesService service, long categoryId)
 {
     return(service.GetValue($"{Prefix}{typeof(Subcategory)}.{categoryId}")?.ToInt64());
 }
Example #23
0
 public static void SetDefaultId <TEntity>(this IExpensesService service, long?id)
 {
     service.StoreValue(Prefix + typeof(TEntity).Name, id?.ToString());
 }
 /// <summary>
 ///     初始化
 /// </summary>
 public ExpensesController()
 {
     _expensesService = new ExpensesService();
 }
Example #25
0
 public ExpensesController(IUserRepository userRepo, IExpensesService service, IShopSerivce _shopService)
 {
     _userRepo   = userRepo;
     _service    = service;
     shopService = _shopService;
 }
Example #26
0
 public CashBalanceCalculator(IIncomesService incomesService, IExpensesService expensesService)
 {
     _incomesService  = incomesService;
     _expensesService = expensesService;
 }
Example #27
0
 public DepenseController()
 {
     expService = new ExpensesService();
     pp         = new MissionService();
 }
Example #28
0
 public static void SetDefaultSubcategoryId(this IExpensesService service, long categoryId, long?subcategoryId)
 {
     service.StoreValue($"{Prefix}{typeof(Subcategory)}.{categoryId}", subcategoryId?.ToString());
 }
        public AddFullAccountViewModel(ICompaniesService companiesService, 
                                       ITypesService typesService, 
                                       IAccountsMainService accountsService, 
                                       IAccountStatusService accountStatusService, 
                                       IAccountStoresService accountStoresService, 
                                       IStoresService storesService, 
                                       IAccountCapexesService accountCapexService, 
                                       IExpensesService expenseService, 
                                       ICapexesService capexService, 
                                       IStoresWorkService storesWorkService,
                                       IAccountFAService accountFAService,
                                       IFAService faService)
        {


            #region account
            SaveAccountCommand = new DelegateCommand(SaveAccount, CanSave).ObservesProperty(() => Account);
            #endregion account

            #region workers

            _worker = new BackgroundWorker();
            _worker.DoWork += LoadAccount;

            _addStoresWorker = new BackgroundWorker();
            _addStoresWorker.DoWork += LoadAddStoresToAccount;
            _addStoresWorker.RunWorkerCompleted += LoadAddStoresToAccount_Completed;
            #endregion workers 

            #region  capexes
            OpenAddCapexToAccountCommand = new DelegateCommand(OpenAddCapexToAccount);
            CloseAddCapexToAccountCommand = new DelegateCommand(CloseAddCapexToAccount);
            CopyAvailableSumCommand = new DelegateCommand(CopyAvailableSum);
            AddCapexToAccountCommand = new DelegateCommand(AddCapexToAccount, CanAddCapex).ObservesProperty(() => NewCapexForAccount);
            DeleteCapexAccountCommand = new DelegateCommand(DeleteCapex);
            #endregion capexes

            #region services
            _companiesService = companiesService;
            _typesService = typesService;
            _accountsService = accountsService;
            _accountStatusService = accountStatusService;
            _accountStoresService = accountStoresService;
            _storesService = storesService;
            _accountCapexService = accountCapexService;
            _expenseService = expenseService;
            _capexService = capexService;
            _storesWorkService = storesWorkService;
            _accountFAService = accountFAService;
            _faService = faService;
            #endregion services

            #region statuses
            IsChangeStatusOpen = false;
            StatusesList = Statuses.GetStatusesList();

            CancelNewStatusCommand = new DelegateCommand(CancelNew);
            ChangeStatusCommand = new DelegateCommand(ChangeStatus);
            SaveNewStatusCommand = new DelegateCommand(SaveNew, CanSaveNew);
            #endregion statuses

            #region stores
            EditAccountStoresListCommand = new DelegateCommand(EditAccountStoresList, CanEdit);
            DeleteAccountStoreCommand = new DelegateCommand(DeleteAccountStore);
            AddStoresToAccountCommand = new DelegateCommand(() => _addStoresWorker.RunWorkerAsync(), CheckStoreErrors).ObservesProperty(() => StoresForLoad);
            CloseAddStoresToAccountCommand = new DelegateCommand(CloseAddStores);
            IsEditAccountStoresOpen = false;
            #endregion stores

            #region FA
            AddFAOpen = false;
            AddFACommand = new DelegateCommand(AddFA);
            AddFAToAccountCommand = new DelegateCommand(AddFAToAccount, CanAddFA).ObservesProperty(() => NewFA);
            CloseFACommand = new DelegateCommand(CloseFA);
            #endregion FA

        }        
 public ExpensesController(IExpensesService service)
 {
     _service = service;
 }
Example #31
0
 public SearchService(IDogsService dogsService, IExpensesService expensesService)
 {
     this.dogsService     = dogsService;
     this.expensesService = expensesService;
 }
 public YearExpensesCalculator(IExpensesService expensesSvc, ICategoriesService categoriesSvc, IGroupsService groupsSvc)
 {
     _expensesSvc   = expensesSvc;
     _categoriesSvc = categoriesSvc;
     _groupsSvc     = groupsSvc;
 }