Ejemplo n.º 1
0
        public BudgetsViewModel(IBudgetService budgetService, INavigationService navigationService, IBudgetSynchronizationService budgetSynchronizationService)
        {
            this._budgetService = budgetService;
            this._navigationService = navigationService;
            this._budgetSynchronizationService = budgetSynchronizationService;

            var canOpenBudget = this.WhenAny(f => f.SelectedBudget, budget => budget.Value != null);
            this.OpenBudget = ReactiveCommand.CreateAsyncTask(canOpenBudget, async _ =>
            {
                await this._budgetSynchronizationService.SynchronizeBudgetInBackground(this.SelectedBudget);

                this._navigationService.NavigateToViewModel<BudgetsViewModel>();
            });

            this.ReloadBudgets = ReactiveCommand.CreateAsyncTask(async _ =>
            {
                IReadOnlyCollection<Budget> budgets = await this._budgetService.GetBudgetsAsync();

                var result = new ReactiveObservableCollection<Budget>();
                result.AddRange(budgets);

                return result;
            });
            this.ReloadBudgets.ToProperty(this, f => f.Budgets, out this._budgetsHelper);
        }
Ejemplo n.º 2
0
        public BooksController(IBudgetService bookService, IRepository<Book> templateRepository)
        {

            _bookService = bookService;
            _templateRepository = templateRepository;

        }
Ejemplo n.º 3
0
 public ProjectsController(IBudgetService budgets, IWorkService works, UserManager <User> userManager, ICategoryService categories)
 {
     this.budgets     = budgets;
     this.projects    = works;
     this.categories  = categories;
     this.userManager = userManager;
 }
Ejemplo n.º 4
0
        public static List <Models.Category> PrepareBudgetModel(IBudgetService budgetService, IExchangeRateService exchangeRateService,
                                                                ICurrencyService currencyService, CountryProgramme countryProg, ProjectDonor pd, Currency displayCurrency)
        {
            List <Model.BudgetCategory> bcList = budgetService.GetBudgetCategories(pd);
            List <Model.ProjectBudget>  budgetLines;
            List <Models.Category>      categories = new List <Models.Category>();

            Models.Category category;
            int             i = 0;

            foreach (Model.BudgetCategory bc in bcList)
            {
                budgetLines = budgetService.GetProjectBLByCategory(pd, bc);
                if (budgetLines.Count > 0)
                {
                    category = new Models.Category();
                    category.EntityBudgetCategory = bc;
                    category.Id = bc.Id.ToString();
                    if (i == 0)
                    {
                        category.ProjectDonorId = (Guid)bc.ProjectDonorId;
                        category.Currencies     = new SelectList(currencyService.GetCurrencies(countryProg.Id), "Id", "ShortName", displayCurrency.Id);
                        category.CurrencyId     = displayCurrency.Id;
                    }
                    AddCategoryLinesWithNumbers(exchangeRateService, category, budgetLines, displayCurrency, countryProg);
                    categories.Add(category);
                }
            }
            if (categories.Count > 0)
            {
                ComputeTotals(categories);
            }
            return(categories);
        }
 public BudgetingController(IBudgetService budgetService, IOrganizationService organizationService, ICurrentMarket currentMarket, ICustomerService customerService)
 {
     _budgetService       = budgetService;
     _organizationService = organizationService;
     _currentMarket       = currentMarket;
     _customerService     = customerService;
 }
Ejemplo n.º 6
0
 public CheckoutViewModelFactory(
     LocalizationService localizationService,
     PaymentMethodViewModelFactory paymentMethodViewModelFactory,
     IAddressBookService addressBookService,
     IContentLoader contentLoader,
     IOrderGroupFactory orderGroupFactory,
     UrlResolver urlResolver,
     ServiceAccessor <HttpContextBase> httpContextAccessor,
     ShipmentViewModelFactory shipmentViewModelFactory,
     ICustomerService customerService,
     IOrganizationService organizationService,
     IBudgetService budgetService,
     CustomerContextFacade customerContext)
 {
     _localizationService           = localizationService;
     _paymentMethodViewModelFactory = paymentMethodViewModelFactory;
     _addressBookService            = addressBookService;
     _contentLoader            = contentLoader;
     _orderGroupFactory        = orderGroupFactory;
     _urlResolver              = urlResolver;
     _httpContextAccessor      = httpContextAccessor;
     _shipmentViewModelFactory = shipmentViewModelFactory;
     _customerService          = customerService;
     _budgetService            = budgetService;
     _organizationService      = organizationService;
     _customerContext          = customerContext;
 }
 public AccountsController(IEmployeeService empService, IExpenseReportService rptService, Employee employee,IBudgetService budget)
 {
     employeeService = empService;
     reportService = rptService;
     this.employee = employee;
     budgetTracker = budget;
 }
