|
From: <sv...@de...> - 2005-05-25 14:40:15
|
Author: pcamacho
Date: 2005-05-25 10:40:06 -0400 (Wed, 25 May 2005)
New Revision: 1143
Modified:
humano2/trunk/components/webTools/Adapter.cs
humano2/trunk/web/portal/site/leftbar.aspx.cs
humano2/trunk/web/portal/site/showView.aspx.cs
Log:
CHANGE: the function GetViewDataTableById has been reimplemented with Vie=
wTools.
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-05-25 00:05:37 UTC =
(rev 1142)
+++ humano2/trunk/components/webTools/Adapter.cs 2005-05-25 14:40:06 UTC =
(rev 1143)
@@ -275,19 +275,52 @@
/// <returns>A DataTable with the structure of the view referenced by =
the viewId.</returns>
public DataTable GetViewDataTableFromId(int viewId, out int iniClas=
s)
{
- iniClass =3D 0;
+ iniClass =3D 0;
=20
+ Humano2.Components.ViewTools.ViewTools vt =3D new ViewTools.ViewTo=
ols();
+ vt.Complex =3D complex;
+ =09
+ DataTable table =3D getViewToolsTable();
+
+ // Get the id_entity and the domainName of all the domains in the sys=
tem.
+ string columns =3D "1012,1013,1014,1015,1016,1017,1018";
+ string where =3D "0|4|'"+ viewId +"'|0|0";
+ //string[] fila =3D {"1011",columns,where,"","","","0"};
+ //table.Rows.Add(fila);
+ //vt.IdClass =3D Convert.ToInt32(ViewConsts.ViewClass);
+ //vt.KeyFlag =3D 1;
+
+ //DataTable resp =3D vt.GetSQLDataTable(table);
+ =20
+ DataTable resp =3D GenerateViewTools(1011,columns,where,"","","",0);
+ Logger.Log("GetViewDataTable : step1" + resp.Rows.Count ,Lo=
gLevel.Trace);
+ DataRow row =3D resp.Rows[0];
+ string idClassView =3D null;
+ if (row !=3D null)
+ {
+ idClassView =3D Convert.ToString(row["idClassView"]);
+ }
+ =20
+ string[] arInfo =3D new string[2]; =20
+ // define which character is seperating fields
+ char[] splitter =3D {'^'};
+ =20
+ arInfo =3D idClassView.Split(splitter);
+ =20
+ iniClass =3D Convert.ToInt32(arInfo[0]);
+
+ return resp;
+ =20
+ } =20
+ /* =20
//Variables para extraer las funciones de coliumnas de tipo "vista"
string columnValue=3D"";
=09
- // Create the table to invoke ViewTools with.
- DataTable vtTable =3D getViewToolsTable();
- DataRow vtInstance=3D vtTable.NewRow();
=20
DataSet myDataSet=3D new DataSet();
// Now we read the view via it's viewId, to recover it's values.
myDataSet =3D ReadDataWithName(viewId, "data");
- =09
+ Logger.Log(DbUtils.DumpData(myDataSet),LogLevel.Trace);
//FIXME: there has to be a way to not walk over all elements (three "=
for" loops!)
//FIXME: Maybe the best way is to use "viewTools" to get the view ele=
ments.
foreach(DataTable myTable in myDataSet.Tables)
@@ -301,8 +334,10 @@
catch(System.InvalidCastException ) { continue; }
catch(System.FormatException) { continue; }
=20
+ Logger.Log("columnName: " + columnName,LogLevel.=
Trace);
switch(columnName) // See if the entites are parts of the view tab=
le taht we need.
{
+ =20
case (int) ViewConsts.Columns: // If the row contains "columns" pa=
rt of the "view"
vtInstance["columns"] =3D myRow["data"].ToString();
break;
@@ -322,16 +357,8 @@
case (int) ViewConsts.Class:
=20
string info =3D myRow["data"].ToString();
+ Logger.Log("info: " + info,LogLevel.Trace);
=20
- string[] arInfo =3D new string[2];
- =20
- // define which character is seperating fields
- char[] splitter =3D {'^'};
- =20
- arInfo =3D info.Split(splitter);
- =20
- iniClass =3D Convert.ToInt32(arInfo[0]);
- =20
break;
}
}
@@ -342,7 +369,8 @@
=20
return vtTable;=20
}
- =20
+ */
+ =20
///<summary>Execute a View from a DataTable.</summary>
///<param name=3D"vtTable">A datatable with the data relevant to th=
e View.</param>
///<param name=3D"iniClass">The class that the DataTable's View sho=
uld act on.</param>
Modified: humano2/trunk/web/portal/site/leftbar.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/leftbar.aspx.cs 2005-05-25 00:05:37 UTC=
(rev 1142)
+++ humano2/trunk/web/portal/site/leftbar.aspx.cs 2005-05-25 14:40:06 UTC=
(rev 1143)
@@ -71,7 +71,7 @@
+ Dr1[1] =20
+ "</classId>"
+ "<href>"
- + ViewPages.showViewPage + Dr1["id_entity"] + "&=
amp;classId=3D" + Dr1[1]=20
+ + ViewPages.showViewPage + Dr1["id_entity"] + "&=
amp;iniClass=3D" + Dr1[1]=20
+ "</href>"
+ "<text>"
+ Dr1[2]
@@ -203,7 +203,7 @@
+ viewClassId[j] =20
+ "</classId>"
+ "<href>"
- + ViewPages.showViewPage + viewId[j] + "&clas=
sId=3D" + viewClassId[j] =20
+ + ViewPages.showViewPage + viewId[j] + "&iniC=
lass=3D" + viewClassId[j] =20
+ "</href>"
+ "<text>"
+ viewName[j]
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-05-25 00:05:37 UT=
C (rev 1142)
+++ humano2/trunk/web/portal/site/showView.aspx.cs 2005-05-25 14:40:06 UT=
C (rev 1143)
@@ -83,7 +83,9 @@
/************************
* Datos usados por Search SVERA 20052005
*/
- iniClass =3D Convert.ToInt32(Request["iniClass"]);
+ iniClass =3D Convert.ToInt32(Request["classId"]);
+ Logger.Log("classId" + iniClass.ToString(),LogLevel.Trace);
+ =20
string idAttributes=3D Request["idAttribute"]; //The attribu=
tes to filter with
string idOperators =3D Request["idOPerator"]; //The operator=
s (<=3D,=3D,>=3D etc...)
string valuesToSearch =3D Request["textToSearch"]; //The val=
ues to compare with
@@ -99,6 +101,7 @@
if (isSearch =3D=3D 0)
{
idEntity =3D Convert.ToInt32(Request.QueryString["id_entity"]);
+ Logger.Log("idEntity: " + idEntity,LogLevel.Trace);
}
else
{
@@ -116,6 +119,7 @@
//Logger.Log("showView createXml: currPage" + currPage, LogL=
evel.Trace);
if(isSearch =3D=3D 0)
{
+ Logger.Log("Before GetViewDataTableFromId: idEntity " +=
idEntity,LogLevel.Trace);
viewTable =3D dbAdapter.GetViewDataTableFromId(idEntity, out iniClas=
s);
}
else
@@ -125,7 +129,8 @@
=20
// If there are multiple "order" arguments, they should be s=
eperated by ",";
// The framework already puts a "," between multiple "order =
arguments.
- Logger.Log("Before ExecViewFromDataTabe",LogLevel.Trace);
+ Logger.Log("Before ExecViewFromDataTabe. iniClass=3D " + Con=
vert.ToString(iniClass),LogLevel.Trace);
+ Logger.Log("idEntity: " + idEntity,LogLevel.Trace);
DataTable viewRes =3D dbAdapter.ExecViewFromDataTable(iniCla=
ss, viewTable, idEntity, orderArr, currPage, 1);
=20
int pageCount=3D dbAdapter.NumberOfPagesInPagedView;
|