/// <summary>
 /// Initializes a new instance of the <see cref="ProviderBase"/> class.
 /// </summary>
 protected ProviderBase(ConfiguracoesNFSe config, ACBrMunicipioNFSe municipio)
 {
     Name           = "Base";
     ListaDeAlertas = new List <string>();
     FormatoAlerta  = "TAG:%TAG% ID:%ID%/%TAG%(%DESCRICAO%) - %MSG%.";
     Config         = config;
     Municipio      = municipio;
 }
Example #2
0
        /// <summary>
        /// Retorna o provedor para o municipio nas configurações informadas.
        /// </summary>
        /// <param name="config">A configuração.</param>
        /// <returns>Provedor NFSe.</returns>
        public static ProviderBase GetProvider(ConfiguracoesNFSe config)
        {
            var municipio = Municipios.SingleOrDefault(x => x.Codigo == config.WebServices.CodigoMunicipio);

            Guard.Against <ACBrException>(municipio == null, "Provedor para esta cidade não implementado ou não especificado!");

            // ReSharper disable once PossibleNullReferenceException
            var providerType = Providers[municipio.Provedor.ToUpper()];

            Guard.Against <ACBrException>(providerType == null, "Provedor não encontrado!");
            Guard.Against <ACBrException>(!CheckBaseType(providerType), "Classe base do provedor incorreta!");

            // ReSharper disable once AssignNullToNotNullAttribute
            return((ProviderBase)Activator.CreateInstance(providerType, config, municipio));
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NotaFiscal"/> class.
        /// </summary>
        public NotaFiscal(ConfiguracoesNFSe config, bool prestadorPadrão = true)
        {
            Guard.Against <ACBrException>(config == null, "Configurações não podem ser nulas");

            this.config = config;

            Id = 0;
            IdentificacaoRps  = new IdeRps();
            IdentificacaoNFSe = new IdeNFSe();
            RpsSubstituido    = new IdeRpsSubtituida();
            Servico           = new DadosServico();
            Prestador         = prestadorPadrão ? config.PrestadorPadrao : new DadosPrestador();
            Tomador           = new DadosTomador();
            Intermediario     = new DadosIntermediario();
            ConstrucaoCivil   = new DadosConstrucaoCivil();
            Pagamento         = new DadosPagamento();
            OrgaoGerador      = new IdeOrgaoGerador();
            Signature         = new DFeSignature();
            Cancelamento      = new IdeCancelamento();
            Transportadora    = new DadosTransportadora();
            Emails            = new EmailCollection();
        }
 public ProviderSaoPaulo(ConfiguracoesNFSe config, ACBrMunicipioNFSe municipio) : base(config, municipio)
 {
     Name = "São Paulo";
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ProviderABRASFV2"/> class.
 /// </summary>
 /// <param name="config">The configuration.</param>
 /// <param name="municipio">The municipio.</param>
 protected ProviderABRASFV2(ConfiguracoesNFSe config, MunicipioNFSe municipio) : base(config, municipio)
 {
     Name = "ABRASFv2";
 }
 public ProviderAbaco(ConfiguracoesNFSe config, ACBrMunicipioNFSe municipio) : base(config, municipio)
 {
     Name = "Abaco";
 }
        /// <summary>
        /// Inicializa uma nova instacia da classe <see cref="NotaFiscalCollection" />.
        /// </summary>
        /// <param name="config">The configuration.</param>
        public NotaFiscalCollection(ConfiguracoesNFSe config)
        {
            Guard.Against <ACBrException>(config == null, "Configurações não podem ser nulas");

            this.config = config;
        }
Example #8
0
 public ProviderWebISS(ConfiguracoesNFSe config, MunicipioNFSe municipio) : base(config, municipio)
 {
     Name = "WebISS";
 }
Example #9
0
 public ProviderWebIss2(ConfiguracoesNFSe config, ACBrMunicipioNFSe municipio) : base(config, municipio)
 {
     Name = "WebISS2";
 }
Example #10
0
 /// <summary>
 /// Função executada na inicialização do componente
 /// </summary>
 protected override void OnInitialize()
 {
     Configuracoes = new ConfiguracoesNFSe();
     NotasFiscais  = new NotaFiscalCollection(Configuracoes);
 }
Example #11
0
 public ProviderBetha2(ConfiguracoesNFSe config, ACBrMunicipioNFSe municipio) : base(config, municipio)
 {
     Name = "Betha";
 }
Example #12
0
 public ProviderNotaCarioca(ConfiguracoesNFSe config, ACBrMunicipioNFSe municipio) : base(config, municipio)
 {
     Name = "Nota Carioca";
 }
Example #13
0
 public ProviderPortoAlegre(ConfiguracoesNFSe config, MunicipioNFSe municipio) : base(config, municipio)
 {
     Name = "Porto Alegre";
 }