|
From: <sv...@de...> - 2005-06-24 22:35:08
|
Author: cristian
Date: 2005-06-24 18:35:13 -0400 (Fri, 24 Jun 2005)
New Revision: 1428
Modified:
humano2/trunk/components/rules/Rules.cs
humano2/trunk/web/builder/site/createInstanceRule.aspx.cs
humano2/trunk/web/builder/site/xsl/createrule.xsl
Log:
* Modificacion para en la creacion de reglas, en la seccion de filtros y=
valor, mostrar y aceptar atributos de clases relacionadas.
Modified: humano2/trunk/components/rules/Rules.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/rules/Rules.cs 2005-06-24 21:49:08 UTC (rev =
1427)
+++ humano2/trunk/components/rules/Rules.cs 2005-06-24 22:35:13 UTC (rev =
1428)
@@ -236,6 +236,7 @@
string attributes,operators,elements;
string[] arrAttributes,arrOperators,arrElements;
int attrib;
+ string str_attrib=3D"";
int operatorId; //,setToId,idRel;
string elementRule,setTo;
string valueRule=3D"";
@@ -267,7 +268,8 @@
=20
while(i<arrAttributes.Length)
{
- attrib =3D Convert.ToInt32(arrAttributes[i]);
+ //attrib =3D Convert.ToInt32(arrAttributes[i]);
+ str_attrib =3D Convert.ToString(arrAttributes[i]);
operatorId =3D Convert.ToInt32(arrOperators[i]);
elementRule =3D Convert.ToString(arrElements[i]);
=20
@@ -282,15 +284,17 @@
//setToId =3D theparams[0];
//idRel =3D theparams[1];
=20
- tableId =3D complex.TableId(attrib);
+ //tableId =3D complex.TableId(attrib);
+ tableId =3D complex.TableId(Convert.ToInt32(setTo));
+ =09
=20
if(operatorId!=3D-1 && elementRule!=3D"" && id_entity=3D=3D0)
{
- filtro =3D filtro + attrib+"|"+operatorId+"|"+elementRule+finfiltro=
;
+ filtro =3D filtro + str_attrib +"|"+operatorId+"|"+elementRule+finf=
iltro;
}
else if(operatorId!=3D-1 && elementRule!=3D"" && id_entity>0)
{
- filtro =3D filtro + attrib+"|"+operatorId+"|"+elementRule+"|1|0";
+ filtro =3D filtro + str_attrib +"|"+operatorId+"|"+elementRule+"|1|=
0";
filtro =3D filtro+";0|4|'"+id_entity+"'"+finfiltro;
}
else if(id_entity>0)
@@ -340,6 +344,7 @@
string attributes,operators,elements;
string[] arrAttributes,arrOperators,arrElements;
int attrib;
+ string str_attrib =3D "";
int operatorId; //,setToId,idRel;
string elementRule,setTo;
string valueRule=3D"";
@@ -371,7 +376,8 @@
=20
while(i<arrAttributes.Length)
{
- attrib =3D Convert.ToInt32(arrAttributes[i]);
+ //attrib =3D Convert.ToInt32(arrAttributes[i]);
+ str_attrib =3D Convert.ToString(arrAttributes[i]);
operatorId =3D Convert.ToInt32(arrOperators[i]);
elementRule =3D Convert.ToString(arrElements[i]);
=20
@@ -386,15 +392,16 @@
//setToId =3D theparams[0];
//idRel =3D theparams[1];
=20
- tableId =3D complex.TableId(attrib);
+ //tableId =3D complex.TableId(attrib);
+ tableId =3D complex.TableId(Convert.ToInt32(setTo));
=20
if(operatorId!=3D-1 && elementRule!=3D"" && id_entity=3D=3D0)
{
- filtro =3D filtro + attrib+"|"+operatorId+"|"+elementRule+finfiltro=
;
+ filtro =3D filtro + str_attrib +"|"+operatorId+"|"+elementRule+finf=
iltro;
}
else if(operatorId!=3D-1 && elementRule!=3D"" && id_entity>0)
{
- filtro =3D filtro + attrib+"|"+operatorId+"|"+elementRule+"|1|0";
+ filtro =3D filtro + str_attrib +"|"+operatorId+"|"+elementRule+"|1|=
0";
filtro =3D filtro+";0|4|'"+id_entity+"'"+finfiltro;
}
else if(id_entity>0)
Modified: humano2/trunk/web/builder/site/createInstanceRule.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/builder/site/createInstanceRule.aspx.cs 2005-06-24 =
21:49:08 UTC (rev 1427)
+++ humano2/trunk/web/builder/site/createInstanceRule.aspx.cs 2005-06-24 =
22:35:13 UTC (rev 1428)
@@ -130,9 +130,40 @@
strXml +=3D "<Att>";
strXml +=3D "<id>" + currAtt["id_entity"] + "</id>";
strXml +=3D "<name>" + currAtt["attName"] + "</name>";
+ strXml +=3D "<classid>" + classId + "</classid>";
strXml +=3D "</Att>";
+ }
=20
+ foreach(DataRow row in attributeTable.Select("attType=3D'pertinence'"=
))=20
+ {
+ int idatt =3D Convert.ToInt32(row["id_entity"]);
+ string attNamePert =3D Convert.ToString(row["attName"]);
+ DataTable dtpert =3D userCred.CoreAdapter.GetClassesFromPertinence(i=
datt);
+ foreach(DataRow dr in dtpert.Rows)
+ {
+ =20
+ int idClassRel =3D Convert.ToInt32(dr["to"].ToString());
+ DataTable dtrel =3D userCred.CoreAdapter.GetAttributesFromClass(idC=
lassRel);
+ foreach(DataRow row2 in dtrel.Rows)=20
+ {
+ string attName =3D Convert.ToString(row2["attName"]);
+ string className =3D Convert.ToString(dr["name"]);
+ strXml +=3D "<Att>";
+ strXml +=3D "<id>" + idatt.ToString()+"^"+row2["id_entity"] + "</i=
d>";
+ strXml +=3D "<name>" + attNamePert+"."+attName + "</name>";
+ strXml +=3D "<classid>" + idClassRel + "</classid>";
+ strXml +=3D "</Att>";
+ /*
+ attrIdList[Convert.ToString(idatt.ToString()+"^"+row2["id_entity"]=
)] =3D Convert.ToString(attNamePert+"."+attName);
+ if(row2["isPrimary"].ToString()=3D=3D"1")
+ {
+ attrIdList[Convert.ToString(idatt.ToString()+"^"+row2["id_entity"=
])] =3D Convert.ToString(attNamePert);
+ }
+ */
+ }
+ }=09
}
+
strXml +=3D "</Attributes>";
strXml +=3D "<operator>";
strXml +=3D "<option><id>0</id><text>Greater Equal Than</text></opt=
ion>";
Modified: humano2/trunk/web/builder/site/xsl/createrule.xsl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/builder/site/xsl/createrule.xsl 2005-06-24 21:49:08=
UTC (rev 1427)
+++ humano2/trunk/web/builder/site/xsl/createrule.xsl 2005-06-24 22:35:13=
UTC (rev 1428)
@@ -8,7 +8,7 @@
<META http-equiv=3D"Content-Type" content=3D"text/html"/>
<title>Nueva Regla</title>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-=
8"/>
- <link href=3D"styles/css/createinterface.css" rel=3D"stylesheet" type=3D=
"text/css"/>
+ <link href=3D"css/createinterface.css" rel=3D"stylesheet" type=3D"text=
/css"/>
</head>
=20
=20
@@ -264,13 +264,13 @@
<td class=3D"smallgraytextnolink" width=3D"200" valign=3D"center">
<table cellspacing=3D"0" cellpadding=3D"0" border=3D"0">
<tr>
- <td class=3D"smallgraytextnolink"><span class=3D"ast=
eriscorojo">*</span>??</td>
+ <td class=3D"smallgraytextnolink"><span class=3D"ast=
eriscorojo">*</span></td>
<td class=3D"smallgraytextnolink">Nombre</td>
</tr>
</table>
</td>
<td class=3D"smallgraytextnolink" valign=3D"center">
- <input type=3D"text" name=3D"nameRule" size=3D"30" maxl=
ength=3D"100" value=3D"{/Page/rule/name}"/>??
+ <input type=3D"text" name=3D"nameRule" size=3D"30" maxl=
ength=3D"100" value=3D"{/Page/rule/name}"/>
</td>
</tr>
=20
@@ -278,8 +278,8 @@
<td class=3D"smallgraytextnolink" width=3D"200" valign=3D"center">
<table cellspacing=3D"0" cellpadding=3D"0" border=3D"0">
<tr>
- <td class=3D"smallgraytextnolink"><span class=3D"ast=
eriscorojo">*</span>??</td>
- <td class=3D"smallgraytextnolink">Descripci??n</td>
+ <td class=3D"smallgraytextnolink"><span class=3D"ast=
eriscorojo">*</span></td>
+ <td class=3D"smallgraytextnolink">Descripcion</td>
</tr>
</table>
</td>
@@ -400,7 +400,7 @@
<td class=3D"s">
<select style=3D"width:220px" martest2=3D=
"56296" name=3D"setTo" class=3D"drpdwn2">
<option value=3D"">--Nada--</option>
- <xsl:for-each select=3D"/Page/Attributes/Att=
">
+ <xsl:for-each select=3D"/Page/Attributes/Att=
[classid=3D/Page/rule/classId]">
<option value=3D"{id}"><xsl:value-of disable-output-escaping=3D"y=
es" select=3D"normalize-space(name)"/></option>
</xsl:for-each>
</select>
|