|
|
@@ -150,14 +150,17 @@ namespace UAS_MES.Make
|
|
|
if (PrintFile == null)
|
|
|
{
|
|
|
MessageBox.Show("打印文件不存在");
|
|
|
- return ;
|
|
|
+ return;
|
|
|
}
|
|
|
- if (PrintFile.LastWriteTime.ToString() != filelastwritetime)
|
|
|
+ string filechangetime = PrintFile.LastWriteTime.ToString();
|
|
|
+ if (filechangetime != filelastwritetime)
|
|
|
{
|
|
|
lbl.Quit();
|
|
|
lbl = new ApplicationClass();
|
|
|
BaseUtil.WriteLbl();
|
|
|
- dh.UpdateByCondition("label", "la_lastwritetime = to_date('" + PrintFile.LastWriteTime.ToString() + "', 'yyyy-mm-dd hh24:mi:ss') ", "la_id = '" + listA.Rows[PrintLabel.SelectedIndex]["la_id"].ToString() + "'");
|
|
|
+ filechangetime = PrintFile.LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
+ string update = "la_lastwritetime = to_date((regexp_substr('" + filechangetime + "','\\d+.+\\d+')),'yyyy-mm-dd hh24:mi:ss')";
|
|
|
+ dh.UpdateByCondition("label", update, "la_id = '" + listA.Rows[PrintLabel.SelectedIndex]["la_id"].ToString() + "'");
|
|
|
}
|
|
|
doc = lbl.Documents.Open(listA.Rows[PrintLabel.SelectedIndex]["la_url"].ToString(), true);
|
|
|
}
|
|
|
@@ -270,14 +273,17 @@ namespace UAS_MES.Make
|
|
|
MessageBox.Show("打印文件不存在");
|
|
|
return;
|
|
|
}
|
|
|
- if (PrintFile.LastWriteTime.ToString() != filelastwritetime)
|
|
|
+ string filechangetime = PrintFile.LastWriteTime.ToString();
|
|
|
+ if (filechangetime != filelastwritetime)
|
|
|
{
|
|
|
lbl.Quit();
|
|
|
lbl = new ApplicationClass();
|
|
|
BaseUtil.WriteLbl();
|
|
|
- dh.UpdateByCondition("label", "la_lastwritetime = to_date('" + PrintFile.LastWriteTime.ToString() + "', 'yyyy-mm-dd hh24:mi:ss') ", "la_id = '" + listA.Rows[PrintLabel.SelectedIndex]["la_id"].ToString() + "'");
|
|
|
+ filechangetime = PrintFile.LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
+ string update = "la_lastwritetime = to_date((regexp_substr('" + filechangetime + "','\\d+.+\\d+')),'yyyy-mm-dd hh24:mi:ss')";
|
|
|
+ dh.UpdateByCondition("label", update, "la_id = '" + listA.Rows[PrintLabel.SelectedIndex]["la_id"].ToString() + "'");
|
|
|
}
|
|
|
- doc = lbl.Documents.Open(listA.Rows[PrintLabel.SelectedIndex]["la_url"].ToString());
|
|
|
+ doc = lbl.Documents.Open(listA.Rows[PrintLabel.SelectedIndex]["la_url"].ToString(),true);
|
|
|
sb = new StringBuilder();
|
|
|
//将值赋到doc对应的变量
|
|
|
for (int i = 0; i < doc.Variables.FormVariables.Count; i++)
|