コード例 #1
0
        private void StatusValidate()
        {
            SatModelEnum modeloSat =
                (SatModelEnum)Enum.Parse(typeof(SatModelEnum), InstanceManager.Parametros.ModeloSat);
            var sat =
                new Syslaps.Pdv.Core.Dominio.SAT.Sat(
                    SatBase.Create(InstanceManager.Parametros.CodigoSat, modeloSat), new RepositorioBase(), InstanceManager.Parametros);

            var response  = sat.VerificarStatus();
            var response2 = sat.VerificarDisponibilidade();

            TxtResutadoStatus.Text = $@"Status: {response.ErrorMessage}
SAT Number: {InstanceManager.Parametros.NumeroSat}
Serial Number: {response.SerialNumber}
Software Version: {response.SoftwareVersion}
Certificate ExpirationDate: {response.CertificateExpirationDate}
Date: {response.DateTime}
LanStatus: {response.LanStatus}
LastCfeSent: {response.LastCfeSent}
LastComunicationDate: {response.LastComunicationDate}
LastTransmissionDate: {response.LastTransmissionDate}
Memory: {response.MemoryUsed} de {response.MemoryTotal}
LayoutVersion: {response.LayoutVersion}
Diponibilidade: {response2.RawResponse}
";
        }
コード例 #2
0
        private void BtnSendXml_Click(object sender, RoutedEventArgs e)
        {
            this.StartWait("Aguarde. Comunicando com SAT...");
            var tsat = Task.Run(() =>
            {
                try
                {
                    var cupomXml = LerArqTxt(PegarPathArq());
                    if (!cupomXml.IsNullOrEmpty())
                    {
                        SatModelEnum modeloSat =
                            (SatModelEnum)Enum.Parse(typeof(SatModelEnum), InstanceManager.Parametros.ModeloSat);
                        var sat =
                            new Syslaps.Pdv.Core.Dominio.SAT.Sat(
                                SatBase.Create(InstanceManager.Parametros.CodigoSat, modeloSat), new RepositorioBase(), InstanceManager.Parametros);

                        var retSat = sat.EnviarVenda(cupomXml);
                        MessageBox.Show(retSat.RawResponse);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(string.Concat("Falha ao se comunicar com SAT.\nMensagem: ", ex.Message), InstanceManager.Parametros.TituloDasMensagens, MessageBoxButton.OK, MessageBoxImage.Error);
                }
            });

            tsat.Wait(10000);
            this.StopWait();
        }
コード例 #3
0
        public void RegistrarCupomFiscalSat()
        {
            SatModelEnum modeloSat =
                (SatModelEnum)Enum.Parse(typeof(SatModelEnum), InstanceManager.Parametros.ModeloSat);
            var sat =
                new Core.Dominio.SAT.Sat(
                    SatBase.Create(InstanceManager.Parametros.CodigoSat, modeloSat), _repositorioBase, InstanceManager.Parametros, VendaCorrente.VendaCorrente);

            sat.RegistrarVendaSat();
        }