|
|
@@ -70,7 +70,7 @@ namespace UAS_MES.Make
|
|
|
try
|
|
|
{
|
|
|
lbl = new ApplicationClass();
|
|
|
- BaseUtil.WriteLbl(lbl);
|
|
|
+ BaseUtil.WriteLbl();
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
@@ -145,7 +145,21 @@ namespace UAS_MES.Make
|
|
|
{
|
|
|
inputValues = new string[paramsInfo.Rows.Count];
|
|
|
sb = new StringBuilder();
|
|
|
- doc = lbl.Documents.Open(listA.Rows[PrintLabel.SelectedIndex]["la_url"].ToString());
|
|
|
+ string filelastwritetime = dh.getFieldDataByCondition("label", "la_lastwritetime", "la_id = '" + listA.Rows[PrintLabel.SelectedIndex]["la_id"].ToString() + "'").ToString();
|
|
|
+ FileInfo PrintFile = new FileInfo(listA.Rows[PrintLabel.SelectedIndex]["la_url"].ToString());
|
|
|
+ if (PrintFile == null)
|
|
|
+ {
|
|
|
+ MessageBox.Show("打印文件不存在");
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ if (PrintFile.LastWriteTime.ToString() != 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() + "'");
|
|
|
+ }
|
|
|
+ doc = lbl.Documents.Open(listA.Rows[PrintLabel.SelectedIndex]["la_url"].ToString(), true);
|
|
|
}
|
|
|
//将值赋到doc对应的变量
|
|
|
for (int i = 0; i < doc.Variables.FormVariables.Count; i++)
|
|
|
@@ -249,6 +263,20 @@ namespace UAS_MES.Make
|
|
|
{
|
|
|
if (canPrint)
|
|
|
{
|
|
|
+ string filelastwritetime = dh.getFieldDataByCondition("label", "la_lastwritetime", "la_id = '" + listA.Rows[PrintLabel.SelectedIndex]["la_id"].ToString() + "'").ToString();
|
|
|
+ FileInfo PrintFile = new FileInfo(listA.Rows[PrintLabel.SelectedIndex]["la_url"].ToString());
|
|
|
+ if (PrintFile == null)
|
|
|
+ {
|
|
|
+ MessageBox.Show("打印文件不存在");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (PrintFile.LastWriteTime.ToString() != filelastwritetime)
|
|
|
+ {
|
|
|
+ lbl.Quit();
|
|
|
+ lbl = new ApplicationClass();
|
|
|
+ BaseUtil.WriteLbl(lbl);
|
|
|
+ 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() + "'");
|
|
|
+ }
|
|
|
doc = lbl.Documents.Open(listA.Rows[PrintLabel.SelectedIndex]["la_url"].ToString());
|
|
|
sb = new StringBuilder();
|
|
|
//将值赋到doc对应的变量
|