public List<Assetconfig> RetrieveAssetconfigsPaging(AssetconfigSearch info,int pageIndex, int pageSize,out int count) { try { StringBuilder sqlCommand = new StringBuilder(@" SELECT ""ASSET_CONFIG"".""CONFIGID"",""ASSET_CONFIG"".""CATEGORYID"",""ASSET_CONFIG"".""CATEGORYNAME"",""ASSET_CONFIG"".""CONFIGNAME"",""ASSET_CONFIG"".""CONFIGVALUE"", ""ASSET_CONFIG"".""CREATEDDATE"",""ASSET_CONFIG"".""CREATOR"" FROM ""ASSET_CONFIG"" WHERE 1=1"); if (!string.IsNullOrEmpty(info.Configid)) { this.Database.AddInParameter(":Configid",DbType.AnsiString,"%"+info.Configid+"%"); sqlCommand.AppendLine(@" AND ""ASSET_CONFIG"".""CONFIGID"" LIKE :Configid"); } if (!string.IsNullOrEmpty(info.Categoryid)) { this.Database.AddInParameter(":Categoryid",DbType.AnsiString,"%"+info.Categoryid+"%"); sqlCommand.AppendLine(@" AND ""ASSET_CONFIG"".""CATEGORYID"" LIKE :Categoryid"); } if (!string.IsNullOrEmpty(info.Categoryname)) { this.Database.AddInParameter(":Categoryname",DbType.AnsiString,"%"+info.Categoryname+"%"); sqlCommand.AppendLine(@" AND ""ASSET_CONFIG"".""CATEGORYNAME"" LIKE :Categoryname"); } if (!string.IsNullOrEmpty(info.Configname)) { this.Database.AddInParameter(":Configname",DbType.AnsiString,"%"+info.Configname+"%"); sqlCommand.AppendLine(@" AND ""ASSET_CONFIG"".""CONFIGNAME"" LIKE :Configname"); } if (!string.IsNullOrEmpty(info.Configvalue)) { this.Database.AddInParameter(":Configvalue",DbType.AnsiString,"%"+info.Configvalue+"%"); sqlCommand.AppendLine(@" AND ""ASSET_CONFIG"".""CONFIGVALUE"" LIKE :Configvalue"); } if (!string.IsNullOrEmpty(info.Creator)) { this.Database.AddInParameter(":Creator", "%"+info.Creator+"%"); sqlCommand.AppendLine(@" AND ""ASSET_CONFIG"".""CREATOR"" LIKE :Creator"); } sqlCommand.AppendLine(@" ORDER BY ""ASSET_CONFIG"".""CONFIGID"" DESC"); return this.ExecuteReaderPaging<Assetconfig>(sqlCommand.ToString(), pageIndex, pageSize, out count); } finally { this.Database.ClearParameter(); } }
public List<Assetconfig> RetrieveAssetconfigsPaging(AssetconfigSearch info,int pageIndex, int pageSize,out int count) { return Management.RetrieveAssetconfigsPaging(info,pageIndex,pageSize,out count); }