Ejemplo n.º 8
0
 public ProjectionsModel(IBudgetService budgetsService)
 {
     this.budgetsService = budgetsService;
     this.FromMonth      = DateTime.Now.ToMonthStart();
     this.ToMonth        = this.FromMonth.AddMonths(6);
     this.Projections    = new List <MonthProjection>();
 }
 public BudgetController(IFinancialPlannerRepository financialPlannerRepository, IBudgetService budgetService,
     ISetViewModelsService setViewModelsService)
 {
     FinancialPlannerRepository = financialPlannerRepository;
     BudgetService = budgetService;
     SetViewModelsService = setViewModelsService;
 }
 public SupervisorController(IEmployeeService empService, IExpenseReportService rptService, Employee employee,IBudgetService budget)
 {
     employeeService = empService;
     reportService = rptService;
     this.employee = employee;
     deptBudget = budget;
 }
 public SupervisorController()
 {
     reportService = new ExpenseReportService();
     employeeService = new EmployeeService();
     employee = employeeService.GetEmployee((int)Membership.GetUser().ProviderUserKey);
     deptBudget = new DepartmentBudgetService(employee.Department);
     deptBudget.SetBudgetSpent(TODAY.Month, TODAY.Year);
 }
Ejemplo n.º 12
0
 public CategoryController(ILogger <ExpenseController> logger, UserManager <ApplicationUser> userManager, IBudgetService budgetSerivce, IMainCService mainCService, IDetailedCService detailedCService)
 {
     _logger           = logger;
     _userManager      = userManager;
     _budgetService    = budgetSerivce;
     _mainCService     = mainCService;
     _detailedCService = detailedCService;
 }
 public AccountsController()
 {
     reportService = new ExpenseReportService();
     employeeService = new EmployeeService();
     config = new ConfigurationDAL();
     budgetTracker = new CompanyBudgetService(decimal.Parse((string)config.GetAppSetting(COMPANY_BUDGET_KEY)));
     employee = employeeService.GetEmployee((int)Membership.GetUser().ProviderUserKey);
 }
 public BudgetPlannerTowManagerMock(IBudgetPlanTowService budgetPlanTowService = null,
                                    IBudgetService budgetService = null,
                                    IMappingEngine mapper        = null)
     : base(budgetPlanTowService,
            budgetService,
            mapper)
 {
 }
Ejemplo n.º 15
0
 public AddEditBudgetPresenter(IAddEditBudgetView view, IBudgetService budgetService, IAccountService accountService,
     ICategoryService categoryService)
 {
     _view = view;
     _budgetService = budgetService;
     _accountService = accountService;
     _categoryService = categoryService;
 }
Ejemplo n.º 16
0
 //DI in action
 public DataController(IAccountService AccService, IBudgetService BudgetService, IHouseholdService HouseholdService, ISecurityService SecurityService, ILoggingService LoggingService)
 {
     _accService      = AccService ?? throw new ArgumentNullException(nameof(AccService));
     _budgetService   = BudgetService ?? throw new ArgumentNullException(nameof(BudgetService));
     _hhService       = HouseholdService ?? throw new ArgumentNullException(nameof(HouseholdService));
     _securityService = SecurityService ?? throw new ArgumentNullException(nameof(SecurityService));
     _logService      = LoggingService ?? throw new ArgumentNullException(nameof(LoggingService));
 }
