コード例 #1
0
        public ServiceReportForStoreByMonthViewModel(IServiceZipsService serviceZipService, IStoresService storeService, IAccountsMainService accountsMainService)
        {
            #region infrastructure
            ReportsTabItemHeader = "Отчет по затратам на ресторан";
            MonthesList = Monthes.GetMonthesList();
            #endregion infrastructure

            #region report
            ServiceZipList = new ObservableCollection<ServiceZipDetailsSet>();
            MonthExpList = new ObservableCollection<MonthExp>();
            StoresList = new List<StoresSet>();
            ServiceAccountsList = new List<AccountsMainSet>();
            MonthServExpList = new ObservableCollection<MonthExp>();
            #endregion report

            #region services
            _serviceZipService = serviceZipService;
            _storeService = storeService;
            _accountsMainService = accountsMainService;
            #endregion services

            #region workers
            _worker = new BackgroundWorker();
            _worker.DoWork += LoadServiceZip;
            _worker.RunWorkerCompleted += LoadServiceZip_Completed;
            #endregion workers
        }       
コード例 #2
0
        public CapexReportViewModel(ICapexesService capexService, IAccountStatusService statusService, IAccountsMainService accountsMainService, IStoresService storeService)
        {
            #region infrastructure
            ReportsTabItemHeader = "Отчет по CAPEX";
            #endregion infrastructure

            #region capex
            YearList = new List <int>();
            for (var i = 2015; i <= DateTime.Now.Year; i++)
            {
                YearList.Add(i);
            }
            CapexList                = new ObservableCollection <CapexWithRest>();
            CapexAccountsList        = new ObservableCollection <AccountsWithStatus>();
            LoadCapexCommand         = new DelegateCommand(LoadCapex);
            LoadSelectedCapexCommand = new DelegateCommand(LoadSelectedCapex);
            StatusSumList            = new ObservableCollection <StatusSum>();
            _storesList              = new List <StoresSet>();
            #endregion capex

            #region services
            _capexService        = capexService;
            _statusService       = statusService;
            _accountsMainService = accountsMainService;
            _storesService       = storeService;
            #endregion services

            #region workers
            _worker                     = new BackgroundWorker();
            _worker.DoWork             += LoadFullCapexInfo;
            _worker.RunWorkerCompleted += LoadFullCapexInfo_Completed;
            #endregion workers
        }
コード例 #3
0
        public ServiceReportForStoreByMonthViewModel(IServiceZipsService serviceZipService, IStoresService storeService, IAccountsMainService accountsMainService)
        {
            #region infrastructure
            ReportsTabItemHeader = "Отчет по затратам на ресторан";
            MonthesList          = Monthes.GetMonthesList();
            #endregion infrastructure

            #region report
            ServiceZipList      = new ObservableCollection <ServiceZipDetailsSet>();
            MonthExpList        = new ObservableCollection <MonthExp>();
            StoresList          = new List <StoresSet>();
            ServiceAccountsList = new List <AccountsMainSet>();
            MonthServExpList    = new ObservableCollection <MonthExp>();
            #endregion report

            #region services
            _serviceZipService   = serviceZipService;
            _storeService        = storeService;
            _accountsMainService = accountsMainService;
            #endregion services

            #region workers
            _worker                     = new BackgroundWorker();
            _worker.DoWork             += LoadServiceZip;
            _worker.RunWorkerCompleted += LoadServiceZip_Completed;
            #endregion workers
        }
コード例 #4
0
        public AccountsViewModel(IAccountsMainService accountsMainService, IRegionManager regionManager)
        {
            #region services
            _accountsMainService = accountsMainService;
            #endregion services

            #region infrastructure
            _regionManager  = regionManager;
            IsLeftOpen      = false;
            NavigateCommand = new DelegateCommand <string>(Navigate);
            #endregion infrastructure

            #region search acc
            SearchResultList          = new ObservableCollection <AccountsMainSet>();
            IsSearchAccBusy           = false;
            SearchAccountCommand      = new DelegateCommand(StartSearch);
            DeleteAccountCommand      = new DelegateCommand(DeleteAccount);
            CloseSearchCommand        = new DelegateCommand(CloseSearch);
            DeleteConfirmationRequest = new InteractionRequest <IConfirmation>();
            #endregion search acc

            #region workers
            _searchWorker                     = new BackgroundWorker();
            _searchWorker.DoWork             += SearchAccountWork;
            _searchWorker.RunWorkerCompleted += SeachAccountWork_Completed;
            #endregion workers
        }
