public static List <Categoria> List(FiltroCategorias f) { List <Categoria> resulList = new List <Categoria>(); try { CategoriaDS dataservice = new CategoriaDS(); DataSet listado = dataservice.List(f); if (listado.Tables.Count > 0) { foreach (DataRow d in listado.Tables[0].Rows) { Categoria c = new Categoria(); ORM(c, d); resulList.Add(c); } } } catch (Exception ex) { throw ex; } return(resulList); }
public override System.Data.DataSet List(Filter f, out int RecordCount) { DataSet ds = new DataSet(); try { FiltroCategorias filtro = (FiltroCategorias)f; List <IDbDataParameter> paramList = new List <IDbDataParameter>(); DBRepository repository = DBRepository.GetDbRepository(); paramList.Add(repository.DbFactory.getDataParameter("P_ID", DbType.Int32, filtro.ID)); bool result = repository.ExecuteListProcedure(CONST_LIST_PROCEDURE_NAME, paramList, f, ds, out RecordCount); } catch (Exception ex) { throw ex; } return(ds); }
public static List <Categoria> ListAll() { FiltroCategorias f = new FiltroCategorias(); return(List(f)); }