private void CarregaFormasPagamento(int count) { formasPagamento = new FormaPagamento[count]; for (int i = 0; i < count; i++) { var record = new ACBrECFInterop.FormaPagamentoRec(); int ret = ACBrECFInterop.ECF_GetFormaPagamento(this.Handle, ref record, i); CheckResult(ret); FormaPagamento formaPagamento = new FormaPagamento { Indice = FromUTF8(record.Indice), Descricao = FromUTF8(record.Descricao), PermiteVinculado = record.PermiteVinculado, Total = Convert.ToDecimal(record.Total), Data = DateTime.FromOADate(record.Data), TipoDoc = FromUTF8(record.TipoDoc) }; formasPagamento[i] = formaPagamento; } }
public void PafMF_RelMeiosPagamento(FormaPagamento[] formasPagamento, string TituloRelatorio, int indiceRelatorio) #endif { ACBrECFInterop.FormaPagamentoRec[] record = new ACBrECFInterop.FormaPagamentoRec[formasPagamento.Length]; for (int i = 0; i < formasPagamento.Length; i++) { record[i].Indice = formasPagamento[i].Indice; record[i].Descricao = ToUTF8(formasPagamento[i].Descricao); record[i].PermiteVinculado = formasPagamento[i].PermiteVinculado; record[i].Total = Convert.ToDouble(formasPagamento[i].Total); record[i].Data = formasPagamento[i].Data.ToOADate(); record[i].TipoDoc = ToUTF8(formasPagamento[i].TipoDoc); } int ret = ACBrECFInterop.ECF_PafMF_RelMeiosPagamento(this.Handle, record, record.Length, ToUTF8(TituloRelatorio), indiceRelatorio); CheckResult(ret); }
public FormaPagamento AchaFPGIndice(string indice) { ACBrECFInterop.FormaPagamentoRec FormaRec = new ACBrECFInterop.FormaPagamentoRec(); int ret = ACBrECFInterop.ECF_AchaFPGIndice(this.Handle, ToUTF8(indice), ref FormaRec); CheckResult(ret); if (ret == 0) return null; FormaPagamento Forma = new FormaPagamento { Data = DateTime.FromOADate(FormaRec.Data), Descricao = FromUTF8(FormaRec.Descricao), Indice = FromUTF8(FormaRec.Indice), PermiteVinculado = FormaRec.PermiteVinculado, TipoDoc = FromUTF8(FormaRec.TipoDoc), Total = Convert.ToDecimal(FormaRec.Total) }; int count = GetInt32(ACBrECFInterop.ECF_GetFPGCount); CheckResult(count); CarregaFormasPagamento(count); return Forma; }
private void CarregaMeiosDePagamento() { int count = ACBrECFInterop.ECF_DadosReducaoZClass_GetFPGCount(this.Handle); CheckResult(count); formasPagamento = new FormaPagamento[count]; for (int i = 0; i < count; i++) { var record = new ACBrECFInterop.FormaPagamentoRec(); int ret = ACBrECFInterop.ECF_DadosReducaoZClass_GetFPG(this.Handle, ref record, i); CheckResult(ret); FormaPagamento formaPagamento = new FormaPagamento(); formaPagamento.Indice = FromUTF8(record.Indice); formaPagamento.Descricao = FromUTF8(record.Descricao); formaPagamento.PermiteVinculado = record.PermiteVinculado; formaPagamento.Total = Convert.ToDecimal(record.Total); formaPagamento.Data = DateTime.FromOADate(record.Data); formaPagamento.TipoDoc = FromUTF8(record.TipoDoc); formasPagamento[i] = formaPagamento; } }