Ejemplo n.º 17
0
 public DeliverableControllerMock(IUserService userService         = null, ILogService loggerService = null, IDeliverableService deliverableService = null,
                                  IProductService productService   = null, IPropertyService propertyService            = null, IIntergrationService _intergrationService = null,
                                  IBudgetService _iBudgetService   = null, ITrackApprovalService iTrackApprovalService = null, IImageService imageService                = null,
                                  IApprovalService approvalService = null, IInternationalService internationalService  = null)
     : base(userService, loggerService, deliverableService, productService, propertyService, _intergrationService, _iBudgetService, iTrackApprovalService,
            imageService, approvalService, internationalService)
 {
 }
Ejemplo n.º 18
0
 public BudgetController(IMapper mapper, IUriService uriService, IIdentityService identityService, IBudgetService budgetService, IPeriodService periodService)
 {
     _mapper          = mapper;
     _identityService = identityService;
     _uriService      = uriService;
     _budgetService   = budgetService;
     _periodService   = periodService;
 }
Ejemplo n.º 19
0
 public BudgetController(IBudgetService budgetService)
 {
     if (budgetService == null)
     {
         throw new ArgumentNullException(nameof(budgetService));
     }
     _budgetService = budgetService;
 }
Ejemplo n.º 20
0
 public DebtController(IMapper mapper, IUriService uriService, IIdentityService identityService, IBudgetService budgetService, IDebtService debtService, IDebtPaymentService debtPaymentService)
 {
     _mapper             = mapper;
     _uriService         = uriService;
     _identityService    = identityService;
     _budgetService      = budgetService;
     _debtService        = debtService;
     _debtPaymentService = debtPaymentService;
 }
Ejemplo n.º 21
0
 public MasterBudgetController(IPermissionService permissionService, IBudgetService budgetService, ICurrencyService currencyService,
                               IMasterBudgetService masterBudgetService, IProjectService projectService, IUserContext userContext)
     : base(userContext, permissionService)
 {
     this.budgetService       = budgetService;
     this.currencyService     = currencyService;
     this.masterBudgetService = masterBudgetService;
     this.projectService      = projectService;
 }
Ejemplo n.º 22
0
 public BudgetController(
     IBudgetService budgetService,
     IExpenseCategoryService expenseCategoryService,
     UserManager <AppUser> userManager)
 {
     _budgetService          = budgetService;
     _expenseCategoryService = expenseCategoryService;
     _userManager            = userManager;
 }
Ejemplo n.º 23
0
 public BudgetDetailsViewModelFactory(
     ILoggerFactory loggerFactory,
     IBudgetService budgetService,
     IBudgetTransactionListViewModelFactory budgetTransactionListViewModelFactory)
 {
     m_loggerFactory = loggerFactory;
     m_budgetService = budgetService;
     m_budgetTransactionListViewModelFactory = budgetTransactionListViewModelFactory;
 }
Ejemplo n.º 24
0
 public void CreateTest_should_create_new_budget()
 {
     _service = new BudgetService(_budgetRepository);
     _service.Create(new BudgetAddViewModel()
     {
         Amount = 1000, Month = "2017/01"
     });
     _budgetRepository.Received().Save(Arg.Is <Budgets>(x => x.Amount == 1000 && x.YearMonth == "2017/01"));
 }
Ejemplo n.º 25
0
 public CreditController(IMapper mapper, IUriService uriService, IIdentityService identityService, IBudgetService budgetService, ICreditService creditService, ICreditPaymentService creditPaymentService)
 {
     _mapper               = mapper;
     _uriService           = uriService;
     _identityService      = identityService;
     _budgetService        = budgetService;
     _creditService        = creditService;
     _creditPaymentService = creditPaymentService;
 }
Ejemplo n.º 26
0
 public ProjectBudgetController(IBudgetService budSvc, IProjectService _projectService, ICurrencyService currencyService,
     IExchangeRateService exchangeRateService, IUserContext userContext)
     : base(userContext)
 {
     this.budSvc = budSvc;
     this.projectService = _projectService;
     this.currencyService = currencyService;
     this.exchangeRateService = exchangeRateService;
 }
