|
@@ -30,16 +30,16 @@ namespace UAS_MES.PublicMethod
|
|
|
DataTable dt = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id=lp_laid where la_code='" + LabelCode + "'", "select");
|
|
DataTable dt = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id=lp_laid where la_code='" + LabelCode + "'", "select");
|
|
|
//比对模板维护的参数和在系统中维护的参数,名称对应进行SQL取值赋给变量
|
|
//比对模板维护的参数和在系统中维护的参数,名称对应进行SQL取值赋给变量
|
|
|
StringBuilder sb = new StringBuilder();
|
|
StringBuilder sb = new StringBuilder();
|
|
|
- for (int i = 0; i < doc.Variables.FreeVariables.Count; i++)
|
|
|
|
|
|
|
+ for (int i = 0; i < doc.Variables.FormVariables.Count; i++)
|
|
|
{
|
|
{
|
|
|
for (int j = 0; j < dt.Rows.Count; j++)
|
|
for (int j = 0; j < dt.Rows.Count; j++)
|
|
|
{
|
|
{
|
|
|
- if (doc.Variables.FreeVariables.Item(i + 1).Name == dt.Rows[j]["lp_name"].ToString())
|
|
|
|
|
|
|
+ if (doc.Variables.FormVariables.Item(i + 1).Name == dt.Rows[j]["lp_name"].ToString())
|
|
|
{
|
|
{
|
|
|
string sql = dt.Rows[j]["lp_sql"].ToString();
|
|
string sql = dt.Rows[j]["lp_sql"].ToString();
|
|
|
sql = sql.Substring(0, sql.IndexOf("{")) + "'" + SnCode + "'";
|
|
sql = sql.Substring(0, sql.IndexOf("{")) + "'" + SnCode + "'";
|
|
|
- doc.Variables.FreeVariables.Item(i + 1).Value = dh.GetLabelParam(sql).ToString();
|
|
|
|
|
- sb.AppendLine("打印参数【" + doc.Variables.FreeVariables.Item(i + 1).Name + "】赋值," + "取值SQL:" + sql + ",取到值" + doc.Variables.FreeVariables.Item(i + 1).Value);
|
|
|
|
|
|
|
+ doc.Variables.FormVariables.Item(i + 1).Value = dh.GetLabelParam(sql).ToString();
|
|
|
|
|
+ sb.AppendLine("打印参数【" + doc.Variables.FormVariables.Item(i + 1).Name + "】赋值," + "取值SQL:" + sql + ",取到值" + doc.Variables.FormVariables.Item(i + 1).Value);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|