|
From: <sv...@de...> - 2005-06-24 17:48:11
|
Author: pcamacho
Date: 2005-06-24 13:48:12 -0400 (Fri, 24 Jun 2005)
New Revision: 1415
Modified:
humano2/trunk/components/viewTools/ViewTools.cs
humano2/trunk/components/webTools/Adapter.cs
humano2/trunk/web/portal/site/showView.aspx.cs
Log:
FIX: ticket #228. Now viewtools has the possibility to be case unsensitiv=
e for WHERE condition using operator=20
StartsWith or ContainsTo.
Modified: humano2/trunk/components/viewTools/ViewTools.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/components/viewTools/ViewTools.cs 2005-06-24 16:22:29 U=
TC (rev 1414)
+++ humano2/trunk/components/viewTools/ViewTools.cs 2005-06-24 17:48:12 U=
TC (rev 1415)
@@ -34,6 +34,7 @@
private int _page, _rowcount, _pageview, _totalRecordCount;
private string _tempTable;
private string _whereInit =3D "";
+ private bool _caseSensitive; //To allow doing insensitive case s=
earch
#endregion
=20
#region "CONSTRUCTORES"
@@ -80,6 +81,19 @@
this._rowcount =3D value;
}
}
+ =20
+ public bool CaseSensitive
+ {
+ get
+ {
+ return this._caseSensitive;
+ }
+ set
+ {
+ this._caseSensitive =3D value;
+ } =20
+ }
+ =20
public int PageView
{
get
@@ -824,13 +838,23 @@
break;
}
=20
+ //To do sensitive or insensitive search
+ string like =3D "";
+ if(CaseSensitive)
+ {
+ like=3D"LIKE";
+ }
+ else
+ {
+ like=3D"ILIKE"; =20
+ }
switch(intFilter)
{
case (int)Enums.Condition.BeginWith:
- strFilters.Append("LIKE '" + endArgument + "%' ");
+ strFilters.Append(like + " '" + endArgument + "%' ");
break;
case (int)Enums.Condition.ContainsTo:
- strFilters.Append("LIKE '%" + endArgument + "%' ");
+ strFilters.Append(like +" '%" + endArgument + "%' ");
break;
case (int)Enums.Condition.DistinctTo:
strFilters.Append("<> " + endArgument + " ");
@@ -1116,7 +1140,7 @@
strFilters.Append("LIKE '" + parameter.ToString() + "%' ");
break;
case (int)Enums.Condition.ContainsTo:
- strFilters.Append("LIKE '%" + parameter.ToString() + "%' ");
+ strFilters.Append("ILIKE '%" + parameter.ToString() + "%' ");
break;
case (int)Enums.Condition.DistinctTo:
//If adicional agregado, pues ViewTools se caia cuando se comparab=
a con NULL
Modified: humano2/trunk/components/webTools/Adapter.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/components/webTools/Adapter.cs 2005-06-24 16:22:29 UTC =
(rev 1414)
+++ humano2/trunk/components/webTools/Adapter.cs 2005-06-24 17:48:12 UTC =
(rev 1415)
@@ -318,16 +318,23 @@
///<param name=3D"iniClass">The class that the DataTable's View sho=
uld act on.</param>
///<param name=3D"order">The ViewTools formated string with the ord=
er.</param>
///<param name=3D"page">The page that should be shown.</param>
- ///<param name=3D"keyFlag">The key Flag to use (0: for group=
by,1: without group)</param>
-
+ ///<param name=3D"keyFlag">The key Flag to use (0: for group by,=
1: without group)</param>
+ ///<param name=3D"caseSensitive">To know if we want case sensiti=
ve search or not. Use for search commonly</param>
///<returns>The datatable that is the result of executing the view.=
</returns>
- public DataTable ExecViewFromDataTable(int iniClass, DataTable vtTa=
ble, int idEntity, string order,=20
- int page, int keyFlag)
+ public DataTable ExecViewFromDataTable( int iniClass,=20
+ DataTable vtTable,=20
+ int idEntity,=20
+ string order,=20
+ int page,=20
+ int keyFlag,
+ bool caseSensitive)
{
// We got the data.. Do the viewTools invocation with the data.
Humano2.Components.ViewTools.ViewTools vt =3D new Humano2.Components.=
ViewTools.ViewTools(iniClass);
vt.Complex =3D complex;
- vt.KeyFlag=3DkeyFlag;
+ vt.KeyFlag =3D keyFlag;
+ vt.CaseSensitive =3D caseSensitive;
+ =20
if((order !=3D null) && (order !=3D""))
{=20
Logger.Log("ExecViewFromDataTable: " + "order!=3D \"\"",Lo=
gLevel.Trace);
Modified: humano2/trunk/web/portal/site/showView.aspx.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/portal/site/showView.aspx.cs 2005-06-24 16:22:29 UT=
C (rev 1414)
+++ humano2/trunk/web/portal/site/showView.aspx.cs 2005-06-24 17:48:12 UT=
C (rev 1415)
@@ -73,6 +73,7 @@
{
Logger.Log("=3D=3D=3D showView.aspx.cs =3D=3D=3D",LogLevel.T=
race);
}
+ =20
override protected string createXml()
{
string xmlString =3D""; //the result string
@@ -142,7 +143,7 @@
// The framework already puts a "," between multiple "order =
arguments.
Logger.Log("Before ExecViewFromDataTabe. iniClass=3D " + Con=
vert.ToString(iniClass),LogLevel.Trace);
=20
- DataTable viewRes =3D dbAdapter.ExecViewFromDataTable(iniCla=
ss, viewTable, idEntity, orderArr, currPage, 1);
+ DataTable viewRes =3D dbAdapter.ExecViewFromDataTable(iniCla=
ss, viewTable, idEntity, orderArr, currPage, 1, true);
viewRes =3D bigPatchForViewTools(viewRes,viewTable,iniClass,=
idEntity); //Only a big patch, see comment of the function....
=20
int pageCount=3D dbAdapter.NumberOfPagesInPagedView;
@@ -729,7 +730,8 @@
viewTable.Rows[0]["columns"] =3D "0," + col;
=20
adapter dbAdapter =3D userCred.CoreAdapter;
- DataTable res =3D dbAdapter.ExecViewFromDataTable(iniClass, =
viewTable, idEntity, "", 0, 1);
+ Logger.Log("order=3D " + viewTable.Rows[0]["order"],LogLevel=
.Trace);
+ DataTable res =3D dbAdapter.ExecViewFromDataTable(iniClass, =
viewTable, idEntity, "", 0, 1,false);
=20
//Build the column
int size =3D res.Rows.Count;
|