public AddEditAccDocumentHeaderViewModel(IAccDocumentHeadersService accDocumentHeadersService, IAppContextService appContextService, SainaDbContext uow)
        {
            _accDocumentHeadersService = accDocumentHeadersService;
            _appContextService         = appContextService;
            _uow = uow;

            DraftCommand = new RelayCommand(OnDraft, () =>
                                            AccDocumentHeader.Status != StatusEnum.Permanent && isModified);
            TemporaryCommand = new RelayCommand(OnTemporary,
                                                () => AccDocumentHeader?.HasErrors == false && AccDocumentItemListViewModel?.AccDocumentItem?.HasErrors == false &&
                                                AccDocumentHeader?.Difference == 0 &&
                                                AccDocumentHeader.Status != StatusEnum.End &&
                                                AccDocumentHeader.Status != StatusEnum.Permanent &&
                                                AccDocumentHeader.Status != StatusEnum.Temporary &&
                                                (isModified || AccDocumentHeader.Status == StatusEnum.Temporary));
            EndCommand = new RelayCommand(OnEnd,
                                          () => AccDocumentHeader?.HasErrors == false && AccDocumentItemListViewModel?.AccDocumentItem?.HasErrors == false &&
                                          AccDocumentHeader?.Difference == 0 &&
                                          AccDocumentHeader.Status == StatusEnum.Temporary
                                          );
            BackFromEndCommand = new RelayCommand(OnBackFromEnd,
                                                  () => AccDocumentHeader.Status == StatusEnum.End
                                                  );
            PermanentCommand = new RelayCommand(OnPermanent,
                                                () => AccDocumentHeader.Status == StatusEnum.End &&
                                                AccDocumentHeader?.HasErrors == false && AccDocumentItemListViewModel?.AccDocumentItem?.HasErrors == false &&
                                                AccDocumentHeader?.Difference == 0
                                                );
            CancelCommand = new RelayCommand(OnCancel);

            AccDocumentItemListViewModel       = SmObjectFactory.Container.GetInstance <AccDocumentItemListViewModel>();
            TypeDocumentsDropDownOpenedCommand = new RelayCommand(OnTypeDocumentsDropDownOpened);
        }
 public CloseProfitLossAccountListViewModel(ICloseProfitLossAccountsService closeProfitLossAccountsService, ITLDocumentsService tLDocumentsService,
                                            IOpeningClosingsService openingClosingsService, IAccDocumentItemsService accDocumentItemsService,
                                            ICurrencyExchangesService currencyExchangesService, IAccDocumentHeadersService accDocumentHeadersService,
                                            IAppContextService appContextService, ISLsService sLsService, ICompanyInformationsService companyInformationsService)
 {
     _tLDocumentsService             = tLDocumentsService;
     _companyInformationsService     = companyInformationsService;
     CompanyInformationModel         = _companyInformationsService.GetCompanyInformationModel();
     _accDocumentHeadersService      = accDocumentHeadersService;
     _openingClosingsService         = openingClosingsService;
     _accDocumentItemsService        = accDocumentItemsService;
     _currencyExchangesService       = currencyExchangesService;
     _closeProfitLossAccountsService = closeProfitLossAccountsService;
     _sLsService                  = sLsService;
     _appContextService           = appContextService;
     AccDocumentItemListViewModel = SmObjectFactory.Container.GetInstance <AccDocumentItemListViewModel>();
     SLsDropDownOpenedCommand     = new RelayCommand(OnSLsDropDownOpened, () => SLs != null && SLs.Any());
     DLs1DropDownOpenedCommand    = new RelayCommand <string>(OnDLs1DropDownOpened);
     DLs2DropDownOpenedCommand    = new RelayCommand <string>(OnDLs2DropDownOpened);
     //TransferCommand = new RelayCommand<ObservableCollection<object>>(OnTransfer, (o) => AccDocumentItems.Count > 0);
     //AllTransferCommand = new RelayCommand<ObservableCollection<object>>(OnAllTransfer, (o) => AccDocumentItems.Count > 0);
     //AllReturnCommand = new RelayCommand<ObservableCollection<object>>(OnAllReturn, (o) => AccDocumentItems1.Count > 0);
     //ReturnCommand = new RelayCommand<ObservableCollection<object>>(OnReturn, (o) => AccDocumentItems1.Count > 0);
     TransferCommand    = new RelayCommand <ObservableCollection <object> >(OnTransfer);
     AllTransferCommand = new RelayCommand <ObservableCollection <object> >(OnAllTransfer);
     AllReturnCommand   = new RelayCommand <ObservableCollection <object> >(OnAllReturn);
     ReturnCommand      = new RelayCommand <ObservableCollection <object> >(OnReturn);
     ExportCommand      = new RelayCommand(OnExport, () => !Close);
     ViewSystemDocumentHeaderCommand = new RelayCommand(OnViewSystemDocumentHeader);
     _accessUtility = SmObjectFactory.Container.GetInstance <AccessUtility>();
     // Close = true;
     //   TypeDocumentsDropDownOpenedCommand = new RelayCommand(OnTypeDocumentsDropDownOpened);
 }
Example #3
0
        public OpeningClosingDocHeaderListViewModel(IAccDocumentHeadersService accDocumentHeadersService, IAppContextService appContextService, IOpeningClosingsService openingClosingsService)
        {
            _accDocumentHeadersService = accDocumentHeadersService;
            _appContextService         = appContextService;
            _openingClosingsService    = openingClosingsService;

            EditAccDocumentHeaderCommand = new RelayCommand <AccDocumentHeader>(OnEditAccDocumentHeader);
            ReturnCommand = new RelayCommand(OnReturnd);
            DeleteCommand = new RelayCommand <AccDocumentHeader>(OnDeleteAccDocumentHeader);
        }
