Browse Source

贴标角度按照机器设置

callm 4 years ago
parent
commit
49817b7e7a

+ 2 - 0
UAS-出货标签管理(泽天)/Entity/SystemInf.cs

@@ -10,5 +10,7 @@ namespace UAS_LabelMachine.Entity
         public static DataHelper dh;
 
         public static SqliteDBHelper sdh;
+
+        public static string Machine;
     }
 }

+ 2 - 0
UAS-出货标签管理(泽天)/Login.cs

@@ -34,6 +34,8 @@ namespace UAS_LabelMachine
         {
             dh = new DataHelper();
             SystemInf.dh = dh;
+            SystemInf.Machine = Environment.MachineName;
+          
             //获取账套信息
             dt = (DataTable)dh.ExecuteSql("select ma_function,ms_pwd,ma_user from master ", "select");
             DataTable MasterDB = dt.Clone();

+ 27 - 27
UAS-出货标签管理(泽天)/PublicMethod/DataHelper.cs

@@ -66,7 +66,7 @@ namespace UAS_LabelMachine
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
             ad.Dispose();
-            
+
             return dt;
         }
 
@@ -80,10 +80,10 @@ namespace UAS_LabelMachine
             if (dt.Rows.Count > 0)
             {
                 ad.Dispose();
-                
+
                 return dt.Rows[0][0];
             }
-            else {  return ""; }
+            else { return ""; }
         }
 
         /// <summary>
@@ -111,7 +111,7 @@ namespace UAS_LabelMachine
                 ad.Fill(dt);
             }
             ad.Dispose();
-            
+
             if (dt.Rows.Count > 0)
             {
                 return dt.Rows[0][0];
@@ -152,7 +152,7 @@ namespace UAS_LabelMachine
                 DataTable dt = new DataTable();
                 ad.Fill(dt);
                 ad.Dispose();
-                
+
                 return dt;
             }
             return "参数错误,请检查SQL语句";
@@ -170,7 +170,7 @@ namespace UAS_LabelMachine
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
             int count = int.Parse(dt.Rows[0][0].ToString());
-            
+
             return count;
         }
 
@@ -187,7 +187,7 @@ namespace UAS_LabelMachine
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
             int count = int.Parse(dt.Rows[0][0].ToString());
-            
+
             return count;
         }
 
@@ -203,7 +203,7 @@ namespace UAS_LabelMachine
             command = new OracleCommand(sql, connection);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
-            
+
             return dt;
         }
 
@@ -216,7 +216,7 @@ namespace UAS_LabelMachine
             command = new OracleCommand(sql, connection);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
-            
+
             return dt;
         }
 
@@ -277,7 +277,7 @@ namespace UAS_LabelMachine
                 dc.ColumnName = field[dt.Columns.IndexOf(dc)];
                 dc.Caption = caption[dt.Columns.IndexOf(dc)];
             }
-            
+
             return dt;
         }
 
@@ -293,7 +293,7 @@ namespace UAS_LabelMachine
             command = new OracleCommand(sql, connection);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
-            
+
             return dt;
         }
 
@@ -316,7 +316,7 @@ namespace UAS_LabelMachine
                 arr.Add(dc[Fields]);
             }
             ad.Dispose();
-            
+
             return (string[])arr.ToArray(typeof(string));
         }
 
@@ -339,7 +339,7 @@ namespace UAS_LabelMachine
                 arr.Add(dc[Fields]);
             }
             ad.Dispose();
-            
+
             return (string[])arr.ToArray(typeof(string));
         }
 
@@ -461,7 +461,7 @@ namespace UAS_LabelMachine
             }
             ad.UpdateCommand = command;
             ad.Update(DataTable);
-            
+
             ad.Dispose();
         }
 
@@ -662,7 +662,7 @@ namespace UAS_LabelMachine
                 dt1.Columns[i].Caption = caption[i];
             }
             //返回的第一条数据是SQL,后面的是实际的列名
-            
+
             return dt1;
         }
 
@@ -721,7 +721,7 @@ namespace UAS_LabelMachine
                 dt1.Columns[i].Caption = caption[i];
             }
             ad.Dispose();
-            
+
             return dt1;
         }
 
