Пример #1
0
        private void PAF_Preenche_N()
        {
            int i;

            var registroN1Rec = new ACBrPAFInterop.RegistroHD1Rec();
            var registroN2Rec = new ACBrPAFInterop.RegistroN2Rec();
            var registroN3Rec = new ACBrPAFInterop.RegistroN3Rec[PafN.RegistroN3.Count];

            registroN1Rec.RAZAOSOCIAL = ToUTF8(PafN.RegistroN1.RazaoSocial);
            registroN1Rec.CNPJ        = ToUTF8(PafN.RegistroN1.CNPJ);
            registroN1Rec.UF          = ToUTF8(PafN.RegistroN1.UF);
            registroN1Rec.IE          = ToUTF8(PafN.RegistroN1.IE);
            registroN1Rec.IM          = ToUTF8(PafN.RegistroN1.IM);

            registroN2Rec.NOME   = ToUTF8(PafN.RegistroN2.NOME);
            registroN2Rec.LAUDO  = ToUTF8(PafN.RegistroN2.LAUDO);
            registroN2Rec.VERSAO = ToUTF8(PafN.RegistroN2.VERSAO);

            for (i = 0; i < PafN.RegistroN3.Count; i++)
            {
                registroN3Rec[i].NOME_ARQUIVO = ToUTF8(PafN.RegistroN3[i].NOME_ARQUIVO);
                registroN3Rec[i].MD5          = ToUTF8(PafN.RegistroN3[i].MD5);
            }

            var ret = ACBrPAFInterop.PAF_Preenche_N(Handle, registroN1Rec, registroN2Rec, registroN3Rec, PafN.RegistroN3.Count);

            CheckResult(ret);
        }
Пример #2
0
        private void PAF_Preenche_P()
        {
            var registroP1Rec = new ACBrPAFInterop.RegistroHD1Rec
            {
                CNPJ        = PafP.RegistroP1.CNPJ,
                IE          = PafP.RegistroP1.IE,
                IM          = PafP.RegistroP1.IM,
                RAZAOSOCIAL = PafP.RegistroP1.RazaoSocial,
                UF          = PafP.RegistroP1.UF
            };

            var registrosP2Rec = (from x in PafP.RegistroP2
                                  select new ACBrPAFInterop.RegistroP2Rec
            {
                ALIQ = (double)x.ALIQ,
                COD_MERC_SERV = x.COD_MERC_SERV,
                DESC_MERC_SERV = x.DESC_MERC_SERV,
                IAT = x.IAT,
                IPPT = x.IPPT,
                RegistroValido = x.RegistroValido,
                ST = x.ST,
                UN_MED = x.UN_MED,
                VL_UNIT = (double)x.VL_UNIT
            }).ToArray();

            var ret = ACBrPAFInterop.PAF_Preenche_P(Handle, registroP1Rec, registrosP2Rec, registrosP2Rec.Count());

            CheckResult(ret);
        }