Example #4
0
 public EditCurrencyExchangeRateDocHeaderViewModel(IAccDocumentHeadersService accDocumentHeadersService, IAppContextService appContextService, Saina.Data.Context.SainaDbContext uow)
 {
     _accDocumentHeadersService = accDocumentHeadersService;
     _appContextService         = appContextService;
     _uow          = uow;
     CancelCommand = new RelayCommand(OnCancel);
     //  SaveCommand = new RelayCommand(OnSave, CanSave);
     ChangeStatusCommand                = new RelayCommand <StatusEnum>(OnStatusChanged);
     AccDocumentItemListViewModel       = SmObjectFactory.Container.GetInstance <AccDocumentItemListViewModel>();
     TypeDocumentsDropDownOpenedCommand = new RelayCommand(OnTypeDocumentsDropDownOpened);
 }
Example #5
0
 public AddEditDocumentNumberingViewModel(IDocumentNumberingsService documentNumberingsService, IAppContextService appContextService, IAccDocumentHeadersService accDocumentHeadersService, IAccountDocumentsService accountDocumentsService, IStylesService stylesService, ICountingWaysService countingWaysService)
 {
     _documentNumberingsService = documentNumberingsService;
     _accDocumentHeadersService = accDocumentHeadersService;
     _appContextService         = appContextService;
     _accountDocumentsService   = accountDocumentsService;
     _stylesService             = stylesService;
     _countingWaysService       = countingWaysService;
     CancelCommand = new RelayCommand(OnCancel);
     SaveCommand   = new RelayCommand(OnSave, CanSave);
     AccountDocumentsDropDownOpenedCommand = new RelayCommand(OnAccountDocumentsDropDownOpened, () => AccountDocuments != null && AccountDocuments.Any());
 }
Example #6
0
 public OpeningClosingListViewModel(IOpeningClosingsService openingClosingsService, ITLDocumentsService tLDocumentsService, IAppContextService appContextService, IAccDocumentItemsService accDocumentItemsService, ICurrencyExchangesService currencyExchangesService, IAccDocumentHeadersService accDocumentHeadersService)
 {
     _tLDocumentsService        = tLDocumentsService;
     _accDocumentItemsService   = accDocumentItemsService;
     _accDocumentHeadersService = accDocumentHeadersService;
     _currencyExchangesService  = currencyExchangesService;
     _openingClosingsService    = openingClosingsService;
     _appContextService         = appContextService;
     AddAccDocumentCommand      = new RelayCommand(OnAddAccDocument);
     DocumentDate = DateTime.Now;
     ViewSystemDocumentHeaderCommand = new RelayCommand(OnViewSystemDocumentHeader);
     _accessUtility = SmObjectFactory.Container.GetInstance <AccessUtility>();
 }
Example #7
0
 public ConvertDocumentListViewModel(IConvertDocumentsService convertDocumentsService,
                                     IOpeningClosingsService openingClosingsService, IAppContextService appContextService, ISystemAccountingSettingsService systemAccountingSettingsService, IAccDocumentHeadersService accDocumentHeadersService, ICompanyInformationsService companyInformationsService)
 {
     _companyInformationsService      = companyInformationsService;
     CompanyInformationModel          = _companyInformationsService.GetCompanyInformationModel();
     _systemAccountingSettingsService = systemAccountingSettingsService;
     AccountingSetting          = _systemAccountingSettingsService.GetSystemAccountingSettingModel();
     _accDocumentHeadersService = accDocumentHeadersService;
     _openingClosingsService    = openingClosingsService;
     _convertDocumentsService   = convertDocumentsService;
     _appContextService         = appContextService;
     PermanentConvertCommand    = new RelayCommand(OnPermanentConvertDocument);
     TemporaryConvertCommand    = new RelayCommand(OnTemporaryConvertDocument);
     _accessUtility             = SmObjectFactory.Container.GetInstance <AccessUtility>();
     // AddAccDocumentItemCommand = new RelayCommand<AccDocumentItem>(OnAddAccDocumentItem);
 }
Example #8
0
        public CurrencyExchangeListViewModel(ICurrencyExchangesService currencyExchangesService, ITLDocumentsService tLDocumentsService,
                                             IOpeningClosingsService openingClosingsService, IAccDocumentItemsService accDocumentItemsService,
                                             IAccDocumentHeadersService accDocumentHeadersService, IAppContextService appContextService, ISLsService sLsService, ICompanyInformationsService companyInformationsService)
        {
            _tLDocumentsService         = tLDocumentsService;
            _companyInformationsService = companyInformationsService;
            CompanyInformationModel     = _companyInformationsService.GetCompanyInformationModel();
            _accDocumentHeadersService  = accDocumentHeadersService;
            _openingClosingsService     = openingClosingsService;
            _currencyExchangesService   = currencyExchangesService;
            _accDocumentItemsService    = accDocumentItemsService;
            _sLsService        = sLsService;
            _appContextService = appContextService;

            AccDocumentItemListViewModel = SmObjectFactory.Container.GetInstance <AccDocumentItemListViewModel>();
            SLsDropDownOpenedCommand     = new RelayCommand(OnSLsDropDownOpened, () => SLs != null && SLs.Any());
            DLs1DropDownOpenedCommand    = new RelayCommand <string>(OnDLs1DropDownOpened);
            DLs2DropDownOpenedCommand    = new RelayCommand <string>(OnDLs2DropDownOpened);
            ViewCommand   = new RelayCommand(OnView, CanView);
            ExportCommand = new RelayCommand(OnExport, CanExport);
            ViewSystemDocumentHeaderCommand = new RelayCommand(OnViewSystemDocumentHeader);
            _accessUtility = SmObjectFactory.Container.GetInstance <AccessUtility>();
        }