@@ -740,13 +740,13 @@ namespace UAS_LabelMachine
             ad.Fill(dt);
             if (int.Parse(dt.Rows[0][0].ToString()) > 0)
             {
-                
+
                 ad.Dispose();
                 return true;
             }
             else
             {
-                
+
                 ad.Dispose();
                 return false;
             }
@@ -862,12 +862,12 @@ namespace UAS_LabelMachine
                 SQL = SQL.Replace("?", ":Param");
                 command = new OracleCommand(SQL, connection);
                 command.ExecuteNonQuery();
-                
+
                 return true;
             }
             catch (Exception e)
             {
-                
+
                 ErrorMessage = e.Message;
                 return false;
             }
@@ -881,7 +881,7 @@ namespace UAS_LabelMachine
             string sql = "select distinct count('" + Field + "') from " + TableName;
             OracleDataAdapter ad = new OracleDataAdapter(new OracleCommand(sql, connection));
             ad.Fill(dt);
-            
+
             return int.Parse(dt.Rows[0][0].ToString());
         }
 
@@ -910,7 +910,7 @@ namespace UAS_LabelMachine
             command.ArrayBindCount = DeleteID.Length;
             command.Parameters.Add(new OracleParameter("DeleteID", OracleDbType.Long, DeleteID, ParameterDirection.Input));
             command.ExecuteNonQuery();
-            
+
         }
 
         /// <summary>
@@ -959,7 +959,7 @@ namespace UAS_LabelMachine
                 command.Parameters.Add(new OracleParameter(names[0][i - 1].ToString(), OracleDbType.Varchar2, names[i], ParameterDirection.Input));
             }
             int rowsnum = (command.ExecuteNonQuery());
-            
+
             return rowsnum;
         }
 
@@ -974,7 +974,7 @@ namespace UAS_LabelMachine
                 command.Parameters.Add(new OracleParameter(param[i].ToString(), OracleDbType.Varchar2, param1[i], ParameterDirection.Input));
             }
             command.ExecuteNonQuery();
-            
+
         }
 
 
@@ -991,7 +991,7 @@ namespace UAS_LabelMachine
             command = new OracleCommand(SQL, connection);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
-            
+
             return dt.Rows[0][0].ToString();
         }
 
@@ -1090,7 +1090,7 @@ namespace UAS_LabelMachine
             }
             for (int i = 0; i < command.Parameters.Count; i++)
                 param[i] = command.Parameters[i].Value.ToString();
-            
+
         }
 
         /// <summary>
@@ -1118,7 +1118,7 @@ namespace UAS_LabelMachine
             }
             for (int i = 0; i < command.Parameters.Count; i++)
                 param[i] = command.Parameters[i].Value.ToString();
-            
+
         }
 
         /// <summary>

+ 47 - 14
UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

@@ -291,7 +291,8 @@ namespace UAS_LabelMachine
                 {
                     richTextAutoBottom1.AppendText("当前采集【物料编号" + Data["PRCODE"] + "】不对应,请重新采集\n");
                     Input.SelectAll();
-                    receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
+                    if (ConnectToMachine)
+                        receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
                     return;
                 }
                 else
@@ -313,7 +314,8 @@ namespace UAS_LabelMachine
                     {
                         richTextAutoBottom1.AppendText("当前采集【物料编号" + Data["PRCODE"] + "】没有需要采集的内容\n");
                         Input.SelectAll();
-                        receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
+                        if (ConnectToMachine)
+                            receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
                         return;
                     }
                 }
@@ -323,14 +325,16 @@ namespace UAS_LabelMachine
             {
                 richTextAutoBottom1.AppendText("物料" + Data["PRCODE"] + "【DateCode】超出校验日期\n");
                 Input.SelectAll();
-                receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
+                if (ConnectToMachine)
+                    receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
                 return;
             }
             if (Data["BRAND"] != CurrentBrand)
             {
                 richTextAutoBottom1.AppendText("当前采集【品牌" + Data["BRAND"] + "】不对应\n");
                 Input.SelectAll();
-                receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
+                if (ConnectToMachine)
+                    receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
                 return;
             }
             int CodeCount = 0;
@@ -351,7 +355,8 @@ namespace UAS_LabelMachine
                 {
                     richTextAutoBottom1.AppendText("物料" + Data["PRCODE"] + "采集数量无法按照最小包装数拆分\n");
                     Input.SelectAll();
-                    receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
+                    if (ConnectToMachine)
+                        receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
                     return;
                 }
                 CodeCount = int.Parse((double.Parse(Data["QTY"]) / 1000 / double.Parse(CurrentZXBZ)).ToString());
