章政 7 years ago
parent
commit
f4cca81d93
1 changed files with 12 additions and 3 deletions
  1. 12 3
      UAS-出货标签管理(泽天)/客户标签维护.cs

+ 12 - 3
UAS-出货标签管理(泽天)/客户标签维护.cs

@@ -332,9 +332,18 @@ namespace UAS_LabelMachine
                         //将文件复制到指定位置
                         File.Copy(sourceFile, destFile, true);
                         string SoftWare = "FastReport";
-                        sql.Clear();
-                        sql.Append("insert into customerlabel (cl_id,cl_labelcode,cl_custcode,cl_labeltype,cl_labelurl,cl_labelname,cl_labelsoft,cl_date) values( customerlabel_seq.nextval, ");
-                        sql.Append("'" + la_code.Text + "','" + (客户编号.Text == "" ? "共用" : 客户编号.Text) + "','" + la_type1.Text + "','" + destFile + "','" + la_name.Text + "','" + SoftWare + "',sysdate)");
+                        if (CL_ID2 != null)
+                        {
+                            sql.Clear();
+                            sql.Append("update customerlabel set cl_labelcode='" + la_code.Text + "',cl_custcode='" + 客户编号.Text + "',");
+                            sql.Append("cl_labeltype='" + la_type1.Text + "',cl_labelname='" + la_name.Text + "',cl_date=sysdate where cl_id=" + CL_ID2);
+                        }
+                        else
+                        {
+                            sql.Clear();
+                            sql.Append("insert into customerlabel (cl_id,cl_labelcode,cl_custcode,cl_labeltype,cl_labelurl,cl_labelname,cl_labelsoft,cl_date) values( customerlabel_seq.nextval, ");
+                            sql.Append("'" + la_code.Text + "','" + (客户编号.Text == "" ? "" : 客户编号.Text) + "','" + la_type1.Text + "','" + ftpOperater.FTPAddress + "','" + la_name.Text + "','" + SoftWare + "',sysdate)");
+                        }
                         dh.ExecuteSql(sql.ToString(), "insert");
                         sql.Clear();
                     }