コード例 #5
0
        public ChangeStatusViewModel(IAccountsMainService accountsMainService, IAccountStatusService accountStatusService, IEventAggregator eventAggregator, AccountsController accountsController, IExcelReportService excelReportService)
        {
            #region infrastructure
            AccountsTabItemHeader     = "Изменение статусов";
            ExportConfirmationRequest = new InteractionRequest <IConfirmation>();
            _accountsController       = accountsController;
            #endregion infrastructure

            #region workers
            _worker         = new BackgroundWorker();
            _worker.DoWork += LoadAllAccounts;
            _worker.DoWork += LoadAllAccounts_Completed;
            #endregion workers

            #region services
            _accountsMainService  = accountsMainService;
            _accountStatusService = accountStatusService;
            _excelReportService   = excelReportService;
            #endregion services

            #region events
            _eventAggregator = eventAggregator;
            eventAggregator.GetEvent <SaveFileEvent>().Subscribe(GetFilename);
            #endregion events

            #region statuses
            SearchAccountNumberCommand = new DelegateCommand(SearchAccount);
            SelectAccountCommand       = new DelegateCommand(SelectAccount);
            DeleteSelectedAccCommand   = new DelegateCommand(DeleteSelected);
            ChangeStatusCommand        = new DelegateCommand(ChangeStatus, CanChange).ObservesProperty(() => SelectedStatus).ObservesProperty(() => AccountForChangeDate).ObservesProperty(() => AccountPayNumber);
            AccountForChangeList       = new ObservableCollection <AccountsMainSet>();

            #endregion statuses
        }
コード例 #6
0
        public StoreAccountsViewModel(IAccountsMainService accountsMainService, IStoresService storeService)
        {
            #region services
            _accountsMainService = accountsMainService;
            _storeService        = storeService;
            #endregion services

            #region infrastructure
            AccountsTabItemHeader = "Поиск по ресторанам";
            _worker                     = new BackgroundWorker();
            _worker.DoWork             += LoadStoresAndAccounts;
            _worker.RunWorkerCompleted += LoadStoresAndAccounts_Completed;
            #endregion infrastructure

            #region store
            SearchStoreResultList  = new ObservableCollection <StoresSet>();
            StoreAccountsList      = new ObservableCollection <StoreAccount>();
            IsStoreAccountsBusy    = false;
            SearchStoreCommand     = new DelegateCommand(SearchStoreMethod);
            LoadResultStoreCommand = new DelegateCommand(LoadAccountsForStore);
            #endregion store
        }
コード例 #7
0
        public AddAccountViewModel(ICompaniesService companiesService, ITypesService typesService, IAccountsMainService accountsService, IRegionManager regionManager)
        {           
            _regionManager = regionManager;
            _companiesService = companiesService;
            _typesService = typesService;
            _accountsService = accountsService;

            ConfirmationRequest = new InteractionRequest<IConfirmation>();
            AdditionalInfoConfirmationRequest = new InteractionRequest<IConfirmation>();
            _worker = new BackgroundWorker();
            _worker.DoWork += DoWork;
            LoadAllCommand = new DelegateCommand(() =>
            {
                if (!_worker.IsBusy)
                    _worker.RunWorkerAsync();
            });
            SaveAccountCommand = new DelegateCommand(SaveCommand, CanSave).ObservesProperty(() => Account);

            //Account = new AccountsMainSet();
            //Account.AccountYear = DateTime.Now.Year;
            //Account.AccountDate = DateTime.Now;

        }
コード例 #8
0
        public AddAccountViewModel(ICompaniesService companiesService, ITypesService typesService, IAccountsMainService accountsService, IRegionManager regionManager)
        {
            _regionManager    = regionManager;
            _companiesService = companiesService;
            _typesService     = typesService;
            _accountsService  = accountsService;

            ConfirmationRequest = new InteractionRequest <IConfirmation>();
            AdditionalInfoConfirmationRequest = new InteractionRequest <IConfirmation>();
            _worker         = new BackgroundWorker();
            _worker.DoWork += DoWork;
            LoadAllCommand  = new DelegateCommand(() =>
            {
                if (!_worker.IsBusy)
                {
                    _worker.RunWorkerAsync();
                }
            });
            SaveAccountCommand = new DelegateCommand(SaveCommand, CanSave).ObservesProperty(() => Account);

            //Account = new AccountsMainSet();
            //Account.AccountYear = DateTime.Now.Year;
            //Account.AccountDate = DateTime.Now;
        }
