|
|
@@ -87,7 +87,7 @@ namespace UAS_MES.Make
|
|
|
//查询没有值,返回提示用户“产品:XXX,不存在或者为审核”,清空产品代码输入框中的值
|
|
|
if (dt.Rows.Count == 0)
|
|
|
{
|
|
|
- OperateResult.AppendText("<<产品:" + pr_code.Text + ",不存在或者未审核\n", Color.Red,pr_code);
|
|
|
+ OperateResult.AppendText("<<产品:" + pr_code.Text + ",不存在或者未审核\n", Color.Red, pr_code);
|
|
|
return;
|
|
|
}
|
|
|
//查询产品是否有自定义的标签模板
|
|
|
@@ -97,7 +97,8 @@ namespace UAS_MES.Make
|
|
|
OperateResult.AppendText("<<产品:" + pr_code.Text + ",没有维护自定义模板\n", Color.Red, pr_code);
|
|
|
return;
|
|
|
}
|
|
|
- if (listA.Rows[0]["la_isdefault"].ToString() != "-1") {
|
|
|
+ if (listA.Rows[0]["la_isdefault"].ToString() != "-1")
|
|
|
+ {
|
|
|
//说明没有默认的模板,那就取pl_id最大的
|
|
|
listA = (DataTable)dh.ExecuteSql("select la_code,la_id,substr(la_url,instr(la_url,'\\',-1)+1)la_name,la_url,la_isdefault from label where la_prodcode='" + pr_code.Text + "' and la_templatetype='自定义' and la_statuscode='AUDITED' order by la_isdefault", "select");
|
|
|
}
|
|
|
@@ -129,16 +130,17 @@ namespace UAS_MES.Make
|
|
|
OperateResult.AppendText("<<输入不能为空\n", Color.Red);
|
|
|
return;
|
|
|
}
|
|
|
- OperateResult.AppendText(">>"+inputText.Text+"\n", Color.Black);
|
|
|
+ OperateResult.AppendText(">>" + inputText.Text + "\n", Color.Black);
|
|
|
if (paramsInfo == null || paramsInfo.Rows.Count == 0)
|
|
|
{
|
|
|
- OperateResult.AppendText("<<无可用标签\n", Color.Red,inputText);
|
|
|
+ OperateResult.AppendText("<<无可用标签\n", Color.Red, inputText);
|
|
|
return;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
//下标为1的时候实例化存值的数组
|
|
|
- if (currentIndex==1) {
|
|
|
+ if (currentIndex == 1)
|
|
|
+ {
|
|
|
inputValues = new string[paramsInfo.Rows.Count];
|
|
|
sb = new StringBuilder();
|
|
|
doc = lbl.Documents.Open(ftpOperater.DownLoadTo + listA.Rows[PrintLabel.SelectedIndex]["la_name"].ToString());
|
|
|
@@ -167,7 +169,7 @@ namespace UAS_MES.Make
|
|
|
}
|
|
|
if (currentIndex == paramsInfo.Rows.Count)
|
|
|
{
|
|
|
- OperateResult.AppendText("<<输入完成,正在打印\n", Color.Black,inputText);
|
|
|
+ OperateResult.AppendText("<<输入完成,正在打印\n", Color.Black, inputText);
|
|
|
canPrint = true;
|
|
|
//打印
|
|
|
LogManager.DoLog(sb.ToString());
|
|
|
@@ -189,7 +191,7 @@ namespace UAS_MES.Make
|
|
|
{
|
|
|
canPrint = false;
|
|
|
currentIndex++;
|
|
|
- OperateResult.AppendText("<<请输入自定义模板的" + paramsInfo.Rows[currentIndex - 1]["lp_name"].ToString() + "\n", Color.Green,inputText);
|
|
|
+ OperateResult.AppendText("<<请输入自定义模板的" + paramsInfo.Rows[currentIndex - 1]["lp_name"].ToString() + "\n", Color.Green, inputText);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -206,7 +208,8 @@ namespace UAS_MES.Make
|
|
|
|
|
|
private void PrintLabel_TextChanged(object sender, EventArgs e)
|
|
|
{
|
|
|
- if (PrintLabel.Text.StartsWith("System")) {
|
|
|
+ if (PrintLabel.Text.StartsWith("System"))
|
|
|
+ {
|
|
|
return;
|
|
|
}
|
|
|
paramsInfo = (DataTable)dh.ExecuteSql("select lp_detno, lp_name, lp_valuetype,lp_sql from label left join labelparameter on lp_laid=la_id where la_code='" + listA.Rows[PrintLabel.SelectedIndex]["la_code"].ToString() + "' order by lp_detno asc", "select");
|
|
|
@@ -217,8 +220,6 @@ namespace UAS_MES.Make
|
|
|
OperateResult.AppendText("<<" + listA.Rows[PrintLabel.SelectedIndex]["la_code"].ToString() + "\n", Color.Black);
|
|
|
OperateResult.AppendText(">>请输入自定义模板" + paramsInfo.Rows[0]["lp_name"].ToString() + "的值\n", Color.Green);
|
|
|
//打开模板路径
|
|
|
- //doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.SelectedText.Split(':')[1]);
|
|
|
- //doc = lbl.Documents.Open(ftpOperater.DownLoadTo + listA.Rows[PrintLabel.SelectedIndex]["pl_labelname"].ToString());
|
|
|
currentIndex = 1;
|
|
|
//聚焦输入框
|
|
|
inputText.Focus();
|