Пример #3
0
        private void PAF_Preenche_T()
        {
            int i;
            var registroT1Rec = new ACBrPAFInterop.RegistroHD1Rec();
            var registroT2Rec = new ACBrPAFInterop.RegistroT2Rec[PafT.RegistroT2.Count];

            registroT1Rec.RAZAOSOCIAL = ToUTF8(PafT.RegistroT1.RazaoSocial);
            registroT1Rec.CNPJ        = ToUTF8(PafT.RegistroT1.CNPJ);
            registroT1Rec.UF          = ToUTF8(PafT.RegistroT1.UF);
            registroT1Rec.IE          = ToUTF8(PafT.RegistroT1.IE);
            registroT1Rec.IM          = ToUTF8(PafT.RegistroT1.IM);

            for (i = 0; i < PafT.RegistroT2.Count; i++)
            {
                registroT2Rec[i].DT_MOV         = PafT.RegistroT2[i].DT_MOV.ToOADate();
                registroT2Rec[i].TP_DOCTO       = ToUTF8(PafT.RegistroT2[i].TP_DOCTO);
                registroT2Rec[i].SERIE          = ToUTF8(PafT.RegistroT2[i].SERIE);
                registroT2Rec[i].NUM_BILH_I     = PafT.RegistroT2[i].NUM_BILH_I;
                registroT2Rec[i].NUM_BILH_F     = PafT.RegistroT2[i].NUM_BILH_F;
                registroT2Rec[i].NUM_ECF        = ToUTF8(PafT.RegistroT2[i].NUM_ECF);
                registroT2Rec[i].CRZ            = PafT.RegistroT2[i].CRZ;
                registroT2Rec[i].CFOP           = ToUTF8(PafT.RegistroT2[i].CFOP);
                registroT2Rec[i].VL_CONT        = PafT.RegistroT2[i].VL_CONT;
                registroT2Rec[i].VL_BASECALC    = PafT.RegistroT2[i].VL_BASECALC;
                registroT2Rec[i].ALIQ           = PafT.RegistroT2[i].ALIQ;
                registroT2Rec[i].VL_IMPOSTO     = PafT.RegistroT2[i].VL_IMPOSTO;
                registroT2Rec[i].VL_ISENTAS     = PafT.RegistroT2[i].VL_ISENTAS;
                registroT2Rec[i].VL_OUTRAS      = PafT.RegistroT2[i].VL_OUTRAS;
                registroT2Rec[i].RegistroValido = PafT.RegistroT2[i].RegistroValido;
            }

            var ret = ACBrPAFInterop.PAF_Preenche_T(Handle, registroT1Rec, registroT2Rec, PafT.RegistroT2.Count);

            CheckResult(ret);
        }
Пример #4
0
        private void PAF_Preenche_B()
        {
            #region B1
            var registroB1Rec = new ACBrPAFInterop.RegistroHD1Rec
            {
                RAZAOSOCIAL = ToUTF8(PafB.RegistroB1.RazaoSocial),
                CNPJ        = ToUTF8(PafB.RegistroB1.CNPJ),
                UF          = ToUTF8(PafB.RegistroB1.UF),
                IE          = ToUTF8(PafB.RegistroB1.IE),
                IM          = ToUTF8(PafB.RegistroB1.IM)
            };
            #endregion

            #region B2
            var registrosB2Rec = (from x in PafB.RegistroB2
                                  select new ACBrPAFInterop.RegistroB2Rec
            {
                BOMBA = ToUTF8(x.BOMBA),
                BICO = ToUTF8(x.BICO),
                DATA = x.DATA.ToOADate(),
                HORA = x.HORA.ToOADate(),
                MOTIVO = ToUTF8(x.MOTIVO),
                CNPJ_EMPRESA = ToUTF8(x.CNPJ_EMPRESA),
                CPF_TECNICO = ToUTF8(x.CPF_TECNICO),
                NRO_LACRE_ANTES = ToUTF8(x.NRO_LACRE_ANTES),
                NRO_LACRE_APOS = ToUTF8(x.NRO_LACRE_ANTES),
                ENCERRANTE_ANTES = Convert.ToDouble(x.ENCERRANTE_ANTES),
                ENCERRANTE_APOS = Convert.ToDouble(x.ENCERRANTE_APOS),
                RegistroValido = x.RegistroValido
            }).ToArray();
            #endregion

            var ret = ACBrPAFInterop.PAF_Preenche_B(Handle, registroB1Rec, registrosB2Rec, PafB.RegistroB2.Count);
            CheckResult(ret);
        }
Пример #5
0
        private void PAF_Preenche_U()
        {
            var registroU1Rec = new ACBrPAFInterop.RegistroHD1Rec
            {
                CNPJ             = PafU.RegistroU1.CNPJ,
                IE               = PafU.RegistroU1.IE,
                IM               = PafU.RegistroU1.IM,
                RAZAOSOCIAL      = PafU.RegistroU1.RazaoSocial,
                InclusaoExclusao = PafU.RegistroU1.InclusaoExclusao
            };

            var ret = ACBrPAFInterop.PAF_Preenche_U(Handle, registroU1Rec);

            CheckResult(ret);
        }
