public ShowOperationsByCategoryCommand(IStorage <CardOperation> cardOPerationStorage, IModelStringView <CardOperation> cardOperationStringView,
                                        IDbLogicManager dbLogicManager)
 {
     _cardOperationStorage    = cardOPerationStorage;
     _cardOperationStringView = cardOperationStringView;
     _dbLogicManager          = dbLogicManager;
 }
        public SetCardOperationSetCommand(IStorage <CardOperation> cardOperationStorage, IModelStringView <CardOperation> cardOperationStringView,
                                          IDbLogicManager dbLogicManager)
        {
            _cardOperationStorage    = cardOperationStorage;
            _cardOperationStringView = cardOperationStringView;
            _dbLogicManager          = dbLogicManager;

            _cardOperationRetriveHandlers.Add(new Tuple <string, Func <Task <List <CardOperation> > > >(
                                                  "За месяц",
                                                  async() => await _cardOperationStorage.Get(op => op.DateTime > DateTime.Now.AddMonths(-1))));
            _cardOperationRetriveHandlers.Add(new Tuple <string, Func <Task <List <CardOperation> > > >(
                                                  "За два месяца",
                                                  async() => await _cardOperationStorage.Get(op => op.DateTime > DateTime.Now.AddMonths(-2))));
            _cardOperationRetriveHandlers.Add(new Tuple <string, Func <Task <List <CardOperation> > > >(
                                                  "Последние 10",
                                                  async() => await _cardOperationStorage.Get(op => true, 10, op => op.DateTime)));
            _cardOperationRetriveHandlers.Add(new Tuple <string, Func <Task <List <CardOperation> > > >(
                                                  "По категориям",
                                                  GetByCategory));
            _cardOperationRetriveHandlers.Add(new Tuple <string, Func <Task <List <CardOperation> > > >(
                                                  "По имени",
                                                  GetByName));
            _cardOperationRetriveHandlers.Add(new Tuple <string, Func <Task <List <CardOperation> > > >(
                                                  "По сумме",
                                                  GetByAmount));
        }
Exemplo n.º 3
0
 public EditCardOperationUserInterfaceCommand(CardOperation operation, IModelStringView <CardOperation> operationStringView,
                                              IDbLogicManager dbLogicManager)
 {
     this._operation           = operation;
     this._operationStringView = operationStringView;
     this._dbLogicManager      = dbLogicManager;
 }
 public ImportCardOperationsCommand(ICardOperationsLoader cardOperationsImporter,
                                    IModelStringView <CardOperation> cardOperationView,
                                    IStorage <CardOperation> cardOperationStorage,
                                    IStorage <CardOperationsImport> cardOperationsImportStorage,
                                    IDbLogicManager dbLogicManager)
 {
     _operationsImporter          = cardOperationsImporter;
     _cardOperationView           = cardOperationView;
     _cardOperationStorage        = cardOperationStorage;
     _cardOperationsImportStorage = cardOperationsImportStorage;
     _dbLogicManager = dbLogicManager;
 }
Exemplo n.º 5
0
 public SearchForOperationsCommand(IStorage<CardOperation> cardOPerationStorage, IModelStringView<CardOperation> cardOperationStringView,
     IDbLogicManager dbLogicManager, IModelStringView<OperationSetStatistics> cardOperationSetStatisticsStringView)
 {
     _cardOperationStringView = cardOperationStringView;
     _dbLogicManager = dbLogicManager;
     _cardOperationSetStatisticsStringView = cardOperationSetStatisticsStringView;
     _menuHandlers = new List<MenuItemHandler>()
     {
         new MenuItemHandler{MenuLabel = "По имени", Handler =  this.SearchByName},
         new MenuItemHandler{MenuLabel = "По сумме потраченого.", Handler =  this.SearchByAmountSpent}
     };
 }
Exemplo n.º 6
0
        public ShowOperationsByPeriodCommand(IStorage <CardOperation> cardOPerationStorage, IModelStringView <CardOperation> cardOperationStringView,
                                             IModelStringView <OperationSetStatistics> cardOperationSetStatisticsStringView)
        {
            _cardOperationStorage    = cardOPerationStorage;
            _cardOperationStringView = cardOperationStringView;
            _cardOperationSetStatisticsStringView = cardOperationSetStatisticsStringView;

            _cardOperationRetriveHandlers.Add(new Tuple <string, Func <Task <List <CardOperation> > > >(
                                                  "За месяц",
                                                  async() => await _cardOperationStorage.Get(op => op.DateTime > DateTime.Now.AddMonths(-1))));
            _cardOperationRetriveHandlers.Add(new Tuple <string, Func <Task <List <CardOperation> > > >(
                                                  "За два месяца",
                                                  async() => await _cardOperationStorage.Get(op => op.DateTime > DateTime.Now.AddMonths(-2))));
            _cardOperationRetriveHandlers.Add(new Tuple <string, Func <Task <List <CardOperation> > > >(
                                                  "Последние 10",
                                                  async() => await _cardOperationStorage.Get(op => true, 10, op => op.DateTime)));
        }
 public ShowOperationsCommand(IStorage <CardOperation> cardOperationsStorage,
                              IModelStringView <CardOperation> cardOperationStringView, IServiceProvider serviceProvider)
 {
     _cardOperationsStorage   = cardOperationsStorage;
     _cardOperationStringView = cardOperationStringView;
     _menuItems = new List <MenuCommandItem>()
     {
         new MenuCommandItem {
             Command = serviceProvider.GetService <ShowOperationsByPeriodCommand>(), MenuItemLabel = "Показать операции за период"
         },
         new MenuCommandItem {
             Command = serviceProvider.GetService <ShowOperationsByCategoryCommand>(), MenuItemLabel = "Показать операции по категории"
         },
         new MenuCommandItem {
             Command = serviceProvider.GetService <SearchForOperationsCommand>(), MenuItemLabel = "Поиск попераций"
         },
         new MenuCommandItem {
             Command = serviceProvider.GetService <OutcomeByCategoryReportCommand>(), MenuItemLabel = "Отчёт по категориям"
         }
     };
 }
 public EditCardOperationsCommand(IDbLogicManager dbLogicManager, IModelStringView <CardOperation> cardOperationStringView)
 {
     this._dbLogicManager          = dbLogicManager;
     this._cardOperationStringView = cardOperationStringView;
 }
 public AddCardOperationToCategoryCommand(IModelStringView <CardOperation> cardOperationStringView, IDbLogicManager dbLogicManager)
 {
     _cardOperationStringView = cardOperationStringView;
     _dbLogicManager          = dbLogicManager;
 }