Ejemplo n.º 27
0
        public BudgetCreateViewModel(
            ILoggerFactory loggerFactory,
            IBudgetService budgetService,
            IBudgetTransactionListViewModelFactory budgetTransactionListViewModelFactory) : base(budgetService, budgetTransactionListViewModelFactory, 0)
        {
            m_logger = loggerFactory.CreateLogger <BudgetCreateViewModel>();

            Name           = "New Budget";
            SelectedPeriod = BudgetPeriod.Fortnightly;
        }
Ejemplo n.º 28
0
 public OrganizationController(IOrganizationService organizationService,
                               IAddressBookService addressService,
                               IBudgetService budgetService,
                               ISettingsService settingsService)
 {
     _organizationService = organizationService;
     _addressService      = addressService;
     _budgetService       = budgetService;
     _settingsService     = settingsService;
 }
 public TransactionsController(IBudgetService budgetService, IMapper mapper,
                               ILogger <BudgetsController> logger, UserManager <Infrastructure.Entities.BudgetUser> userManager, IRepository <Infrastructure.Entities.Transaction> transactionRepository, IRepository <Infrastructure.Entities.Budget> budgetRepository)
 {
     _budgetService         = budgetService;
     _mapper                = mapper;
     _logger                = logger;
     _userManager           = userManager;
     _transactionRepository = transactionRepository;
     _budgetRepository      = budgetRepository;
 }
        public void IntializeDepartmentService()
        {
            IBudgetDAL budgetDAL = new MockBudgetDAL();

            department = new Department();
            department.DepartmentId = 1;
            department.DepartmentName = "Test Department";
            department.MonthlyBudget = 10000;

            deptBudgetService = new DepartmentBudgetService(department,budgetDAL);
        }
        public void IntializeCompanyBudgetService()
        {
            IBudgetDAL budgetDAL = new MockBudgetDAL();

            department = new Department();
            department.DepartmentId = 1;
            department.DepartmentName = "Test Department";
            department.MonthlyBudget = 10000;

            companyBudgetService = new CompanyBudgetService(30000, budgetDAL);
        }
Ejemplo n.º 32
0
 public RegisterModel(
     UserManager <ApplicationUser> userManager,
     SignInManager <ApplicationUser> signInManager,
     ILogger <RegisterModel> logger,
     IEmailSender emailSender, IBudgetService budgetService)
 {
     _userManager       = userManager;
     _signInManager     = signInManager;
     _logger            = logger;
     _emailSender       = emailSender;
     this.budgetService = budgetService;
 }
Ejemplo n.º 33
0
 public BudgetController(IPermissionService permissionService, IBudgetService budgetService, IProjectService projectService, IMasterBudgetService masterBudgetService,
                         IExchangeRateService exchangeRateService, IStaffService staffService, IUserContext userContext, ICurrencyService currencyService,
                         IOrderRequest orderRequestService)
     : base(userContext, permissionService)
 {
     this.budgetService       = budgetService;
     this.masterBudgetService = masterBudgetService;
     this.projectService      = projectService;
     this.exchangeRateService = exchangeRateService;
     this.staffService        = staffService;
     this.currencyService     = currencyService;
     this.orderRequestService = orderRequestService;
 }
Ejemplo n.º 34
0
 public ExpensesCategoryController(
     IExpenseCategoryService expenseCategoryService,
     ExpenseTrackerDbContext context,
     ILogger <ExpensesCategoryController> logger,
     UserManager <AppUser> userManager,
     IBudgetService budgetService)
 {
     _expenseCategoryService = expenseCategoryService;
     _context       = context;
     _logger        = logger;
     _userManager   = userManager;
     _budgetService = budgetService;
 }
Ejemplo n.º 35
0
        public PaydayEventStartViewModel(
            ILoggerFactory loggerFactory,
            IBudgetService budgetService,
            int budgetId)
        {
            m_logger        = loggerFactory.CreateLogger <PaydayEventStartViewModel>();
            m_budgetService = budgetService;

            Budget budget = m_budgetService.Get(budgetId);

            AmountPaid = budget.InitialTransaction.Amount;
            At         = DateTime.Now;
        }
