public IEnumerable <R_TaskType> GetTaskTypes() { IEnumerable <R_TaskType> results = null; var sql = PetaPoco.Sql.Builder .Select("*") .From("R_TaskType") .Where("IsDeleted = 0") ; results = R_TaskType.Query(sql); return(results); }
public IEnumerable <R_TaskType> GetTaskTypeListAdvancedSearch( string name , string description , bool?active ) { IEnumerable <R_TaskType> results = null; var sql = PetaPoco.Sql.Builder .Select("*") .From("R_TaskType") .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_TaskType.Query(sql); return(results); }