Пример #6
0
        private void PAF_Preenche_C()
        {
            #region C1
            var registroC1Rec = new ACBrPAFInterop.RegistroHD1Rec
            {
                RAZAOSOCIAL = ToUTF8(PafC.RegistroC1.RazaoSocial),
                CNPJ        = ToUTF8(PafC.RegistroC1.CNPJ),
                UF          = ToUTF8(PafC.RegistroC1.UF),
                IE          = ToUTF8(PafC.RegistroC1.IE),
                IM          = ToUTF8(PafC.RegistroC1.IM)
            };
            #endregion

            #region C2
            var registrosC2Rec = (from x in PafC.RegistroC2
                                  select new ACBrPAFInterop.RegistroC2Rec
            {
                ID_ABASTECIMENTO = ToUTF8(x.ID_ABASTECIMENTO),
                TANQUE = ToUTF8(x.TANQUE),
                BOMBA = ToUTF8(x.BOMBA),
                COMBUSTIVEL = ToUTF8(x.COMBUSTIVEL),
                DATA_ABASTECIMENTO = x.DATA_ABASTECIMENTO.ToOADate(),
                HORA_ABASTECIMENTO = x.HORA_ABASTECIMENTO.ToOADate(),
                ENCERRANTE_INICIAL = Convert.ToDouble(x.ENCERRANTE_INICIAL),
                ENCERRANTE_FINAL = Convert.ToDouble(x.ENCERRANTE_FINAL),
                STATUS_ABASTECIMENTO = ToUTF8(x.STATUS_ABASTECIMENTO),
                NRO_SERIE_ECF = ToUTF8(x.NRO_SERIE_ECF),
                DATA = x.DATA.ToOADate(),
                HORA = x.HORA.ToOADate(),
                COO = x.COO,
                NRO_NOTA_FISCAL = x.NRO_NOTA_FISCAL,
                VOLUME = Convert.ToDouble(x.VOLUME),
                RegistroValido = x.RegistroValido
            }).ToArray();

            #endregion

            var ret = ACBrPAFInterop.PAF_Preenche_C(Handle, registroC1Rec, registrosC2Rec, PafC.RegistroC2.Count);
            CheckResult(ret);
        }
