Преглед на файлове

Merge remote-tracking branch 'refs/remotes/origin/master'

章政 преди 8 години
родител
ревизия
d7014046f1
променени са 1 файла, в които са добавени 9 реда и са изтрити 6 реда
  1. 9 6
      UAS-MES/FunctionCode/SystemSetting/SystemSetting_LabelMaintain.cs

+ 9 - 6
UAS-MES/FunctionCode/SystemSetting/SystemSetting_LabelMaintain.cs

@@ -42,6 +42,8 @@ namespace UAS_MES.SystemSetting
         string pl_id1;
         //用于保存更新的模板ID
         string pl_id2 = "";
+        //用于保存更新的模板默认值
+        string pl_default = "";
         //Label表的主键,用于弹窗的传参
         string La_id1;
         //添加在grid末列的操作列
@@ -181,6 +183,7 @@ namespace UAS_MES.SystemSetting
                     la_type.Text = LabelDataGridView.Rows[e.RowIndex].Cells["pl_labeltype"].Value.ToString();
                     FolderPath.Text = ftpOperater.DownLoadTo;
                     pl_id2 = LabelDataGridView.Rows[e.RowIndex].Cells["pl_id"].Value.ToString();
+                    pl_default = LabelDataGridView.Rows[e.RowIndex].Cells["pl_isdefault"].Value.ToString();
                     System.Diagnostics.Process.Start(BaseUtil.GetLabelUrl(LabelPath, LabelName));
                 }
             }
@@ -414,16 +417,16 @@ namespace UAS_MES.SystemSetting
                     ftp.UpLoadFile(FolderPath.Text, la_name.Text);
                     if (pl_id2 != "")
                     {
-                        if (!isSameLabel(pr_code.Text, la_type.Text, la_name.Text))
+                        if (!isSameLabel(pr_code.Text, la_type.Text, la_name.Text)&&(((isdefault(pr_code.Text, la_type.Text)==1)&& (pl_default == "1"))|| (pl_default == "0")))
                         {
                             sql.Clear();
-                            sql.Append("update productlabel set pl_labelcode=:pl_labelcode,pl_labeltype=:pl_labeltype,pl_labelname=:pl_labelname,");
+                            sql.Append("update productlabel set pl_labelcode=:pl_labelcode,pl_labeltype=:pl_labeltype,pl_labelurl=:pl_labelurl,pl_labelname=:pl_labelname,");
                             sql.Append("pl_prodcode=:pl_prodcode,pl_indate=sysdate where pl_id='" + pl_id2 + "'");
-                            dh.ExecuteSql(sql.GetString(), "update", la_code.Text, la_type.Text, la_name.Text, pr_code.Text);
+                            dh.ExecuteSql(sql.GetString(), "update", la_code.Text, la_type.Text,ftpOperater.FTPAddress + la_name.Text,la_name.Text, pr_code.Text);
                         }
                         else
                         {
-                            MessageBox.Show("编号" + pr_code.Text + "商品已有相同标签");
+                            MessageBox.Show("编号" + pr_code.Text + "商品已有相同标签或已有默认值");
                             sql.Clear();
                             LoadData();
                             return;
@@ -431,7 +434,7 @@ namespace UAS_MES.SystemSetting
                     }
                     else
                     {
-                        if (!isSameLabel(pr_code.Text, la_type.Text, la_name.Text))
+                        if (!isSameLabel(pr_code.Text, la_type.Text, la_name.Text) && (isdefault(pr_code.Text, la_type.Text) == 1))
                         {
                             sql.Clear();
                             sql.Append("insert into productlabel (pl_id,pl_labelcode,pl_labeltype,pl_isdefault,pl_labelurl,pl_labelsoft,pl_labelname,pl_prodcode,pl_indate) values( productlabel_seq.nextval, ");
@@ -440,7 +443,7 @@ namespace UAS_MES.SystemSetting
                         }
                         else
                         {
-                            MessageBox.Show("编号" + pr_code.Text + "商品已有相同标签");
+                            MessageBox.Show("编号" + pr_code.Text + "商品已有相同标签或已有默认值");
                             sql.Clear();
                             LoadData();
                             return;