public IEnumerable <R_ContributionType> GetContributionTypes() { IEnumerable <R_ContributionType> results = null; var sql = PetaPoco.Sql.Builder .Select("*") .From("R_ContributionType") .Where("IsDeleted = 0") ; results = R_ContributionType.Query(sql); return(results); }
public IEnumerable <R_ContributionType> GetContributionTypeListAdvancedSearch( string name , string description , bool?active ) { IEnumerable <R_ContributionType> results = null; var sql = PetaPoco.Sql.Builder .Select("*") .From("R_ContributionType") .Where("IsDeleted = 0" + (name != null ? " and Name like '%" + name + "%'" : "") + (description != null ? " and Description like '%" + description + "%'" : "") + (active != null ? " and Active = " + (active == true ? "1" : "0") : "") ) ; results = R_ContributionType.Query(sql); return(results); }