Пример #7
0
        private void PAF_Preenche_D()
        {
            #region D1

            var registroD1Rec = new ACBrPAFInterop.RegistroHD1Rec()
            {
                RAZAOSOCIAL = ToUTF8(PafD.RegistroD1.RazaoSocial),
                CNPJ        = ToUTF8(PafD.RegistroD1.CNPJ),
                UF          = ToUTF8(PafD.RegistroD1.UF),
                IE          = ToUTF8(PafD.RegistroD1.IE),
                IM          = ToUTF8(PafD.RegistroD1.IM)
            };

            #endregion D1

            #region D2

            var registrosD2Rec = (from x in PafD.RegistroD2
                                  select new ACBrPAFInterop.RegistroD2Rec
            {
                QTD_D3 = x.RegistroD3.Count,
                QTD_D4 = x.RegistroD4.Count,
                NUM_FAB = ToUTF8(x.NUM_FAB),
                MF_ADICIONAL = ToUTF8(x.MF_ADICIONAL),
                TIPO_ECF = ToUTF8(x.TIPO_ECF),
                MARCA_ECF = ToUTF8(x.MARCA_ECF),
                MODELO_ECF = ToUTF8(x.MODELO_ECF),
                COO = ToUTF8(x.COO),
                NUM_DAV = ToUTF8(x.NUM_DAV),
                DT_DAV = x.DT_DAV.ToOADate(),
                TIT_DAV = ToUTF8(x.TIT_DAV),
                VLT_DAV = Convert.ToDouble(x.VLT_DAV),
                COO_DFV = ToUTF8(x.COO_DFV),
                NUMERO_ECF = ToUTF8(x.NUMERO_ECF),
                NOME_CLIENTE = ToUTF8(x.NOME_CLIENTE),
                CPF_CNPJ = ToUTF8(x.CPF_CNPJ),
                RegistroValido = x.RegistroValido
            }).ToArray();

            #endregion

            #region D3

            var d3Count        = PafD.RegistroD2.Sum(x => x.RegistroD3.Count);
            var registrosD3Rec = new ACBrPAFInterop.RegistroD3Rec[0];
            if (d3Count > 0)
            {
                registrosD3Rec = (((from x in PafD.RegistroD2
                                    where x.RegistroD3.Any()
                                    select x.RegistroD3.AsEnumerable())
                                   .Aggregate((pafRegistroD3S, registroD3S) =>
                {
                    if (pafRegistroD3S != null && registroD3S != null)
                    {
                        return(pafRegistroD3S.Concat(registroD3S));
                    }

                    return(new List <ACBrPAFRegistroD3>().AsEnumerable());
                })).Select(s => new ACBrPAFInterop.RegistroD3Rec
                {
                    DT_INCLUSAO = s.DT_INCLUSAO.ToOADate(),
                    NUM_ITEM = s.NUM_ITEM,
                    COD_ITEM = ToUTF8(s.COD_ITEM),
                    DESC_ITEM = ToUTF8(s.DESC_ITEM),
                    QTDE_ITEM = Convert.ToDouble(s.QTDE_ITEM),
                    UNI_ITEM = ToUTF8(s.UNI_ITEM),
                    VL_UNIT = Convert.ToDouble(s.VL_UNIT),
                    VL_DESCTO = Convert.ToDouble(s.VL_DESCTO),
                    VL_ACRES = Convert.ToDouble(s.VL_ACRES),
                    VL_TOTAL = Convert.ToDouble(s.VL_TOTAL),
                    DEC_VL_UNIT = s.DEC_VL_UNIT,
                    DEC_QTDE_ITEM = s.DEC_QTDE_ITEM,
                    SIT_TRIB = ToUTF8(s.SIT_TRIB),
                    ALIQ = Convert.ToDouble(s.ALIQ),
                    IND_CANC = ToUTF8(s.IND_CANC),
                    RegistroValido = s.RegistroValido
                })).ToArray();
            }

            #endregion D3

            #region D4

            var d4Count        = PafD.RegistroD2.Sum(x => x.RegistroD4.Count);
            var registrosD4Rec = new ACBrPAFInterop.RegistroD4Rec[0];
            if (d4Count > 0)
            {
                registrosD4Rec = (from s in
                                  ((from x in PafD.RegistroD2 where x.RegistroD4.Any() select x.RegistroD4.AsEnumerable())
                                   .Where(i => i.Any()).Aggregate((i, j) => i.Concat(j)))
                                  select new ACBrPAFInterop.RegistroD4Rec
                {
                    NumeroDAV = s.NumeroDAV,
                    DataAlteracao = s.DataAlteracao.ToOADate(),
                    CodigoProdutoServico = s.CodigoProdutoServico,
                    Descricao = s.Descricao,
                    Quantidade = (double)s.Quantidade,
                    Unidade = s.Unidade,
                    ValorUnitario = (double)s.ValorUnitario,
                    DescontoSobreItem = (double)s.DescontoSobreItem,
                    AcrescimoSobreItem = (double)s.AcrescimoSobreItem,
                    ValorTotalLiquido = (double)s.ValorTotalLiquido,
                    SituacaoTributaria = s.SituacaoTributaria,
                    Aliquota = (double)s.Aliquota,
                    IndicadorCancelamento = s.IndicadorCancelamento,
                    CasasDecimaisQtd = s.CasasDecimaisQtd,
                    CasasDecimaisVlUn = s.CasasDecimaisVlUn,
                    TipoAlteracao = s.TipoAlteracao
                }).ToArray();
            }

            #endregion D4

            var ret = ACBrPAFInterop.PAF_Preenche_D(Handle, registroD1Rec, registrosD2Rec, PafD.RegistroD2.Count,
                                                    registrosD3Rec, registrosD4Rec, registrosD4Rec.Count());
            CheckResult(ret);
        }