コード例 #9
0
        public StoreAccountsViewModel(IAccountsMainService accountsMainService, IStoresService storeService)
        {
            #region services
            _accountsMainService = accountsMainService;
            _storeService = storeService;
            #endregion services

            #region infrastructure
            AccountsTabItemHeader = "Поиск по ресторанам";
            _worker = new BackgroundWorker();
            _worker.DoWork += LoadStoresAndAccounts;
            _worker.RunWorkerCompleted += LoadStoresAndAccounts_Completed;
            #endregion infrastructure

            #region store
            SearchStoreResultList = new ObservableCollection<StoresSet>();
            StoreAccountsList = new ObservableCollection<StoreAccount>();
            IsStoreAccountsBusy = false;
            SearchStoreCommand = new DelegateCommand(SearchStoreMethod);
            LoadResultStoreCommand = new DelegateCommand(LoadAccountsForStore);
            #endregion store
        }        
コード例 #10
0
        public CapexReportViewModel(ICapexesService capexService, IAccountStatusService statusService, IAccountsMainService accountsMainService, IStoresService storeService)
        {
            #region infrastructure
            ReportsTabItemHeader = "Отчет по CAPEX";
            #endregion infrastructure

            #region capex
            YearList = new List<int>();
            for (var i = 2015; i <= DateTime.Now.Year; i++)
                YearList.Add(i);
            CapexList = new ObservableCollection<CapexWithRest>();
            CapexAccountsList = new ObservableCollection<AccountsWithStatus>();
            LoadCapexCommand = new DelegateCommand(LoadCapex);
            LoadSelectedCapexCommand = new DelegateCommand(LoadSelectedCapex);
            StatusSumList = new ObservableCollection<StatusSum>();
            _storesList = new List<StoresSet>();
            #endregion capex

            #region services
            _capexService = capexService;
            _statusService = statusService;
            _accountsMainService = accountsMainService;
            _storesService = storeService;
            #endregion services

            #region workers
            _worker = new BackgroundWorker();
            _worker.DoWork += LoadFullCapexInfo;
            _worker.RunWorkerCompleted += LoadFullCapexInfo_Completed;
            #endregion workers
        }
コード例 #11
0
ファイル: InfoViewModel.cs プロジェクト: Fredoq/AccountsWork
        public InfoViewModel(IAccountsMainService accountsMainService, IRegionManager regionManager, IExcelReportService excelReportService, IEventAggregator eventAggregator, AccountsController accountsController)
        {
            #region infrastructure
            AccountsTabItemHeader = "Общая информация";
            _regionManager        = regionManager;
            AccountList           = new List <AccountsMainSet>();
            NavigateCommand       = new DelegateCommand <object>(Navigate);
            CurrentYear           = DateTime.Now.Year;
            _accountsController   = accountsController;
            #endregion infrastructure

            #region services
            _accountsMainService = accountsMainService;
            _excelReportService  = excelReportService;
            #endregion services

            #region events
            _eventAggregator = eventAggregator;
            eventAggregator.GetEvent <SaveFileEvent>().Subscribe(GetFilename);
            #endregion events

            #region errors
            StoreErrorList = new ObservableCollection <AccountsMainSet>();
            CapexErrorList = new ObservableCollection <AccountsMainSet>();

            #endregion errors

            #region statuses
            StartYearStatus   = 2010;
            EndYearStatus     = CurrentYear;
            IsATH             = false;
            StatusChoicesList = new List <StatusChoice> {
                new StatusChoice {
                    Status = Statuses.InAcc
                },
                new StatusChoice {
                    Status = Statuses.InCancel
                },
                new StatusChoice {
                    Status = Statuses.InPayed
                },
                new StatusChoice {
                    Status = Statuses.InPO
                },
                new StatusChoice {
                    Status = Statuses.InReturn
                },
                new StatusChoice {
                    Status = Statuses.InWork
                }
            };
            AccountSelectedList  = new ObservableCollection <AccountsExt>();
            ExportToExcelCommand = new DelegateCommand(ExportToExcel);
            #endregion statuses

            #region workers
            _worker                     = new BackgroundWorker();
            _worker.DoWork             += LoadAccountList;
            _worker.RunWorkerCompleted += LoadAccountList_Completed;
            #endregion workers
        }
