Пример #1
0
 public SatIntegradorMFe(SatConfig config, string pathDll, Encoding encoding)
 {
     ModeloStr = "SatIntegradorMFe";
     PathDll   = pathDll;
     Encoding  = encoding;
     Config    = config;
 }
Пример #2
0
 protected SatLibrary(SatConfig config, string pathDll, Encoding encoding)
 {
     PathDll  = pathDll;
     Encoding = encoding;
     Config   = config;
     handle   = IntPtr.Zero;
 }
Пример #3
0
        protected override void OnInitialize()
        {
            Configuracoes = new SatConfig();
            Arquivos      = new CfgArquivos();
            Encoding      = Encoding.UTF8;

            PathDll        = @"C:\SAT\SAT.dll";
            CodigoAtivacao = "123456";
            signAC         = string.Empty;
        }
Пример #4
0
        public static ISatLibrary GetLibrary(ModeloSat modelo, SatConfig config, string pathDll, Encoding encoding)
        {
            switch (modelo)
            {
            case ModeloSat.Cdecl: return(new SatCdecl(config, pathDll, encoding));

            case ModeloSat.StdCall: return(new SatStdCall(config, pathDll, encoding));

            default: throw new NotImplementedException("Modelo não impementado !");
            }
        }
Пример #5
0
        public SatIntegradorMFe(SatConfig config, string pathDll, Encoding encoding) : base(config, pathDll, encoding)
        {
            ModeloStr = "SatIntegradorMFe";

            if (!Directory.Exists(Path.Combine(Config.MFePathEnvio, "Enviados")))
            {
                Directory.CreateDirectory(Path.Combine(Config.MFePathEnvio, "Enviados"));
            }

            if (!Directory.Exists(Path.Combine(Config.MFePathResposta, "Processados")))
            {
                Directory.CreateDirectory(Path.Combine(Config.MFePathResposta, "Processados"));
            }
        }
Пример #6
0
        public SatCdecl(SatConfig config, string pathDll, Encoding encoding) : base(config, pathDll, encoding)
        {
            ModeloStr = "SatCdeclSatLibrary";

            AddMethod <Delegates.AssociarAssinatura>("AssociarAssinatura");
            AddMethod <Delegates.AtivarSAT>("AtivarSAT");
            AddMethod <Delegates.AtualizarSoftwareSAT>("AtualizarSoftwareSAT");
            AddMethod <Delegates.BloquearSAT>("BloquearSAT");
            AddMethod <Delegates.CancelarUltimaVenda>("CancelarUltimaVenda");
            AddMethod <Delegates.ComunicarCertificadoICPBRASIL>("ComunicarCertificadoICPBRASIL");
            AddMethod <Delegates.ConfigurarInterfaceDeRede>("ConfigurarInterfaceDeRede");
            AddMethod <Delegates.ConsultarNumeroSessao>("ConsultarNumeroSessao");
            AddMethod <Delegates.ConsultarSAT>("ConsultarSAT");
            AddMethod <Delegates.ConsultarStatusOperacional>("ConsultarStatusOperacional");
            AddMethod <Delegates.DesbloquearSAT>("DesbloquearSAT");
            AddMethod <Delegates.EnviarDadosVenda>("EnviarDadosVenda");
            AddMethod <Delegates.ExtrairLogs>("ExtrairLogs");
            AddMethod <Delegates.TesteFimAFim>("TesteFimAFim");
            AddMethod <Delegates.TrocarCodigoDeAtivacao>("TrocarCodigoDeAtivacao");
        }
Пример #7
0
 protected SatLibrary(SatConfig config, string pathDll, Encoding encoding) : base(pathDll)
 {
     PathDll  = pathDll;
     Encoding = encoding;
     Config   = config;
 }
Пример #8
0
 public SatStdCall(SatConfig config, string pathDll, Encoding encoding) : base(config, pathDll, encoding)
 {
     ModeloStr = "StdCallSatLibrary";
     handle    = NativeMethods.LoadLibrary(PathDll);
     Guard.Against <ACBrException>(handle == IntPtr.Zero, "Não foi possivel carregar a biblioteca Sat");
 }