Пример #8
0
        private void PAF_Preenche_P()
        {
            var registroP1Rec = new ACBrPAFInterop.RegistroHD1Rec
            {
                CNPJ = PafP.RegistroP1.CNPJ,
                IE = PafP.RegistroP1.IE,
                IM = PafP.RegistroP1.IM,
                RAZAOSOCIAL = PafP.RegistroP1.RazaoSocial,
                UF = PafP.RegistroP1.UF
            };

            var registrosP2Rec = (from x in PafP.RegistroP2
                                                             select new ACBrPAFInterop.RegistroP2Rec
                                                             {
                                                                 ALIQ = (double)x.ALIQ,
                                                                 COD_MERC_SERV = x.COD_MERC_SERV,
                                                                 DESC_MERC_SERV = x.DESC_MERC_SERV,
                                                                 IAT = x.IAT,
                                                                 IPPT = x.IPPT,
                                                                 RegistroValido = x.RegistroValido,
                                                                 ST = x.ST,
                                                                 UN_MED = x.UN_MED,
                                                                 VL_UNIT = (double)x.VL_UNIT
                                                             }).ToArray();

            var ret = ACBrPAFInterop.PAF_Preenche_P(Handle, registroP1Rec, registrosP2Rec, registrosP2Rec.Count());
            CheckResult(ret);
        }
Пример #9
0
	    private void PAF_Preenche_D()
	    {
	        #region D1

	        var registroD1Rec = new ACBrPAFInterop.RegistroHD1Rec()
	        {
	            RAZAOSOCIAL = ToUTF8(PafD.RegistroD1.RazaoSocial),
	            CNPJ = ToUTF8(PafD.RegistroD1.CNPJ),
	            UF = ToUTF8(PafD.RegistroD1.UF),
	            IE = ToUTF8(PafD.RegistroD1.IE),
	            IM = ToUTF8(PafD.RegistroD1.IM)
	        };

	        #endregion D1

	        #region D2

	        var registrosD2Rec = (from x in PafD.RegistroD2
	            select new ACBrPAFInterop.RegistroD2Rec
	            {
	                QTD_D3 = x.RegistroD3.Count,
	                QTD_D4 = x.RegistroD4.Count,
	                NUM_FAB = ToUTF8(x.NUM_FAB),
	                MF_ADICIONAL = ToUTF8(x.MF_ADICIONAL),
	                TIPO_ECF = ToUTF8(x.TIPO_ECF),
	                MARCA_ECF = ToUTF8(x.MARCA_ECF),
	                MODELO_ECF = ToUTF8(x.MODELO_ECF),
	                COO = ToUTF8(x.COO),
	                NUM_DAV = ToUTF8(x.NUM_DAV),
	                DT_DAV = x.DT_DAV.ToOADate(),
	                TIT_DAV = ToUTF8(x.TIT_DAV),
	                VLT_DAV = Convert.ToDouble(x.VLT_DAV),
	                COO_DFV = ToUTF8(x.COO_DFV),
	                NUMERO_ECF = ToUTF8(x.NUMERO_ECF),
	                NOME_CLIENTE = ToUTF8(x.NOME_CLIENTE),
	                CPF_CNPJ = ToUTF8(x.CPF_CNPJ),
	                RegistroValido = x.RegistroValido
	            }).ToArray();

	        #endregion

	        #region D3

	        var d3Count = PafD.RegistroD2.Sum(x => x.RegistroD3.Count);
	        var registrosD3Rec = new ACBrPAFInterop.RegistroD3Rec[0];
	        if (d3Count > 0)
	        {
	            registrosD3Rec = (((from x in PafD.RegistroD2
	                where x.RegistroD3.Any()
	                select x.RegistroD3.AsEnumerable())
	                .Aggregate((pafRegistroD3S, registroD3S) =>
	                {
	                    if (pafRegistroD3S != null && registroD3S != null)
	                        return pafRegistroD3S.Concat(registroD3S);

	                    return new List<ACBrPAFRegistroD3>().AsEnumerable();
	                })).Select(s => new ACBrPAFInterop.RegistroD3Rec
	                {
	                    DT_INCLUSAO = s.DT_INCLUSAO.ToOADate(),
	                    NUM_ITEM = s.NUM_ITEM,
	                    COD_ITEM = ToUTF8(s.COD_ITEM),
	                    DESC_ITEM = ToUTF8(s.DESC_ITEM),
	                    QTDE_ITEM = Convert.ToDouble(s.QTDE_ITEM),
	                    UNI_ITEM = ToUTF8(s.UNI_ITEM),
	                    VL_UNIT = Convert.ToDouble(s.VL_UNIT),
	                    VL_DESCTO = Convert.ToDouble(s.VL_DESCTO),
	                    VL_ACRES = Convert.ToDouble(s.VL_ACRES),
	                    VL_TOTAL = Convert.ToDouble(s.VL_TOTAL),
	                    DEC_VL_UNIT = s.DEC_VL_UNIT,
	                    DEC_QTDE_ITEM = s.DEC_QTDE_ITEM,
	                    SIT_TRIB = ToUTF8(s.SIT_TRIB),
	                    ALIQ = Convert.ToDouble(s.ALIQ),
	                    IND_CANC = ToUTF8(s.IND_CANC),
	                    RegistroValido = s.RegistroValido
	                })).ToArray();
	        }

	        #endregion D3

	        #region D4

	        var d4Count = PafD.RegistroD2.Sum(x => x.RegistroD4.Count);
	        var registrosD4Rec = new ACBrPAFInterop.RegistroD4Rec[0];
	        if (d4Count > 0)
	        {
	            registrosD4Rec = (from s in
	                ((from x in PafD.RegistroD2 where x.RegistroD4.Any() select x.RegistroD4.AsEnumerable())
	                    .Where(i => i.Any()).Aggregate((i, j) => i.Concat(j)))
	                select new ACBrPAFInterop.RegistroD4Rec
	                {
	                    NumeroDAV = s.NumeroDAV,
	                    DataAlteracao = s.DataAlteracao.ToOADate(),
	                    CodigoProdutoServico = s.CodigoProdutoServico,
	                    Descricao = s.Descricao,
	                    Quantidade = (double) s.Quantidade,
	                    Unidade = s.Unidade,
	                    ValorUnitario = (double) s.ValorUnitario,
	                    DescontoSobreItem = (double) s.DescontoSobreItem,
	                    AcrescimoSobreItem = (double) s.AcrescimoSobreItem,
	                    ValorTotalLiquido = (double) s.ValorTotalLiquido,
	                    SituacaoTributaria = s.SituacaoTributaria,
	                    Aliquota = (double) s.Aliquota,
	                    IndicadorCancelamento = s.IndicadorCancelamento,
	                    CasasDecimaisQtd = s.CasasDecimaisQtd,
	                    CasasDecimaisVlUn = s.CasasDecimaisVlUn,
	                    TipoAlteracao = s.TipoAlteracao
	                }).ToArray();
	        }

	        #endregion D4			

	        var ret = ACBrPAFInterop.PAF_Preenche_D(Handle, registroD1Rec, registrosD2Rec, PafD.RegistroD2.Count,
	            registrosD3Rec, registrosD4Rec, registrosD4Rec.Count());
	        CheckResult(ret);
	    }
