Ejemplo n.º 1
0
        private void TmDownloadNFe_Tick(object sender, EventArgs e)
        {
            TmDownloadNFe.Enabled = false;

            Model_DownloadNFe    ObjDownloadNFe    = new Model_DownloadNFe();
            EnviarDownloadNFe    ObjNegDownloadNFe = new EnviarDownloadNFe();
            Entidade_DownloadNFe ObjEntDownloadNfe;

            List <string> ListChAcessoNFe = new List <string>();

            var DtDownload = ObjDownloadNFe.ConsultaNFeDownload();

            ObjEntDownloadNfe = new Entidade_DownloadNFe();

            ObjEntDownloadNfe.id_loja = 1;


            for (int i = 0; i < DtDownload.Rows.Count; i++)
            {
                ListChAcessoNFe.Add(DtDownload.Rows[i]["txchacessonfe"].ToString());
            }

            ObjEntDownloadNfe.ChaveNFe = ListChAcessoNFe;

            ObjNegDownloadNFe.Enviar(ObjEntDownloadNfe, out ObjEntDownloadNfe);

            TmDownloadNFe.Enabled = true;
        }
Ejemplo n.º 2
0
        public TDownloadNFe(Entidade_DownloadNFe ObjEntDownload)
        {
            var DtLoja = FuncoesGerais.Loja(ObjEntDownload.id_loja);

            if (FuncoesGerais.TipoAmbiente() == "HOM")
            {
                this.tpAmb = TAmb.Item2;
            }
            else
            {
                this.tpAmb = TAmb.Item1;
            }
            this.chNFe  = ObjEntDownload.ChaveNFe.ToArray();
            this.CNPJ   = DtLoja.Rows[0]["cnpj"].ToString();
            this.versao = TVerDownloadNFe.Item100;
            this.xServ  = TDownloadNFeXServ.DOWNLOADNFE;
        }