public List <TributarioDataSourceShow> CargarInforme() { try { var items = this.persistencia.CargarInforme(); if (items != null) { List <TributarioDataSourceShow> tributa = new List <TributarioDataSourceShow>(); foreach (var item in items) { TributarioDataSourceShow trib = new TributarioDataSourceShow(); trib.Codigo = item.codigotrib; trib.NombreTrib = item.nombre; trib.Tope = item.tope; trib.NitTope = item.idnittope != null ? item.maenits.nit : string.Empty; trib.NombreNit = item.idnittope != null ? item.maenits.nombrenit : string.Empty; tributa.Add(trib); } return(tributa); } else { return(this.TributarioNull()); } } catch (Exception ex) { throw ex; } }
private List <TributarioDataSourceShow> TributarioNull() { List <TributarioDataSourceShow> tributa = new List <TributarioDataSourceShow>(); TributarioDataSourceShow ds = new TributarioDataSourceShow(); ds.Codigo = null; ds.NombreTrib = null; ds.Tope = null; ds.NitTope = null; ds.NombreNit = null; tributa.Add(ds); return(tributa); }