Пример #10
0
        private void PAF_Preenche_N()
        {
            int i;

            var registroN1Rec = new ACBrPAFInterop.RegistroHD1Rec();
            var registroN2Rec = new ACBrPAFInterop.RegistroN2Rec();
            var registroN3Rec = new ACBrPAFInterop.RegistroN3Rec[PafN.RegistroN3.Count];

            registroN1Rec.RAZAOSOCIAL = ToUTF8(PafN.RegistroN1.RazaoSocial);
            registroN1Rec.CNPJ = ToUTF8(PafN.RegistroN1.CNPJ);
            registroN1Rec.UF = ToUTF8(PafN.RegistroN1.UF);
            registroN1Rec.IE = ToUTF8(PafN.RegistroN1.IE);
            registroN1Rec.IM = ToUTF8(PafN.RegistroN1.IM);

            registroN2Rec.NOME = ToUTF8(PafN.RegistroN2.NOME);
            registroN2Rec.LAUDO = ToUTF8(PafN.RegistroN2.LAUDO);
            registroN2Rec.VERSAO = ToUTF8(PafN.RegistroN2.VERSAO);

            for (i = 0; i < PafN.RegistroN3.Count; i++)
            {
                registroN3Rec[i].NOME_ARQUIVO = ToUTF8(PafN.RegistroN3[i].NOME_ARQUIVO);
                registroN3Rec[i].MD5 = ToUTF8(PafN.RegistroN3[i].MD5);
            }

            var ret = ACBrPAFInterop.PAF_Preenche_N(Handle, registroN1Rec, registroN2Rec, registroN3Rec, PafN.RegistroN3.Count);
            CheckResult(ret);
        }
