|
@@ -22,7 +22,7 @@ namespace UAS_LabelMachine.PublicMethod
|
|
|
DataRow[] dr1 = SingleLabelParam.Select("lp_name='" + SingleDoc.Variables.FormVariables.Item(j + 1).Name + "'");
|
|
DataRow[] dr1 = SingleLabelParam.Select("lp_name='" + SingleDoc.Variables.FormVariables.Item(j + 1).Name + "'");
|
|
|
if (dr1.Length > 0)
|
|
if (dr1.Length > 0)
|
|
|
{
|
|
{
|
|
|
- if (dr1[0]["lp_valuetype"].ToString() == "字符串")
|
|
|
|
|
|
|
+ if (dr1[0]["lp_valuetype"].ToString() == "字符串" && dr1[0]["lp_sql"].ToString() != "")
|
|
|
sql.Append(dr1[0]["lp_sql"].ToString() + ",");
|
|
sql.Append(dr1[0]["lp_sql"].ToString() + ",");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -31,6 +31,10 @@ namespace UAS_LabelMachine.PublicMethod
|
|
|
for (int j = 0; j < SingleDoc.Variables.FormVariables.Count; j++)
|
|
for (int j = 0; j < SingleDoc.Variables.FormVariables.Count; j++)
|
|
|
{
|
|
{
|
|
|
DataRow[] dr1 = SingleLabelParam.Select("lp_name='" + SingleDoc.Variables.FormVariables.Item(j + 1).Name + "'");
|
|
DataRow[] dr1 = SingleLabelParam.Select("lp_name='" + SingleDoc.Variables.FormVariables.Item(j + 1).Name + "'");
|
|
|
|
|
+ if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串" && dr1[0]["lp_sql"].ToString() != "")
|
|
|
|
|
+ {
|
|
|
|
|
+ SingleDoc.Variables.FormVariables.Item(j + 1).Value = dt.Rows[0][dr1[0]["lp_sql"].ToString()].ToString();
|
|
|
|
|
+ }
|
|
|
if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "SQL值")
|
|
if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "SQL值")
|
|
|
{
|
|
{
|
|
|
DataTable dt1 = (DataTable)SystemInf.sdh.ExecuteSql(dr1[0]["lp_sql"].ToString().Replace("{1}", pib_id), "select");
|
|
DataTable dt1 = (DataTable)SystemInf.sdh.ExecuteSql(dr1[0]["lp_sql"].ToString().Replace("{1}", pib_id), "select");
|
|
@@ -60,7 +64,7 @@ namespace UAS_LabelMachine.PublicMethod
|
|
|
for (int j = 0; j < MidDoc.Variables.FormVariables.Count; j++)
|
|
for (int j = 0; j < MidDoc.Variables.FormVariables.Count; j++)
|
|
|
{
|
|
{
|
|
|
DataRow[] dr1 = MidLabelParam.Select("lp_name='" + MidDoc.Variables.FormVariables.Item(j + 1).Name + "'");
|
|
DataRow[] dr1 = MidLabelParam.Select("lp_name='" + MidDoc.Variables.FormVariables.Item(j + 1).Name + "'");
|
|
|
- if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串")
|
|
|
|
|
|
|
+ if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串" && dr1[0]["lp_sql"].ToString() != "")
|
|
|
{
|
|
{
|
|
|
sql.Append(dr1[0]["lp_sql"].ToString() + ",");
|
|
sql.Append(dr1[0]["lp_sql"].ToString() + ",");
|
|
|
}
|
|
}
|
|
@@ -70,7 +74,7 @@ namespace UAS_LabelMachine.PublicMethod
|
|
|
for (int j = 0; j < MidDoc.Variables.FormVariables.Count; j++)
|
|
for (int j = 0; j < MidDoc.Variables.FormVariables.Count; j++)
|
|
|
{
|
|
{
|
|
|
DataRow[] dr1 = MidLabelParam.Select("lp_name='" + MidDoc.Variables.FormVariables.Item(j + 1).Name + "'");
|
|
DataRow[] dr1 = MidLabelParam.Select("lp_name='" + MidDoc.Variables.FormVariables.Item(j + 1).Name + "'");
|
|
|
- if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串")
|
|
|
|
|
|
|
+ if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串" && dr1[0]["lp_sql"].ToString() != "")
|
|
|
{
|
|
{
|
|
|
MidDoc.Variables.FormVariables.Item(j + 1).Value = dt.Rows[0][dr1[0]["lp_sql"].ToString()].ToString();
|
|
MidDoc.Variables.FormVariables.Item(j + 1).Value = dt.Rows[0][dr1[0]["lp_sql"].ToString()].ToString();
|
|
|
}
|
|
}
|
|
@@ -111,7 +115,7 @@ namespace UAS_LabelMachine.PublicMethod
|
|
|
for (int j = 0; j < OutBoxDoc.Variables.FormVariables.Count; j++)
|
|
for (int j = 0; j < OutBoxDoc.Variables.FormVariables.Count; j++)
|
|
|
{
|
|
{
|
|
|
DataRow[] dr1 = OutLabelParam.Select("lp_name='" + OutBoxDoc.Variables.FormVariables.Item(j + 1).Name + "'");
|
|
DataRow[] dr1 = OutLabelParam.Select("lp_name='" + OutBoxDoc.Variables.FormVariables.Item(j + 1).Name + "'");
|
|
|
- if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串")
|
|
|
|
|
|
|
+ if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串" && dr1[0]["lp_sql"].ToString() != "")
|
|
|
{
|
|
{
|
|
|
sql.Append(dr1[0]["lp_sql"].ToString() + ",");
|
|
sql.Append(dr1[0]["lp_sql"].ToString() + ",");
|
|
|
}
|
|
}
|
|
@@ -123,7 +127,7 @@ namespace UAS_LabelMachine.PublicMethod
|
|
|
for (int j = 0; j < OutBoxDoc.Variables.FormVariables.Count; j++)
|
|
for (int j = 0; j < OutBoxDoc.Variables.FormVariables.Count; j++)
|
|
|
{
|
|
{
|
|
|
DataRow[] dr1 = OutLabelParam.Select("lp_name='" + OutBoxDoc.Variables.FormVariables.Item(j + 1).Name + "'");
|
|
DataRow[] dr1 = OutLabelParam.Select("lp_name='" + OutBoxDoc.Variables.FormVariables.Item(j + 1).Name + "'");
|
|
|
- if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串")
|
|
|
|
|
|
|
+ if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串" && dr1[0]["lp_sql"].ToString() != "")
|
|
|
{
|
|
{
|
|
|
OutBoxDoc.Variables.FormVariables.Item(j + 1).Value = dt.Rows[0][dr1[0]["lp_sql"].ToString()].ToString();
|
|
OutBoxDoc.Variables.FormVariables.Item(j + 1).Value = dt.Rows[0][dr1[0]["lp_sql"].ToString()].ToString();
|
|
|
}
|
|
}
|
|
@@ -172,10 +176,9 @@ namespace UAS_LabelMachine.PublicMethod
|
|
|
for (int j = 0; j < SingleFormat.SubStrings.Count; j++)
|
|
for (int j = 0; j < SingleFormat.SubStrings.Count; j++)
|
|
|
{
|
|
{
|
|
|
DataRow[] dr1 = SingleLabelParam.Select("lp_name='" + SingleFormat.SubStrings[j].Name + "'");
|
|
DataRow[] dr1 = SingleLabelParam.Select("lp_name='" + SingleFormat.SubStrings[j].Name + "'");
|
|
|
- if (dr1.Length > 0)
|
|
|
|
|
|
|
+ if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串" && dr1[0]["lp_sql"].ToString() != "")
|
|
|
{
|
|
{
|
|
|
- if (dr1[0]["lp_valuetype"].ToString() == "字符串")
|
|
|
|
|
- sql.Append(dr1[0]["lp_sql"].ToString() + ",");
|
|
|
|
|
|
|
+ sql.Append(dr1[0]["lp_sql"].ToString() + ",");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
sql.Append("1,");
|
|
sql.Append("1,");
|
|
@@ -183,6 +186,10 @@ namespace UAS_LabelMachine.PublicMethod
|
|
|
for (int j = 0; j < SingleFormat.SubStrings.Count; j++)
|
|
for (int j = 0; j < SingleFormat.SubStrings.Count; j++)
|
|
|
{
|
|
{
|
|
|
DataRow[] dr1 = SingleLabelParam.Select("lp_name='" + SingleFormat.SubStrings[j].Name + "'");
|
|
DataRow[] dr1 = SingleLabelParam.Select("lp_name='" + SingleFormat.SubStrings[j].Name + "'");
|
|
|
|
|
+ if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串" && dr1[0]["lp_sql"].ToString() != "")
|
|
|
|
|
+ {
|
|
|
|
|
+ SingleFormat.SubStrings[j].Value = dt.Rows[0][dr1[0]["lp_sql"].ToString()].ToString();
|
|
|
|
|
+ }
|
|
|
if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "SQL值")
|
|
if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "SQL值")
|
|
|
{
|
|
{
|
|
|
DataTable dt1 = (DataTable)SystemInf.sdh.ExecuteSql(dr1[0]["lp_sql"].ToString().Replace("{1}", pib_id), "select");
|
|
DataTable dt1 = (DataTable)SystemInf.sdh.ExecuteSql(dr1[0]["lp_sql"].ToString().Replace("{1}", pib_id), "select");
|
|
@@ -212,7 +219,7 @@ namespace UAS_LabelMachine.PublicMethod
|
|
|
for (int j = 0; j < MidFormat.SubStrings.Count; j++)
|
|
for (int j = 0; j < MidFormat.SubStrings.Count; j++)
|
|
|
{
|
|
{
|
|
|
DataRow[] dr1 = MidLabelParam.Select("lp_name='" + MidFormat.SubStrings[j].Name + "'");
|
|
DataRow[] dr1 = MidLabelParam.Select("lp_name='" + MidFormat.SubStrings[j].Name + "'");
|
|
|
- if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串")
|
|
|
|
|
|
|
+ if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串" && dr1[0]["lp_sql"].ToString() != "")
|
|
|
{
|
|
{
|
|
|
sql.Append(dr1[0]["lp_sql"].ToString() + ",");
|
|
sql.Append(dr1[0]["lp_sql"].ToString() + ",");
|
|
|
}
|
|
}
|
|
@@ -222,7 +229,7 @@ namespace UAS_LabelMachine.PublicMethod
|
|
|
for (int j = 0; j < MidFormat.SubStrings.Count; j++)
|
|
for (int j = 0; j < MidFormat.SubStrings.Count; j++)
|
|
|
{
|
|
{
|
|
|
DataRow[] dr1 = MidLabelParam.Select("lp_name='" + MidFormat.SubStrings[j].Name + "'");
|
|
DataRow[] dr1 = MidLabelParam.Select("lp_name='" + MidFormat.SubStrings[j].Name + "'");
|
|
|
- if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串")
|
|
|
|
|
|
|
+ if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串" && dr1[0]["lp_sql"].ToString() != "")
|
|
|
{
|
|
{
|
|
|
MidFormat.SubStrings[j].Value = dt.Rows[0][dr1[0]["lp_sql"].ToString()].ToString();
|
|
MidFormat.SubStrings[j].Value = dt.Rows[0][dr1[0]["lp_sql"].ToString()].ToString();
|
|
|
}
|
|
}
|
|
@@ -263,7 +270,7 @@ namespace UAS_LabelMachine.PublicMethod
|
|
|
for (int j = 0; j < OutFormat.SubStrings.Count; j++)
|
|
for (int j = 0; j < OutFormat.SubStrings.Count; j++)
|
|
|
{
|
|
{
|
|
|
DataRow[] dr1 = OutLabelParam.Select("lp_name='" + OutFormat.SubStrings[j].Name + "'");
|
|
DataRow[] dr1 = OutLabelParam.Select("lp_name='" + OutFormat.SubStrings[j].Name + "'");
|
|
|
- if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串")
|
|
|
|
|
|
|
+ if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串" && dr1[0]["lp_sql"].ToString() != "")
|
|
|
{
|
|
{
|
|
|
sql.Append(dr1[0]["lp_sql"].ToString() + ",");
|
|
sql.Append(dr1[0]["lp_sql"].ToString() + ",");
|
|
|
}
|
|
}
|
|
@@ -275,7 +282,7 @@ namespace UAS_LabelMachine.PublicMethod
|
|
|
for (int j = 0; j < OutFormat.SubStrings.Count; j++)
|
|
for (int j = 0; j < OutFormat.SubStrings.Count; j++)
|
|
|
{
|
|
{
|
|
|
DataRow[] dr1 = OutLabelParam.Select("lp_name='" + OutFormat.SubStrings[j].Name + "'");
|
|
DataRow[] dr1 = OutLabelParam.Select("lp_name='" + OutFormat.SubStrings[j].Name + "'");
|
|
|
- if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串")
|
|
|
|
|
|
|
+ if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串" && dr1[0]["lp_sql"].ToString() != "")
|
|
|
{
|
|
{
|
|
|
OutFormat.SubStrings[j].Value = dt.Rows[0][dr1[0]["lp_sql"].ToString()].ToString();
|
|
OutFormat.SubStrings[j].Value = dt.Rows[0][dr1[0]["lp_sql"].ToString()].ToString();
|
|
|
}
|
|
}
|
|
@@ -305,9 +312,9 @@ namespace UAS_LabelMachine.PublicMethod
|
|
|
}
|
|
}
|
|
|
if (OutFormat.SubStrings[j].Value == "")
|
|
if (OutFormat.SubStrings[j].Value == "")
|
|
|
{
|
|
{
|
|
|
- //dr1 = UAS_出货标签打印.Attach.Select("lp_name='" + OutFormat.SubStrings[j].Name + "'");
|
|
|
|
|
- //if (dr1.Length > 0)
|
|
|
|
|
- // OutFormat.SubStrings[j].Value = dr1[0]["lp_sql"].ToString();
|
|
|
|
|
|
|
+ dr1 = UAS_出货标签打印.Attach.Select("lp_name='" + OutFormat.SubStrings[j].Name + "'");
|
|
|
|
|
+ if (dr1.Length > 0)
|
|
|
|
|
+ OutFormat.SubStrings[j].Value = dr1[0]["lp_sql"].ToString();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
OutFormat.Print();
|
|
OutFormat.Print();
|