public NotaFiscalMainViewModel(IEnviarNota enviarNotaController, OpcoesViewModel opcoesVm,
                                       CancelarNotaViewModel notaCanceladaVm, IEnviaNotaFiscalService enviaNotaFiscalService,
                                       IConfiguracaoService configuracaoService, ICertificadoService certificadoService,
                                       IProdutoService produtoService, IConsultaStatusServicoService consultaStatusServicoService,
                                       IEmissorService emissorService,
                                       VisualizarNotaEnviadaViewModel visualizarNotaEnviadaViewModel,
                                       EnviarEmailViewModel enviarEmailViewModel,
                                       INotaFiscalRepository notaFiscalRepository, ModoOnlineService modoOnlineService, INFeConsulta nfeConsulta)
        {
            LoadedCmd              = new RelayCommand(LoadedCmd_Execute, null);
            AbrirNFCeCmd           = new RelayCommand(AbrirNFCeCmd_Execute, null);
            AbrirNFeCmd            = new RelayCommand(AbrirNFeCmd_Execute, null);
            VisualizarNotaCmd      = new RelayCommand <NotaFiscalMemento>(VisualizarNotaCmd_Execute, null);
            EnviarNotaNovamenteCmd = new RelayCommand <NotaFiscalMemento>(EnviarNotaNovamenteCmd_ExecuteAsync, null);
            EnviarEmailCmd         = new RelayCommand <NotaFiscalMemento>(EnviarEmailCmd_Execute, null);
            MudarPaginaCmd         = new RelayCommand <int>(MudarPaginaCmd_Execute, null);

            _enviaNotaFiscalService         = enviaNotaFiscalService;
            _notaFiscalRepository           = notaFiscalRepository;
            _configuracaoService            = configuracaoService;
            _certificadoService             = certificadoService;
            _produtoService                 = produtoService;
            _consultaStatusServicoService   = consultaStatusServicoService;
            _emissorService                 = emissorService;
            _visualizarNotaEnviadaViewModel = visualizarNotaEnviadaViewModel;
            _enviarEmailViewModel           = enviarEmailViewModel;
            _nfeConsulta = nfeConsulta;

            NotasFiscais = new ObservableCollection <NotaFiscalMemento>();

            enviarNotaController.NotaEnviadaEvent += EnviarNotaController_NotaEnviadaEventHandler;

            opcoesVm.ConfiguracaoAlteradaEvent   += OpcoesVM_ConfiguracaoAlteradaEventHandler;
            notaCanceladaVm.NotaCanceladaEvent   += NotaFiscalVM_NotaCanceladaEventHandler;
            notaCanceladaVm.NotaInutilizadaEvent += NotaCanceladaVM_NotaInutilizadaEventHandler;

            modoOnlineService.NotasTransmitidasEvent += ModoOnlineService_NotasTransmitidasEventHandler;
        }
Пример #2
0
        public AcompanhamentoNotasViewModel(IEnviarNota enviarNotaController, IEnviaNotaFiscalService enviaNotaFiscalService, CancelarNotaViewModel cancelarNotaViewModel, OpcoesViewModel opcoesViewModel, NotaFiscalMainViewModel notaFiscalMainViewModel, INotaFiscalRepository notaFiscalRepository)
        {
            LoadedCmd  = new RelayCommand(LoadedCmd_Execute, null);
            FiltrarCmd = new RelayCommand(FiltrarCmd_Execute, null);

            enviarNotaController.NotaEnviadaEvent     += NotaFiscalVM_NotaEnviadaEvent;
            cancelarNotaViewModel.NotaCanceladaEvent  += CancelarNotaFiscalVM_NotaCanceladaEvent;
            opcoesViewModel.ConfiguracaoAlteradaEvent += OpcoesVM_ConfiguracoesAlteradasEvent;

            _notaFiscalRepository = notaFiscalRepository;

            notaFiscalMainViewModel.NotaPendenteReenviadaEvent += NotaFiscalVM_NotaEnviadaEvent;

            _enviaNotaFiscalService = enviaNotaFiscalService;
        }