@@ -362,7 +367,8 @@ namespace UAS_LabelMachine
                 if (double.Parse(Data["QTY"]) % double.Parse(CurrentZXBZ) != 0)
                 {
                     richTextAutoBottom1.AppendText("采集【数量】无法按照最小包装数拆分\n");
-                    receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
+                    if (ConnectToMachine)
+                        receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
                     Input.SelectAll();
                     return;
                 }
@@ -458,7 +464,8 @@ namespace UAS_LabelMachine
             if (Convert.ToDouble((CollectQty + CollectNum).ToString("0.000")) > Convert.ToDouble(double.Parse(CurrentPrCount).ToString("0.000")))
             {
                 richTextAutoBottom1.AppendText("物料" + Data["PRCODE"] + "采集后数量为" + (CollectQty + CollectNum) + ",【超出】本行出货数量" + CurrentPrCount + "\n");
-                receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
+                if (ConnectToMachine)
+                    receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|NG|,|Y")));
                 Input.SelectAll();
                 return;
             }
@@ -527,11 +534,13 @@ namespace UAS_LabelMachine
                 stw = new SetLoadingWindow(thread, "正在打印单盘标签");
                 BaseUtil.SetFormCenter(stw);
                 stw.ShowDialog();
-                receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|OK|,|Y")));
+                if (ConnectToMachine)
+                    receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|OK|,|Y")));
             }
             else
             {
-                receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|OK|,|N")));
+                if (ConnectToMachine)
+                    receiveClient.Client.Send(Encoding.ASCII.GetBytes(GetSendCode("ReadId1|,|OK|,|N")));
             }
             if (SumQty.Columns.Count == 0)
             {
@@ -584,6 +593,7 @@ namespace UAS_LabelMachine
                     }
                 }
             }
+            GridPrcode.Refresh();
             Input.Clear();
             //if (OutBoxNum.Text == "新增")
             //{
@@ -766,7 +776,11 @@ namespace UAS_LabelMachine
                     {
                         CustomerLabel.Enabled = true;
                     }