Пример #11
0
        private void PAF_Preenche_U()
        {
            var registroU1Rec = new ACBrPAFInterop.RegistroHD1Rec
            {
                CNPJ = PafU.RegistroU1.CNPJ,
                IE = PafU.RegistroU1.IE,
                IM = PafU.RegistroU1.IM,
                RAZAOSOCIAL = PafU.RegistroU1.RazaoSocial,
				InclusaoExclusao = PafU.RegistroU1.InclusaoExclusao
            };

            var ret = ACBrPAFInterop.PAF_Preenche_U(Handle, registroU1Rec);
            CheckResult(ret);
        }
Пример #12
0
        private void PAF_Preenche_T()
        {
            int i;
            var registroT1Rec = new ACBrPAFInterop.RegistroHD1Rec();
            var registroT2Rec = new ACBrPAFInterop.RegistroT2Rec[PafT.RegistroT2.Count];

            registroT1Rec.RAZAOSOCIAL = ToUTF8(PafT.RegistroT1.RazaoSocial);
            registroT1Rec.CNPJ = ToUTF8(PafT.RegistroT1.CNPJ);
            registroT1Rec.UF = ToUTF8(PafT.RegistroT1.UF);
            registroT1Rec.IE = ToUTF8(PafT.RegistroT1.IE);
            registroT1Rec.IM = ToUTF8(PafT.RegistroT1.IM);

            for (i = 0; i < PafT.RegistroT2.Count; i++)
            {
                registroT2Rec[i].DT_MOV = PafT.RegistroT2[i].DT_MOV.ToOADate();
                registroT2Rec[i].TP_DOCTO = ToUTF8(PafT.RegistroT2[i].TP_DOCTO);
                registroT2Rec[i].SERIE = ToUTF8(PafT.RegistroT2[i].SERIE);
                registroT2Rec[i].NUM_BILH_I = PafT.RegistroT2[i].NUM_BILH_I;
                registroT2Rec[i].NUM_BILH_F = PafT.RegistroT2[i].NUM_BILH_F;
                registroT2Rec[i].NUM_ECF = ToUTF8(PafT.RegistroT2[i].NUM_ECF);
                registroT2Rec[i].CRZ = PafT.RegistroT2[i].CRZ;
                registroT2Rec[i].CFOP = ToUTF8(PafT.RegistroT2[i].CFOP);
                registroT2Rec[i].VL_CONT = PafT.RegistroT2[i].VL_CONT;
                registroT2Rec[i].VL_BASECALC = PafT.RegistroT2[i].VL_BASECALC;
                registroT2Rec[i].ALIQ = PafT.RegistroT2[i].ALIQ;
                registroT2Rec[i].VL_IMPOSTO = PafT.RegistroT2[i].VL_IMPOSTO;
                registroT2Rec[i].VL_ISENTAS = PafT.RegistroT2[i].VL_ISENTAS;
                registroT2Rec[i].VL_OUTRAS = PafT.RegistroT2[i].VL_OUTRAS;
                registroT2Rec[i].RegistroValido = PafT.RegistroT2[i].RegistroValido;
            }

            var ret = ACBrPAFInterop.PAF_Preenche_T(Handle, registroT1Rec, registroT2Rec, PafT.RegistroT2.Count);
            CheckResult(ret);
        }
