private static FatturaAcquisto CreaFatturaAcquisto(FattureAcquistoDS.FattureAcquistoTestataRow riga) { if (riga == null) { return(null); } FatturaAcquisto fattura = new FatturaAcquisto(); fattura.CodiceFornitore = riga._EOS_Pay_to_Vendor_No_; fattura.IDDocumento = riga.EOS_Source_Doc__Entry_No_; fattura.TipoDocumento = riga.EOS_Document_Type; fattura.Fornitore = riga._EOS_Pay_to_Name; fattura.Riferimento = riga.EOS_Vendor_Invoice_No_; fattura.Importo = riga.EOS_Check_Total; fattura.Data = riga.EOS_Receipt_Date; return(fattura); }
public static List <FatturaAcquisto> EstraiListaFattureAcquisto(string codiceFornitore) { FattureAcquistoDS ds = new FattureAcquistoDS(); using (FattureAcquistoBusiness bFatturaAcquisto = new FattureAcquistoBusiness()) { bFatturaAcquisto.FillFattureAcquisto(ds, codiceFornitore); } List <FatturaAcquisto> fatture = new List <FatturaAcquisto>(); foreach (FattureAcquistoDS.FattureAcquistoTestataRow riga in ds.FattureAcquistoTestata) { FatturaAcquisto fattura = CreaFatturaAcquisto(riga); fatture.Add(fattura); } return(fatture); }