once i got some code for a webpage.. there was this search 'engine' using one mathod:
<br />
public static dt_Product[] DB_Search(<br />
int _CMS_LanguageID,<br />
int _SubGroup,<br />
int _Make,<br />
string _ITEMNMBR,<br />
string _KTMDESC)<br />
{<br />
<br />
SqlParameter[] p ={<br />
new SqlParameter("@CMS_LanguageID", _CMS_LanguageID),<br />
new SqlParameter("@SubGroup", _SubGroup),<br />
new SqlParameter("@Group", int.Parse("-1")),<br />
new SqlParameter("@Make", _Make),<br />
new SqlParameter("@ITEMNMBR", _ITEMNMBR),<br />
new SqlParameter("@KTMDESC", _KTMDESC),<br />
new SqlParameter("@PRICELEVEL", ""),<br />
new SqlParameter("@IDSUBCAT_1", int.Parse("-1")),<br />
new SqlParameter("@IDVALUE_1_P", int.Parse("-1")),<br />
new SqlParameter("@IDVALUE_1_K", int.Parse("-1")),<br />
new SqlParameter("@IDSUBCAT_2", int.Parse("-1")),<br />
new SqlParameter("@IDVALUE_2_P", int.Parse("-1")),<br />
new SqlParameter("@IDVALUE_2_K", int.Parse("-1")),<br />
new SqlParameter("@IDSUBCAT_3", int.Parse("-1")),<br />
new SqlParameter("@IDVALUE_3_P", int.Parse("-1")),<br />
new SqlParameter("@IDVALUE_3_K", int.Parse("-1")),<br />
new SqlParameter("@IDSUBCAT_4", int.Parse("-1")),<br />
new SqlParameter("@IDVALUE_4_P", int.Parse("-1")),<br />
new SqlParameter("@IDVALUE_4_K", int.Parse("-1")),<br />
new SqlParameter("@IDSUBCAT_5", int.Parse("-1")),<br />
new SqlParameter("@IDVALUE_5_P", int.Parse("-1")),<br />
new SqlParameter("@IDVALUE_5_K", int.Parse("-1")),<br />
new SqlParameter("@IDSUBCAT_6", int.Parse("-1")),<br />
new SqlParameter("@IDVALUE_6_P", int.Parse("-1")),<br />
new SqlParameter("@IDVALUE_6_K", int.Parse("-1")),<br />
new SqlParameter("@IDSUBCAT_7", int.Parse("-1")),<br />
new SqlParameter("@IDVALUE_7_P", int.Parse("-1")),<br />
new SqlParameter("@IDVALUE_7_K", int.Parse("-1")),<br />
new SqlParameter("@IDSUBCAT_8", int.Parse("-1")),<br />
new SqlParameter("@IDVALUE_8_P", int.Parse("-1")),<br />
new SqlParameter("@IDVALUE_8_K", int.Parse("-1")),<br />
new SqlParameter("@IDSUBCAT_9", int.Parse("-1")),<br />
new SqlParameter("@IDVALUE_9_P", int.Parse("-1")),<br />
new SqlParameter("@IDVALUE_9_K", int.Parse("-1")),<br />
new SqlParameter("@IDSUBCAT_10", int.Parse("-1")),<br />
new SqlParameter("@IDVALUE_10_P", int.Parse("-1")),<br />
new SqlParameter("@IDVALUE_10_K", int.Parse("-1"))};<br />
<br />
return (dt_Product[])Data.DataReader.DB_Get(typeof(dt_Product), "Product_Search", p);<br />
}<br />
another horror i found in their code was the pagination of the search results ..
long story short after completing the search they did a 'for' loop for all of the results and if i % 5 == 0 they put link to i / 5 page.
also they displayed results in another loop which also was for whole collection.. they checked if i was in range of the page...
all i could say then was: damn =_=' ...
life is study!!!
|