Пример #13
0
        private void PAF_Preenche_B()
        {
            #region B1
            var registroB1Rec = new ACBrPAFInterop.RegistroHD1Rec
            {
                RAZAOSOCIAL = ToUTF8(PafB.RegistroB1.RazaoSocial),
                CNPJ = ToUTF8(PafB.RegistroB1.CNPJ),
                UF = ToUTF8(PafB.RegistroB1.UF),
                IE = ToUTF8(PafB.RegistroB1.IE),
                IM = ToUTF8(PafB.RegistroB1.IM)
            };
            #endregion

            #region B2
            var registrosB2Rec = (from x in PafB.RegistroB2
                                                             select new ACBrPAFInterop.RegistroB2Rec
                                                             {
                                                                 BOMBA = ToUTF8(x.BOMBA),
                                                                 BICO = ToUTF8(x.BICO),
                                                                 DATA = x.DATA.ToOADate(),
                                                                 HORA = x.HORA.ToOADate(),
                                                                 MOTIVO = ToUTF8(x.MOTIVO),
                                                                 CNPJ_EMPRESA = ToUTF8(x.CNPJ_EMPRESA),
                                                                 CPF_TECNICO = ToUTF8(x.CPF_TECNICO),
                                                                 NRO_LACRE_ANTES = ToUTF8(x.NRO_LACRE_ANTES),
                                                                 NRO_LACRE_APOS = ToUTF8(x.NRO_LACRE_ANTES),
                                                                 ENCERRANTE_ANTES = Convert.ToDouble(x.ENCERRANTE_ANTES),
                                                                 ENCERRANTE_APOS = Convert.ToDouble(x.ENCERRANTE_APOS),
                                                                 RegistroValido = x.RegistroValido
                                                             }).ToArray();
            #endregion

            var ret = ACBrPAFInterop.PAF_Preenche_B(Handle, registroB1Rec, registrosB2Rec, PafB.RegistroB2.Count);
            CheckResult(ret);
        }
Пример #14
0
	    private void PAF_Preenche_C()
        {
            #region C1
            var registroC1Rec = new ACBrPAFInterop.RegistroHD1Rec
                {
                    RAZAOSOCIAL = ToUTF8(PafC.RegistroC1.RazaoSocial),
                    CNPJ = ToUTF8(PafC.RegistroC1.CNPJ),
                    UF = ToUTF8(PafC.RegistroC1.UF),
                    IE = ToUTF8(PafC.RegistroC1.IE),
                    IM = ToUTF8(PafC.RegistroC1.IM)
                };
            #endregion

            #region C2
            var registrosC2Rec = (from x in PafC.RegistroC2
                                                             select new ACBrPAFInterop.RegistroC2Rec
                                                             {
                                                                 ID_ABASTECIMENTO = ToUTF8(x.ID_ABASTECIMENTO),
                                                                 TANQUE = ToUTF8(x.TANQUE),
                                                                 BOMBA = ToUTF8(x.BOMBA),
                                                                 COMBUSTIVEL = ToUTF8(x.COMBUSTIVEL),
                                                                 DATA_ABASTECIMENTO = x.DATA_ABASTECIMENTO.ToOADate(),
                                                                 HORA_ABASTECIMENTO = x.HORA_ABASTECIMENTO.ToOADate(),
                                                                 ENCERRANTE_INICIAL = Convert.ToDouble(x.ENCERRANTE_INICIAL),
                                                                 ENCERRANTE_FINAL = Convert.ToDouble(x.ENCERRANTE_FINAL),
                                                                 STATUS_ABASTECIMENTO = ToUTF8(x.STATUS_ABASTECIMENTO),
                                                                 NRO_SERIE_ECF = ToUTF8(x.NRO_SERIE_ECF),
                                                                 DATA = x.DATA.ToOADate(),
                                                                 HORA = x.HORA.ToOADate(),
                                                                 COO = x.COO,
                                                                 NRO_NOTA_FISCAL = x.NRO_NOTA_FISCAL,
                                                                 VOLUME = Convert.ToDouble(x.VOLUME),
                                                                 RegistroValido = x.RegistroValido
                                                             }).ToArray();

            #endregion

            var ret = ACBrPAFInterop.PAF_Preenche_C(Handle, registroC1Rec, registrosC2Rec, PafC.RegistroC2.Count);
            CheckResult(ret);
        }