//---------------------------------------------------------------------------------------------------------------------------- private string GetSQLRowsCount() { StringBuilder sbSql = new StringBuilder(); FatcaXmlBean dto = new FatcaXmlBean(); sbSql.Append("Select count(*) from HARM.dbo.FATCA_CRS "); sbSql.Append(" where ").Append(ReflectPropertyInfo.GetSearchFields(dto)).Append(" like @searchParam "); return(sbSql.ToString()); }
//---------------------------------------------------------------------------------------------------------------------------- private string GetSQL(string sortKey, string asceding) { StringBuilder sbSql = new StringBuilder(); FatcaXmlBean dto = new FatcaXmlBean(); sbSql.Append("Select * from HARM.dbo.FATCA_CRS "); sbSql.Append(" where ").Append(ReflectPropertyInfo.GetSearchFields(dto)).Append(" like @searchParam "); sbSql.Append(" ORDER BY "); sbSql.Append(sortKey.Equals("null") ? " Datum " : sortKey + (asceding.Equals("true") ? " ASC " : " DESC ")); sbSql.Append(" OFFSET @pageSize*(@pageIndex-1) ROWS FETCH NEXT @pageSize ROWS ONLY;"); return(sbSql.ToString()); }