예제 #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                GeraESocial eSocial = new GeraESocial();
                eSocial.gerarESocial1000("2016-01", "2016-12");
                eSocial.gerarESocial1010("2016-01", "2016-12");

                CaminhoArquivo = "C:\\T2Ti\\Arquivos\\eSocial_info_empregador.xml";

                //System.Diagnostics.Process.Start(CaminhoArquivo); - se quiser abrir no editor padrão do windows

                PreviewPrincipal janela = new PreviewPrincipal();
                PreviewPrincipal.fileName = CaminhoArquivo;
                Window window = new Window()
                {
                    Title                 = "Preview",
                    ShowInTaskbar         = false,
                    Topmost               = false,
                    ResizeMode            = ResizeMode.NoResize,
                    Width                 = 1010,
                    Height                = 740,
                    WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen
                };
                window.Content = janela;
                JanelaPreview  = window;
                window.ShowDialog();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void Button_Click_3(object sender, RoutedEventArgs e)
        {
            try
            {
                ServicoSpedClient gedService = new ServicoSpedClient();
                documentoSelected = gedService.gerarSped(
                    dpDataInicio.Text,
                    dpDataFim.Text,
                    cbVersaoLayout.SelectedIndex,
                    cbFinalidadeArquivo.SelectedIndex,
                    cbPerfilApresentacao.SelectedIndex,
                    new ERPViewModelBase().Empresa.Id,
                    cbInventario.SelectedIndex,
                    1
                    );

                CaminhoArquivo = salvaArquivoTempLocal(documentoSelected);

                //System.Diagnostics.Process.Start(CaminhoArquivo); - se quiser abrir no editor padrão do windows

                PreviewPrincipal janela = new PreviewPrincipal();
                Window           window = new Window()
                {
                    Title                 = "Preview",
                    ShowInTaskbar         = false,
                    Topmost               = false,
                    ResizeMode            = ResizeMode.NoResize,
                    Width                 = 1010,
                    Height                = 740,
                    WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen
                };
                window.Content = janela;
                JanelaPreview  = window;
                window.ShowDialog();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                ServiceServidor Service = new ServiceServidor();
                ArquivoGerado = Service.GerarSpedContabil(
                    dpDataInicio.Text,
                    dpDataFim.Text,
                    cbFormaEscrituracao.SelectedIndex.ToString(),
                    cbVersaoLayout.SelectedIndex.ToString(),
                    "1"
                    );

                CaminhoArquivo = salvaArquivoTempLocal();

                //System.Diagnostics.Process.Start(CaminhoArquivo); - se quiser abrir no editor padrão do windows

                PreviewPrincipal janela = new PreviewPrincipal();
                PreviewPrincipal.fileName = CaminhoArquivo;
                Window window = new Window()
                {
                    Title                 = "Preview",
                    ShowInTaskbar         = false,
                    Topmost               = false,
                    ResizeMode            = ResizeMode.NoResize,
                    Width                 = 1010,
                    Height                = 740,
                    WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen
                };
                window.Content = janela;
                JanelaPreview  = window;
                window.ShowDialog();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }