示例#1
0
 public LoginModel(IPiggyRepository repository, IUserService service, ISettingsService settingsService)
 {
     _repository      = repository;
     _service         = service;
     _settingsService = settingsService;
     Currencies       = new List <Currency>();
 }
示例#2
0
        public OperationsModel(IPiggyRepository repository, IOperationService operationService, IAccountService accountService, ICategoryService categoryService)
        {
            _repository       = repository;
            _operationService = operationService;
            _accountService   = accountService;
            _categoryService  = categoryService;

            Operations        = new List <IOperationModel>();
            CurrentPageNumber = 1;
            _totalPages       = 1;
        }
示例#3
0
        public SettingsModel(IPiggyRepository repository, IUserService service, ISettingsService settingsService)
        {
            _repository      = repository;
            _service         = service;
            _settingsService = settingsService;

            _isDarkMode = true;
            if (_settingsService.TryGetValue(Constants.RequestedTheme, out var theme))
            {
                _isDarkMode = theme != ApplicationTheme.Light.ToString();
            }

            _language = GetCurrentLanguage();
        }
示例#4
0
        public OperationModel(Operation operation, IPiggyRepository repository, IOperationService service, IAccountService accountService, ICategoryService categoryService, bool isNew = false)
        {
            _operation       = operation;
            _repository      = repository;
            _service         = service;
            _accountService  = accountService;
            _categoryService = categoryService;
            Accounts         = new List <Account>();
            Categories       = new List <Category>();

            Amount           = operation.Amount;
            Type             = operation.Type;
            Comment          = operation.Comment;
            OperationDate    = operation.CreatedOn;
            CategoryType     = operation.CategoryType ?? CategoryType.Undefined;
            CategoryHexColor = operation.CategoryHexColor ?? "#FFFFFF";
            CategoryTitle    = operation.CategoryTitle;
            AccountTitle     = operation.AccountTitle;
            ToAccountTitle   = operation.ToTitle;
            Symbol           = operation.Symbol;
            Id    = operation.Id;
            IsNew = isNew;
        }
示例#5
0
 public AccountsModel(IAccountService service, IPiggyRepository repository)
 {
     _service    = service;
     _repository = repository;
     Accounts    = new List <IAccountModel>();
 }
示例#6
0
 public CategoriesModel(IPiggyRepository repository, ICategoryService service)
 {
     _repository = repository;
     _service    = service;
     Categories  = new List <ICategoryModel>();
 }