Bladeren bron

通过Caller来获取导航是否设置了自动打印

章政 7 jaren geleden
bovenliggende
commit
cbd3d0a7f4

+ 12 - 5
UAS-MES/CustomControl/CustomCheckBox/AutoPrintCheckBox.cs

@@ -7,12 +7,15 @@ using System.Linq;
 using System.Text;
 using System.Windows.Forms;
 using UAS_MES.Entity;
+using UAS_MES.DataOperate;
 
 namespace UAS_MES.CustomControl.CustomCheckBox
 {
     public partial class AutoPrintCheckBox : UserControl
     {
-         
+
+        DataHelper dh;
+
         public AutoPrintCheckBox()
         {
             InitializeComponent();
@@ -21,10 +24,14 @@ namespace UAS_MES.CustomControl.CustomCheckBox
 
         private void AutoPrintCheckBox_Load(object sender, EventArgs e)
         {
-            if (SystemInf.EnablePrint)
-                AutoPrint.Checked = true;
-            else
-                AutoPrint.Checked = false;
+            dh = SystemInf.dh;
+            if (FindForm().Tag != null)
+            {
+                if (dh.getFieldDataByCondition("CS$SYSNAVATION", "nvl(sn_defaultprint,0)", "sn_caller='" + FindForm().Tag.ToString() + "'").ToString() != "0")
+                    AutoPrint.Checked = true;
+                else
+                    AutoPrint.Checked = false;
+            }
         }
 
         public bool Checked

+ 22 - 12
UAS-MES/FunctionCode/SystemSetting/SystemSetting_SysNav.Designer.cs

@@ -36,6 +36,7 @@
             this.sn_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.sn_detno = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.sn_using = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.sn_defaultprint = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.SysNavDGV)).BeginInit();
             this.SuspendLayout();
             // 
@@ -47,13 +48,13 @@
             this.Save.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Save.Image = ((System.Drawing.Image)(resources.GetObject("Save.Image")));
             this.Save.IsShowBorder = true;
-            this.Save.Location = new System.Drawing.Point(581, 562);
-            this.Save.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.Save.Location = new System.Drawing.Point(436, 450);
+            this.Save.Margin = new System.Windows.Forms.Padding(2);
             this.Save.MoveImage = ((System.Drawing.Image)(resources.GetObject("Save.MoveImage")));
             this.Save.Name = "Save";
             this.Save.NormalImage = ((System.Drawing.Image)(resources.GetObject("Save.NormalImage")));
             this.Save.Power = "ifwrite";
-            this.Save.Size = new System.Drawing.Size(75, 35);
+            this.Save.Size = new System.Drawing.Size(56, 28);
             this.Save.TabIndex = 1;
             this.Save.Text = "保存";
             this.Save.UseVisualStyleBackColor = true;
@@ -68,12 +69,14 @@
             this.sn_module,
             this.sn_id,
             this.sn_detno,
-            this.sn_using});
-            this.SysNavDGV.Location = new System.Drawing.Point(3, 1);
-            this.SysNavDGV.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.sn_using,
+            this.sn_defaultprint});
+            this.SysNavDGV.EnableContentClick = true;
+            this.SysNavDGV.Location = new System.Drawing.Point(2, 1);
+            this.SysNavDGV.Margin = new System.Windows.Forms.Padding(2);
             this.SysNavDGV.Name = "SysNavDGV";
             this.SysNavDGV.RowTemplate.Height = 27;
-            this.SysNavDGV.Size = new System.Drawing.Size(1229, 549);
+            this.SysNavDGV.Size = new System.Drawing.Size(922, 439);
             this.SysNavDGV.TabIndex = 0;
             // 
             // sn_displayname
@@ -108,16 +111,22 @@
             this.sn_using.HeaderText = "是否启用";
             this.sn_using.Name = "sn_using";
             // 
-            // 导航管理
+            // sn_defaultprint
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.sn_defaultprint.DataPropertyName = "sn_defaultprint";
+            this.sn_defaultprint.HeaderText = "自动打印";
+            this.sn_defaultprint.MinimumWidth = 100;
+            this.sn_defaultprint.Name = "sn_defaultprint";
+            // 
+            // SystemSetting_SysNav
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1235, 608);
+            this.ClientSize = new System.Drawing.Size(926, 486);
             this.Controls.Add(this.Save);
             this.Controls.Add(this.SysNavDGV);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.Name = "导航管理";
+            this.Name = "SystemSetting_SysNav";
             this.Tag = "Setup!SysNav";
             this.Text = "导航管理";
             this.Load += new System.EventHandler(this.导航管理_Load);
@@ -136,5 +145,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn sn_id;
         private System.Windows.Forms.DataGridViewTextBoxColumn sn_detno;
         private System.Windows.Forms.DataGridViewCheckBoxColumn sn_using;
+        private System.Windows.Forms.DataGridViewCheckBoxColumn sn_defaultprint;
     }
 }

+ 1 - 1
UAS-MES/FunctionCode/SystemSetting/SystemSetting_SysNav.cs

@@ -25,7 +25,7 @@ namespace UAS_MES.SystemSetting
         private void 导航管理_Load(object sender, EventArgs e)
         {
             dh = SystemInf.dh;
-            dt = (DataTable)dh.ExecuteSql("select sn_id,sn_displayname,sn_detno,sn_using,sn_module from cs$sysnavation order by sn_module", "select");
+            dt = (DataTable)dh.ExecuteSql("select sn_id,sn_displayname,sn_detno,sn_using,sn_module,sn_defaultprint from cs$sysnavation order by sn_module", "select");
             BaseUtil.FillDgvWithDataTable(SysNavDGV, dt);
             asc.controllInitializeSize(this);
         }

+ 3 - 0
UAS-MES/FunctionCode/SystemSetting/SystemSetting_SysNav.resx

@@ -264,4 +264,7 @@
   <metadata name="sn_using.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="sn_defaultprint.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
 </root>