فهرست منبع

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

章政 8 سال پیش
والد
کامیت
24d123e8c6
2فایلهای تغییر یافته به همراه12 افزوده شده و 4 حذف شده
  1. 9 1
      UAS-MES/FunctionCode/Query/Query_ExeProgress.cs
  2. 3 3
      UAS-MES/PublicMethod/LogicHandler.cs

+ 9 - 1
UAS-MES/FunctionCode/Query/Query_ExeProgress.cs

@@ -180,9 +180,17 @@ namespace UAS_MES.Query
                         Param.Text = j + " " + Step[j];
                         Param.Name = j + Step[j] + "_label";
                         Param.AutoSize = true;
+                        Param.Margin = new Padding(0,0,0,0);
                         Param.Anchor = AnchorStyles.Left;
                         Param.Anchor = AnchorStyles.Top;
-                        Param.Location = new Point(x + r.Width / 14 * RectangleCountEachRow, y + r.Height / 10 * 4);
+                        //获取param的宽度和高度
+                        Graphics graphics = Graphics.FromHwnd(Param.Handle);
+                        SizeF size = graphics.MeasureString(Param.Text,Param.Font);
+                        
+                        //设定param文本框的位置
+                        //Param.Location = new Point(x + r.Width / 14 * RectangleCountEachRow, y + r.Height / 10 * 4);
+                        Param.Location = new Point(x+(int)(r.Width-size.Width)/2,y+(int)(r.Height-size.Height)/2);
+                        graphics.Dispose();
                         //如果在奇数行
                         if (i % 2 != 0)
                         {

+ 3 - 3
UAS-MES/PublicMethod/LogicHandler.cs

@@ -458,9 +458,9 @@ namespace UAS_MES.PublicMethod
         {
             sql.Clear();
             sql.Append("insert into commandlog(cl_id,cl_man,cl_date,cl_linecode,cl_sourcecode,cl_makecode,cl_operate,");
-            sql.Append("cl_result,cl_sncode,cl_code) values(commandlog_seq.nextval,'"+iUserCode+"',sysdate,'"+ iLineCode + "',");
-            sql.Append("'"+ iSourceCode + "','"+iMakeCode+"','"+iOperate+"','"+iResult+"','"+iSncode+"','"+ iCheckno + "')");
-            dh.ExecuteSql(sql.ToString(), "insert");
+            sql.Append("cl_result,cl_sncode,cl_code) values(commandlog_seq.nextval,:iUserCode,sysdate,:iLineCode ,");
+            sql.Append(":iSourceCode ,:iMakeCode,:iOperate,:iResult,:iSncode,:iCheckno )");
+            dh.ExecuteSql(sql.ToString(), "insert", iUserCode, iMakeCode, iLineCode, iSourceCode, iOperate, iResult, iSncode, iCheckno);
         }
 
         /// <summary>