-                    DataTable XY = (DataTable)dh.ExecuteSql("select * from PRINTXY where px_custcode='" + pi_cardcode.Text + "'", "select");
+                    DataTable XY = (DataTable)dh.ExecuteSql("select * from PRINTXY where px_custcode='" + pi_cardcode.Text + "' and px_machine='" + SystemInf.Machine + "'", "select");
+                    if (XY.Rows.Count == 0)
+                    {
+                        XY = (DataTable)dh.ExecuteSql("select * from PRINTXY where px_custcode='" + pi_cardcode.Text + "'", "select");
+                    }
                     if (XY.Rows.Count > 0)
                     {
                         Angle = XY.Rows[0]["px_angle"].ToString();
@@ -2470,7 +2484,11 @@ namespace UAS_LabelMachine
 
         private void Ms1_FormClosed(object sender, FormClosedEventArgs e)
         {
-            DataTable XY = (DataTable)dh.ExecuteSql("select * from PRINTXY where px_custcode='" + pi_cardcode.Text + "'", "select");
+            DataTable XY = (DataTable)dh.ExecuteSql("select * from PRINTXY where px_custcode='" + pi_cardcode.Text + "' and px_machine='" + SystemInf.Machine + "'", "select");
+            if (XY.Rows.Count == 0)
+            {
+                XY = (DataTable)dh.ExecuteSql("select * from PRINTXY where px_custcode='" + pi_cardcode.Text + "'", "select");
+            }
             if (XY.Rows.Count > 0)
             {
                 Angle = XY.Rows[0]["px_angle"].ToString();
@@ -2616,7 +2634,7 @@ namespace UAS_LabelMachine
                     bool OutBoxSplit = false;
                     if (PassSixTenCount > OutboxCapacity.Value)
                     {
-                        string close = MessageBox.Show(this.ParentForm, "此箱号采集后超数量,是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                        string close = MessageBox.Show(this.ParentForm, "此箱号采集后超数量,是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly).ToString();
                         if (close == "Yes")
                         {
                             OutBoxSplit = true;
@@ -2659,7 +2677,14 @@ namespace UAS_LabelMachine
                             if (SendLast)
                             {
                                 sendClient.Client.Send(Encoding.ASCII.GetBytes("ReadId3|,|OK|,|1"));
-                                MessageBox.Show("采集完此行数据,是否继续?", "提示");
+                                string close = MessageBox.Show("采集完此行数据,是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly).ToString();
+                                if (close == "Yes")
+                                {
+                                }
+                                else
+                                {
+
+                                }
                             }
                             else
                             {
@@ -2694,7 +2719,15 @@ namespace UAS_LabelMachine
                                     checknum = 0;
                                     SendLast = true;
                                     PassTenCount = 0;
-                                    MessageBox.Show("采集完此行数据,是否继续?", "提示");
+                                    string close = MessageBox.Show("采集完此行数据,是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly).ToString();
+                                    if (close == "Yes")
+                                    {
+
+                                    }
+                                    else
+                                    {
+
+                                    }
                                 }
                                 break;
                             }

+ 66 - 26
UAS-出货标签管理(泽天)/贴标角度设置.Designer.cs

@@ -40,13 +40,16 @@
             this.Left = new System.Windows.Forms.RadioButton();
             this.Right = new System.Windows.Forms.RadioButton();
             this.Cover = new System.Windows.Forms.RadioButton();
+            this.Machine = new System.Windows.Forms.TextBox();
+            this.label1 = new System.Windows.Forms.Label();
             this.SuspendLayout();
             // 
             // angle
             // 
-            this.angle.Location = new System.Drawing.Point(148, 126);
+            this.angle.Location = new System.Drawing.Point(296, 321);
+            this.angle.Margin = new System.Windows.Forms.Padding(6);
             this.angle.Name = "angle";
-            this.angle.Size = new System.Drawing.Size(89, 21);
+            this.angle.Size = new System.Drawing.Size(174, 35);
             this.angle.TabIndex = 0;
             // 
             // lap_param1_label
@@ -54,17 +57,19 @@
             this.lap_param1_label.AutoSize = true;
             this.lap_param1_label.BackColor = System.Drawing.Color.Transparent;
             this.lap_param1_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.lap_param1_label.Location = new System.Drawing.Point(100, 126);
+            this.lap_param1_label.Location = new System.Drawing.Point(200, 321);
+            this.lap_param1_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.lap_param1_label.Name = "lap_param1_label";
-            this.lap_param1_label.Size = new System.Drawing.Size(42, 21);
+            this.lap_param1_label.Size = new System.Drawing.Size(82, 41);
             this.lap_param1_label.TabIndex = 61;
             this.lap_param1_label.Text = "角度";
             // 
             // Y
             // 
-            this.Y.Location = new System.Drawing.Point(148, 230);
+            this.Y.Location = new System.Drawing.Point(296, 529);
+            this.Y.Margin = new System.Windows.Forms.Padding(6);
             this.Y.Name = "Y";
-            this.Y.Size = new System.Drawing.Size(89, 21);
+            this.Y.Size = new System.Drawing.Size(174, 35);
             this.Y.TabIndex = 4;
             // 
             // lap_param3_labe
@@ -72,17 +77,19 @@
             this.lap_param3_labe.AutoSize = true;
             this.lap_param3_labe.BackColor = System.Drawing.Color.Transparent;
             this.lap_param3_labe.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.lap_param3_labe.Location = new System.Drawing.Point(101, 228);
+            this.lap_param3_labe.Location = new System.Drawing.Point(202, 525);
+            this.lap_param3_labe.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.lap_param3_labe.Name = "lap_param3_labe";
-            this.lap_param3_labe.Size = new System.Drawing.Size(20, 21);
+            this.lap_param3_labe.Size = new System.Drawing.Size(37, 41);
             this.lap_param3_labe.TabIndex = 65;
             this.lap_param3_labe.Text = "Y";
             // 
             // X
             // 
-            this.X.Location = new System.Drawing.Point(148, 180);
+            this.X.Location = new System.Drawing.Point(296, 429);
+            this.X.Margin = new System.Windows.Forms.Padding(6);
             this.X.Name = "X";
-            this.X.Size = new System.Drawing.Size(89, 21);
+            this.X.Size = new System.Drawing.Size(174, 35);
             this.X.TabIndex = 2;
             // 
             // lap_param2_label
@@ -90,17 +97,19 @@
             this.lap_param2_label.AutoSize = true;
             this.lap_param2_label.BackColor = System.Drawing.Color.Transparent;
             this.lap_param2_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.lap_param2_label.Location = new System.Drawing.Point(101, 178);
+            this.lap_param2_label.Location = new System.Drawing.Point(202, 425);
+            this.lap_param2_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.lap_param2_label.Name = "lap_param2_label";
-            this.lap_param2_label.Size = new System.Drawing.Size(20, 21);
+            this.lap_param2_label.Size = new System.Drawing.Size(39, 41);
             this.lap_param2_label.TabIndex = 69;
             this.lap_param2_label.Text = "X";
             // 
             // Confirm
             // 
-            this.Confirm.Location = new System.Drawing.Point(148, 308);
+            this.Confirm.Location = new System.Drawing.Point(296, 616);
+            this.Confirm.Margin = new System.Windows.Forms.Padding(6);
             this.Confirm.Name = "Confirm";
-            this.Confirm.Size = new System.Drawing.Size(75, 23);
+            this.Confirm.Size = new System.Drawing.Size(150, 46);
             this.Confirm.TabIndex = 81;
             this.Confirm.Text = "确认";
             this.Confirm.UseVisualStyleBackColor = true;
@@ -109,9 +118,10 @@
             // Bottom
             // 
             this.Bottom.AutoSize = true;
-            this.Bottom.Location = new System.Drawing.Point(72, 16);
+            this.Bottom.Location = new System.Drawing.Point(144, 32);
+            this.Bottom.Margin = new System.Windows.Forms.Padding(6);
             this.Bottom.Name = "Bottom";
-            this.Bottom.Size = new System.Drawing.Size(47, 16);
+            this.Bottom.Size = new System.Drawing.Size(89, 28);
             this.Bottom.TabIndex = 82;
             this.Bottom.TabStop = true;
             this.Bottom.Text = "下标";
@@ -121,9 +131,10 @@
             // Top
             // 
             this.Top.AutoSize = true;
-            this.Top.Location = new System.Drawing.Point(72, 51);
+            this.Top.Location = new System.Drawing.Point(144, 102);
+            this.Top.Margin = new System.Windows.Forms.Padding(6);
             this.Top.Name = "Top";
-            this.Top.Size = new System.Drawing.Size(59, 16);
+            this.Top.Size = new System.Drawing.Size(113, 28);
             this.Top.TabIndex = 83;
             this.Top.TabStop = true;
             this.Top.Text = "贴上标";
@@ -133,9 +144,10 @@
             // Left
             // 
             this.Left.AutoSize = true;
-            this.Left.Location = new System.Drawing.Point(198, 17);
+            this.Left.Location = new System.Drawing.Point(396, 34);
+            this.Left.Margin = new System.Windows.Forms.Padding(6);
             this.Left.Name = "Left";
-            this.Left.Size = new System.Drawing.Size(47, 16);
+            this.Left.Size = new System.Drawing.Size(89, 28);
             this.Left.TabIndex = 84;
             this.Left.TabStop = true;
             this.Left.Text = "左标";
@@ -145,9 +157,10 @@
             // Right
             // 
             this.Right.AutoSize = true;
-            this.Right.Location = new System.Drawing.Point(198, 52);
+            this.Right.Location = new System.Drawing.Point(396, 104);
+            this.Right.Margin = new System.Windows.Forms.Padding(6);
             this.Right.Name = "Right";
-            this.Right.Size = new System.Drawing.Size(47, 16);
+            this.Right.Size = new System.Drawing.Size(89, 28);
             this.Right.TabIndex = 85;
             this.Right.TabStop = true;
             this.Right.Text = "右标";
@@ -157,20 +170,44 @@
             // Cover
             // 
             this.Cover.AutoSize = true;
-            this.Cover.Location = new System.Drawing.Point(72, 85);
+            this.Cover.Location = new System.Drawing.Point(144, 170);
+            this.Cover.Margin = new System.Windows.Forms.Padding(6);
             this.Cover.Name = "Cover";
-            this.Cover.Size = new System.Drawing.Size(59, 16);
+            this.Cover.Size = new System.Drawing.Size(113, 28);
             this.Cover.TabIndex = 86;
             this.Cover.TabStop = true;
             this.Cover.Text = "盖上标";
             this.Cover.UseVisualStyleBackColor = true;
             this.Cover.CheckedChanged += new System.EventHandler(this.Button_CheckedChanged);
             // 
+            // Machine
+            // 
+            this.Machine.Enabled = false;
+            this.Machine.Location = new System.Drawing.Point(296, 229);
+            this.Machine.Margin = new System.Windows.Forms.Padding(6);
+            this.Machine.Name = "Machine";
+            this.Machine.Size = new System.Drawing.Size(174, 35);
+            this.Machine.TabIndex = 87;
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.BackColor = System.Drawing.Color.Transparent;
+            this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label1.Location = new System.Drawing.Point(136, 223);
+            this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(146, 41);
+            this.label1.TabIndex = 88;
+            this.label1.Text = "机器编号";
+            // 
             // 贴标角度设置
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(364, 359);
+            this.ClientSize = new System.Drawing.Size(728, 718);
+            this.Controls.Add(this.Machine);
+            this.Controls.Add(this.label1);
             this.Controls.Add(this.Cover);
             this.Controls.Add(this.Right);
             this.Controls.Add(this.Left);
@@ -183,6 +220,7 @@
             this.Controls.Add(this.lap_param3_labe);
             this.Controls.Add(this.angle);
             this.Controls.Add(this.lap_param1_label);
+            this.Margin = new System.Windows.Forms.Padding(6);
             this.Name = "贴标角度设置";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "附加内容打印";
@@ -206,5 +244,7 @@
         private System.Windows.Forms.RadioButton Left;
         private System.Windows.Forms.RadioButton Right;
         private System.Windows.Forms.RadioButton Cover;
+        private System.Windows.Forms.TextBox Machine;
+        private System.Windows.Forms.Label label1;
     }
 }

+ 9 - 4
UAS-出货标签管理(泽天)/贴标角度设置.cs

@@ -26,7 +26,12 @@ namespace UAS_LabelMachine
         bool IninLoad = true;
         private void 附件内容打印_Load(object sender, EventArgs e)
         {
-            DataTable dt = (DataTable)dh.ExecuteSql("select *  from PRINTXY where px_custcode='" + custcode + "' ", "select");
+            Machine.Text = SystemInf.Machine;
+            DataTable dt = (DataTable)dh.ExecuteSql("select *  from PRINTXY where px_custcode='" + custcode + "' and px_machine='" + SystemInf.Machine + "'", "select");
+            if (dt.Rows.Count == 0)
+            {
+                dt = (DataTable)dh.ExecuteSql("select *  from PRINTXY where px_custcode='" + custcode + "'", "select");
+            }
             if (dt.Rows.Count > 0)
             {
                 X.Text = dt.Rows[0]["px_x"].ToString();
@@ -86,13 +91,13 @@ namespace UAS_LabelMachine
                 MessageBox.Show("参数必须都填写");
                 return;
             }
-            if (dh.CheckExist("PRINTXY", "px_custcode='" + custcode + "'"))
+            if (dh.CheckExist("PRINTXY", "px_custcode='" + custcode + "' and px_machine='" + SystemInf.Machine + "'"))
             {
-                dh.ExecuteSql("update PRINTXY set px_x='" + X.Text + "',px_y='" + Y.Text + "',px_angle='" + angle.Text + "',px_type='" + Type + "' where px_custcode='" + custcode + "'", "update");
+                dh.ExecuteSql("update PRINTXY set px_x='" + X.Text + "',px_y='" + Y.Text + "',px_angle='" + angle.Text + "',px_type='" + Type + "',px_machine='" + Machine.Text + "' where px_custcode='" + custcode + "' and px_machine='" + Machine.Text + "'", "update");
             }
             else
             {
-                dh.ExecuteSql("insert into PRINTXY (px_x,px_y,px_angle,px_custcode,px_type)values('" + X.Text + "','" + Y.Text + "','" + angle.Text + "','" + custcode + "','" + Type + "')", "insert");
+                dh.ExecuteSql("insert into PRINTXY (px_x,px_y,px_angle,px_custcode,px_type,px_machine)values('" + X.Text + "','" + Y.Text + "','" + angle.Text + "','" + custcode + "','" + Type + "','" + Machine.Text + "')", "insert");
             }
             LogManager.DoCommandLog(custcode, User.UserCode, "保持贴标角度成功", "成功");
             MessageBox.Show("保存成功");