Ejemplo n.º 36
0
        public BudgetEditViewModel(
            ILoggerFactory loggerFactory,
            IBudgetService budgetService,
            IBudgetTransactionListViewModelFactory budgetTransactionListViewModelFactory,
            int budgetId) : base(budgetService, budgetTransactionListViewModelFactory, budgetId)
        {
            m_logger = loggerFactory.CreateLogger <BudgetEditViewModel>();

            Budget budget = m_budgetService.Get(m_budgetId);

            Name           = budget.Name;
            SelectedPeriod = budget.Period;
        }
Ejemplo n.º 37
0
        public BudgetDetailsBaseViewModel(
            IBudgetService budgetService,
            IBudgetTransactionListViewModelFactory budgetTransactionListViewModelFactory,
            int budgetId)
        {
            m_budgetService = budgetService;
            m_budgetTransactionListViewModelFactory = budgetTransactionListViewModelFactory;

            m_budgetId = budgetId;

            Periods = Enum.GetValues(typeof(BudgetPeriod)).Cast <BudgetPeriod>();

            TransactionListViewModel = m_budgetTransactionListViewModelFactory.Create(m_budgetId);
        }
Ejemplo n.º 38
0
 public OrderRequestController(IPermissionService permissionService, IOrderRequest orderRequestService, IUserContext userContext,
                               INotificationService notificationService, ILocationService locationService, IItemService itemService, IProcurementPlanService ppService,
                               IExchangeRateService exchangeRateService, ICurrencyService currencyService, IBudgetService budgetService)
     : base(userContext, permissionService)
 {
     this.orderRequestService = orderRequestService;
     this.notificationService = notificationService;
     this.locationService     = locationService;
     this.itemService         = itemService;
     this.ppService           = ppService;
     this.exchangeRateService = exchangeRateService;
     this.currencyService     = currencyService;
     this.budgetService       = budgetService;
 }
Ejemplo n.º 39
0
 public ExpensesController(
     IExpenseService expenseService,
     IViewRenderService viewRenderService,
     IBudgetService budgetService,
     IEmailService emailService,
     IExpenseCategoryService expenseCategoryService,
     UserManager <AppUser> userManager)
 {
     _emailService           = emailService;
     _expenseCategoryService = expenseCategoryService;
     _expenseService         = expenseService;
     _budgetService          = budgetService;
     _userManager            = userManager;
 }
Ejemplo n.º 40
0
 public BudgetTransactionListViewModelFactory(
     ILoggerFactory loggerFactory,
     IAccountService accountService,
     IBudgetService budgetService,
     IAccountLinkViewModelFactory accountLinkViewModelFactory,
     IBudgetTransactionItemViewModelFactory budgetTransactionItemViewModelFactory,
     IDeleteConfirmationViewService deleteConfirmationViewService)
 {
     m_loggerFactory  = loggerFactory;
     m_accountService = accountService;
     m_budgetService  = budgetService;
     m_accountLinkViewModelFactory           = accountLinkViewModelFactory;
     m_budgetTransactionItemViewModelFactory = budgetTransactionItemViewModelFactory;
     m_deleteConfirmationViewService         = deleteConfirmationViewService;
 }
Ejemplo n.º 41
0
 public BudgetController(IBudgetFactory factory, IRepository<BudgetTemplate> templateRepository, IBudgetService budgetService)
 {
     _factory = factory;
     _templateRepository = templateRepository;
     _budgetService = budgetService;
 }
Ejemplo n.º 42
0
 public BudgetListingPresenter(IBudgetListingView view, IBudgetService budgetService)
 {
     _view = view;
     _budgetService = budgetService;
 }
Ejemplo n.º 43
0
 public BudgetController(IBudgetService budgetService)
 {
     _budgetService = budgetService;
 }
Ejemplo n.º 44
0
 public MainWindowController(IBudgetService service)
 {
     _service = service;
 }
Ejemplo n.º 45
0
 public ResultReport(IResultService resultService, IBudgetService budgetService, IAccountInfoService accountInfoService)
 {
     _resultService = resultService;
     _accountInfoService = accountInfoService;
     _budgetService = budgetService;
 }
Ejemplo n.º 46
0
 public PdfGenerator(IResultService resultService, IBudgetService budgetService, IAccountInfoService accountInfoService)
 {
     _resultService = resultService;
     _accountInfoService = accountInfoService;
     _budgetService = budgetService;
 }