コード例 #12
0
ファイル: InfoViewModel.cs プロジェクト: Fredoq/AccountsWork
        public InfoViewModel(IAccountsMainService accountsMainService, IRegionManager regionManager, IExcelReportService excelReportService, IEventAggregator eventAggregator, AccountsController accountsController)
        {
            #region infrastructure
            AccountsTabItemHeader = "Общая информация";
            _regionManager = regionManager;
            AccountList = new List<AccountsMainSet>();
            NavigateCommand = new DelegateCommand<object>(Navigate);
            CurrentYear = DateTime.Now.Year;
            _accountsController = accountsController;
            #endregion infrastructure

            #region services
            _accountsMainService = accountsMainService;
            _excelReportService = excelReportService;
            #endregion services

            #region events
            _eventAggregator = eventAggregator;
            eventAggregator.GetEvent<SaveFileEvent>().Subscribe(GetFilename);
            #endregion events

            #region errors
            StoreErrorList = new ObservableCollection<AccountsMainSet>();
            CapexErrorList = new ObservableCollection<AccountsMainSet>();

            #endregion errors

            #region statuses
            StartYearStatus = 2010;
            EndYearStatus = CurrentYear;
            IsATH = false;
            StatusChoicesList = new List<StatusChoice> { new StatusChoice { Status = Statuses.InAcc},
                                                         new StatusChoice { Status = Statuses.InCancel },
                                                         new StatusChoice { Status = Statuses.InPayed },
                                                         new StatusChoice { Status = Statuses.InPO },
                                                         new StatusChoice { Status = Statuses.InReturn },
                                                         new StatusChoice { Status = Statuses.InWork } };
            AccountSelectedList = new ObservableCollection<AccountsExt>();
            ExportToExcelCommand = new DelegateCommand(ExportToExcel);
            #endregion statuses

            #region workers
            _worker = new BackgroundWorker();
            _worker.DoWork += LoadAccountList;
            _worker.RunWorkerCompleted += LoadAccountList_Completed;
            #endregion workers
        }        
コード例 #13
0
        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

        }        
コード例 #14
0
        public ChangeStatusViewModel(IAccountsMainService accountsMainService, IAccountStatusService accountStatusService, IEventAggregator eventAggregator, AccountsController accountsController, IExcelReportService excelReportService)
        {
            #region infrastructure
            AccountsTabItemHeader = "Изменение статусов";
            ExportConfirmationRequest = new InteractionRequest<IConfirmation>();
            _accountsController = accountsController;
            #endregion infrastructure

            #region workers
            _worker = new BackgroundWorker();
            _worker.DoWork += LoadAllAccounts;
            _worker.DoWork += LoadAllAccounts_Completed;
            #endregion workers

            #region services
            _accountsMainService = accountsMainService;
            _accountStatusService = accountStatusService;
            _excelReportService = excelReportService;
            #endregion services

            #region events
            _eventAggregator = eventAggregator;
            eventAggregator.GetEvent<SaveFileEvent>().Subscribe(GetFilename);
            #endregion events

            #region statuses
            SearchAccountNumberCommand = new DelegateCommand(SearchAccount);
            SelectAccountCommand = new DelegateCommand(SelectAccount);
            DeleteSelectedAccCommand = new DelegateCommand(DeleteSelected);
            ChangeStatusCommand = new DelegateCommand(ChangeStatus, CanChange).ObservesProperty(() => SelectedStatus).ObservesProperty(() => AccountForChangeDate).ObservesProperty(() => AccountPayNumber);            
            AccountForChangeList = new ObservableCollection<AccountsMainSet>();
            
            #endregion statuses
        }        
コード例 #15
0
        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
        }
コード例 #16
0
        public AccountsViewModel(IAccountsMainService accountsMainService, IRegionManager regionManager)
        {
            #region services
            _accountsMainService = accountsMainService;
            #endregion services

            #region infrastructure
            _regionManager = regionManager;
            IsLeftOpen = false;
            NavigateCommand = new DelegateCommand<string>(Navigate);
            #endregion infrastructure

            #region search acc
            SearchResultList = new ObservableCollection<AccountsMainSet>();
            IsSearchAccBusy = false;
            SearchAccountCommand = new DelegateCommand(StartSearch);
            DeleteAccountCommand = new DelegateCommand(DeleteAccount);
            CloseSearchCommand = new DelegateCommand(CloseSearch);
            DeleteConfirmationRequest = new InteractionRequest<IConfirmation>();
            #endregion search acc

            #region workers
            _searchWorker = new BackgroundWorker();
            _searchWorker.DoWork += SearchAccountWork;
            _searchWorker.RunWorkerCompleted += SeachAccountWork_Completed;
            #endregion workers

        }