Browse Source

放大镜赋值方法补充

Hcsy 8 năm trước cách đây
mục cha
commit
f15816cee2

+ 71 - 74
UAS-MES/FunctionCode/Employee/Employee_Group.Designer.cs

@@ -28,22 +28,22 @@
         /// </summary>
         private void InitializeComponent()
         {
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Employee_Group));
             System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
             System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Employee_Group));
             this.ug_code_label = new System.Windows.Forms.Label();
             this.ug_name_label = new System.Windows.Forms.Label();
             this.UserGroupDGV = new UAS_MES.CustomControl.DataGrid_View.DataGridViewWithSerialNum();
-            this.NewGroup = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
-            this.DeleteGroup = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
-            this.Screen = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
-            this.ug_name = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
-            this.ug_code = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.ug_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ug_code1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ug_name1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.UserSetting = new System.Windows.Forms.DataGridViewLinkColumn();
             this.PowerSetting = new System.Windows.Forms.DataGridViewLinkColumn();
+            this.NewGroup = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.DeleteGroup = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.Screen = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.ug_name = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
+            this.ug_code = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
             ((System.ComponentModel.ISupportInitialize)(this.UserGroupDGV)).BeginInit();
             this.SuspendLayout();
             // 
@@ -51,10 +51,9 @@
             // 
             this.ug_code_label.AutoSize = true;
             this.ug_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ug_code_label.Location = new System.Drawing.Point(12, 30);
-            this.ug_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ug_code_label.Location = new System.Drawing.Point(9, 24);
             this.ug_code_label.Name = "ug_code_label";
-            this.ug_code_label.Size = new System.Drawing.Size(112, 27);
+            this.ug_code_label.Size = new System.Drawing.Size(90, 21);
             this.ug_code_label.TabIndex = 237;
             this.ug_code_label.Text = "用户组代码";
             // 
@@ -62,10 +61,9 @@
             // 
             this.ug_name_label.AutoSize = true;
             this.ug_name_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ug_name_label.Location = new System.Drawing.Point(352, 30);
-            this.ug_name_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ug_name_label.Location = new System.Drawing.Point(264, 24);
             this.ug_name_label.Name = "ug_name_label";
-            this.ug_name_label.Size = new System.Drawing.Size(72, 27);
+            this.ug_name_label.Size = new System.Drawing.Size(58, 21);
             this.ug_name_label.TabIndex = 239;
             this.ug_name_label.Text = "用户组";
             // 
@@ -79,14 +77,54 @@
             this.ug_name1,
             this.UserSetting,
             this.PowerSetting});
-            this.UserGroupDGV.Location = new System.Drawing.Point(12, 71);
-            this.UserGroupDGV.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.UserGroupDGV.Location = new System.Drawing.Point(9, 57);
+            this.UserGroupDGV.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.UserGroupDGV.Name = "UserGroupDGV";
             this.UserGroupDGV.RowTemplate.Height = 27;
-            this.UserGroupDGV.Size = new System.Drawing.Size(869, 598);
+            this.UserGroupDGV.Size = new System.Drawing.Size(652, 478);
             this.UserGroupDGV.TabIndex = 244;
             this.UserGroupDGV.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.UserGroupDGV_CellClick);
             // 
+            // ug_id
+            // 
+            this.ug_id.DataPropertyName = "ug_id";
+            this.ug_id.HeaderText = "ug_id";
+            this.ug_id.Name = "ug_id";
+            this.ug_id.Visible = false;
+            // 
+            // ug_code1
+            // 
+            this.ug_code1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.ug_code1.DataPropertyName = "ug_code";
+            this.ug_code1.HeaderText = "用户组代码";
+            this.ug_code1.Name = "ug_code1";
+            // 
+            // ug_name1
+            // 
+            this.ug_name1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.ug_name1.DataPropertyName = "ug_name";
+            this.ug_name1.HeaderText = "用户组";
+            this.ug_name1.Name = "ug_name1";
+            // 
+            // UserSetting
+            // 
+            this.UserSetting.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.UserSetting.DataPropertyName = "UserSetting";
+            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
+            this.UserSetting.DefaultCellStyle = dataGridViewCellStyle1;
+            this.UserSetting.HeaderText = "成员设置";
+            this.UserSetting.Name = "UserSetting";
+            this.UserSetting.Width = 120;
+            // 
+            // PowerSetting
+            // 
+            this.PowerSetting.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.PowerSetting.DataPropertyName = "PowerSetting";
+            dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
+            this.PowerSetting.DefaultCellStyle = dataGridViewCellStyle2;
+            this.PowerSetting.HeaderText = "权限分配";
+            this.PowerSetting.Name = "PowerSetting";
+            // 
             // NewGroup
             // 
             this.NewGroup.AllPower = null;
@@ -95,13 +133,13 @@
             this.NewGroup.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.NewGroup.Image = null;
             this.NewGroup.IsShowBorder = true;
-            this.NewGroup.Location = new System.Drawing.Point(743, 29);
-            this.NewGroup.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.NewGroup.Location = new System.Drawing.Point(557, 23);
+            this.NewGroup.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.NewGroup.MoveImage = ((System.Drawing.Image)(resources.GetObject("NewGroup.MoveImage")));
             this.NewGroup.Name = "NewGroup";
             this.NewGroup.NormalImage = ((System.Drawing.Image)(resources.GetObject("NewGroup.NormalImage")));
             this.NewGroup.Power = null;
-            this.NewGroup.Size = new System.Drawing.Size(60, 32);
+            this.NewGroup.Size = new System.Drawing.Size(45, 26);
             this.NewGroup.TabIndex = 243;
             this.NewGroup.Tag = "ShowDialogWindow";
             this.NewGroup.Text = "新增";
@@ -116,13 +154,13 @@
             this.DeleteGroup.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.DeleteGroup.Image = null;
             this.DeleteGroup.IsShowBorder = true;
-            this.DeleteGroup.Location = new System.Drawing.Point(821, 29);
-            this.DeleteGroup.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.DeleteGroup.Location = new System.Drawing.Point(616, 23);
+            this.DeleteGroup.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.DeleteGroup.MoveImage = ((System.Drawing.Image)(resources.GetObject("DeleteGroup.MoveImage")));
             this.DeleteGroup.Name = "DeleteGroup";
             this.DeleteGroup.NormalImage = ((System.Drawing.Image)(resources.GetObject("DeleteGroup.NormalImage")));
             this.DeleteGroup.Power = null;
-            this.DeleteGroup.Size = new System.Drawing.Size(60, 32);
+            this.DeleteGroup.Size = new System.Drawing.Size(45, 26);
             this.DeleteGroup.TabIndex = 242;
             this.DeleteGroup.Text = "删除";
             this.DeleteGroup.UseVisualStyleBackColor = false;
@@ -136,13 +174,13 @@
             this.Screen.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Screen.Image = null;
             this.Screen.IsShowBorder = true;
-            this.Screen.Location = new System.Drawing.Point(667, 29);
-            this.Screen.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.Screen.Location = new System.Drawing.Point(500, 23);
+            this.Screen.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.Screen.MoveImage = ((System.Drawing.Image)(resources.GetObject("Screen.MoveImage")));
             this.Screen.Name = "Screen";
             this.Screen.NormalImage = ((System.Drawing.Image)(resources.GetObject("Screen.NormalImage")));
             this.Screen.Power = null;
-            this.Screen.Size = new System.Drawing.Size(60, 32);
+            this.Screen.Size = new System.Drawing.Size(45, 26);
             this.Screen.TabIndex = 241;
             this.Screen.Text = "筛选";
             this.Screen.UseVisualStyleBackColor = false;
@@ -155,17 +193,17 @@
             this.ug_name.Condition = null;
             this.ug_name.DBTitle = null;
             this.ug_name.FormName = null;
-            this.ug_name.Location = new System.Drawing.Point(443, 30);
-            this.ug_name.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.ug_name.Location = new System.Drawing.Point(332, 24);
+            this.ug_name.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.ug_name.Name = "ug_name";
             this.ug_name.Power = null;
             this.ug_name.ReturnData = null;
             this.ug_name.SelectField = null;
             this.ug_name.SetValueField = null;
-            this.ug_name.Size = new System.Drawing.Size(183, 26);
+            this.ug_name.Size = new System.Drawing.Size(137, 21);
             this.ug_name.TabIndex = 240;
             this.ug_name.TableName = null;
-            this.ug_name.Tag = "ug_code";
+            this.ug_name.Tag = "ug_name";
             this.ug_name.TextBoxEnable = true;
             // 
             // ug_code
@@ -175,64 +213,24 @@
             this.ug_code.Condition = null;
             this.ug_code.DBTitle = null;
             this.ug_code.FormName = null;
-            this.ug_code.Location = new System.Drawing.Point(139, 30);
-            this.ug_code.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.ug_code.Location = new System.Drawing.Point(104, 24);
+            this.ug_code.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.ug_code.Name = "ug_code";
             this.ug_code.Power = null;
             this.ug_code.ReturnData = null;
             this.ug_code.SelectField = null;
             this.ug_code.SetValueField = null;
-            this.ug_code.Size = new System.Drawing.Size(180, 26);
+            this.ug_code.Size = new System.Drawing.Size(135, 21);
             this.ug_code.TabIndex = 238;
             this.ug_code.TableName = null;
             this.ug_code.Tag = "ug_code";
             this.ug_code.TextBoxEnable = true;
             // 
-            // ug_id
-            // 
-            this.ug_id.DataPropertyName = "ug_id";
-            this.ug_id.HeaderText = "ug_id";
-            this.ug_id.Name = "ug_id";
-            this.ug_id.Visible = false;
-            // 
-            // ug_code1
-            // 
-            this.ug_code1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.ug_code1.DataPropertyName = "ug_code";
-            this.ug_code1.HeaderText = "用户组代码";
-            this.ug_code1.Name = "ug_code1";
-            // 
-            // ug_name1
-            // 
-            this.ug_name1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.ug_name1.DataPropertyName = "ug_name";
-            this.ug_name1.HeaderText = "用户组";
-            this.ug_name1.Name = "ug_name1";
-            // 
-            // UserSetting
-            // 
-            this.UserSetting.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.UserSetting.DataPropertyName = "UserSetting";
-            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
-            this.UserSetting.DefaultCellStyle = dataGridViewCellStyle1;
-            this.UserSetting.HeaderText = "成员设置";
-            this.UserSetting.Name = "UserSetting";
-            this.UserSetting.Width = 120;
-            // 
-            // PowerSetting
-            // 
-            this.PowerSetting.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.PowerSetting.DataPropertyName = "PowerSetting";
-            dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
-            this.PowerSetting.DefaultCellStyle = dataGridViewCellStyle2;
-            this.PowerSetting.HeaderText = "权限分配";
-            this.PowerSetting.Name = "PowerSetting";
-            // 
             // Employee_Group
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(959, 695);
+            this.ClientSize = new System.Drawing.Size(719, 556);
             this.Controls.Add(this.UserGroupDGV);
             this.Controls.Add(this.NewGroup);
             this.Controls.Add(this.DeleteGroup);
@@ -242,7 +240,6 @@
             this.Controls.Add(this.ug_code);
             this.Controls.Add(this.ug_code_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "Employee_Group";
             this.Tag = "Employee!Data";
             this.Text = "人员资料";

+ 17 - 0
UAS-MES/FunctionCode/Employee/Employee_Group.cs

@@ -16,6 +16,9 @@ namespace UAS_MES.Employee
 
         DataTable dt;
 
+        DataTable Dbfind;
+        DataTable Dbfind1;
+
         AutoSizeFormClass asc = new AutoSizeFormClass();
 
         public Employee_Group()
@@ -40,16 +43,30 @@ namespace UAS_MES.Employee
             ug_code.TableName = "CS$USERGROUP";
             ug_code.SelectField = "ug_code # 分组编号,ug_name # 分组名称,ug_inman # 录入人,ug_indate #录入日期";
             ug_code.SetValueField = new string[] { "ug_code" };
+            ug_code.DbChange += Ug_code_Dbchage;
 
             ug_name.FormName = Name;
             ug_name.TableName = "CS$USERGROUP";
             ug_name.SelectField = "ug_code # 分组编号,ug_name # 分组名称,ug_inman # 录入人,ug_indate #录入日期";
             ug_name.SetValueField = new string[] { "ug_name" };
+            ug_name.DbChange += Ug_name_Dbchage;
 
             ug_code.KeyDown += KeyDownEvent;
             ug_name.KeyDown += KeyDownEvent;
         }
 
+        private void Ug_name_Dbchage(object sender, EventArgs e)
+        {
+            Dbfind = ug_name.ReturnData;
+            BaseUtil.SetFormValue(this.Controls, Dbfind);
+        }
+
+        private void Ug_code_Dbchage(object sender, EventArgs e)
+        {
+            Dbfind1 = ug_code.ReturnData;
+            BaseUtil.SetFormValue(this.Controls, Dbfind1);
+        }
+
         private void 人员分组_SizeChanged(object sender, EventArgs e)
         {
             asc.controlAutoSize(this);

+ 8 - 0
UAS-MES/FunctionCode/Employee/Employee_Power.cs

@@ -25,6 +25,7 @@ namespace UAS_MES.Employee
         Thread thread;
 
         SetLoadingWindow stw;
+        DataTable Dbfind;
 
         ItemObject item;
 
@@ -69,6 +70,7 @@ namespace UAS_MES.Employee
             ug_code.TableName = "CS$USERGROUP";
             ug_code.SelectField = "ug_code # 分组编号,ug_name # 分组名称,ug_inman # 录入人,ug_indate #录入日期";
             ug_code.SetValueField = new string[] { "ug_code" };
+            ug_code.DbChange += Ug_code_Dbchage;
             //由于需要额外添加一个全部值,需要手动添加Item
             dt = (DataTable)dh.ExecuteSql("select DISTINCT sn_module from CS$SYSNAVATION where sn_using=1", "select");
             item = new ItemObject("全部", "");
@@ -85,6 +87,12 @@ namespace UAS_MES.Employee
           
         }
 
+        private void Ug_code_Dbchage(object sender, EventArgs e)
+        {
+            Dbfind = ug_code.ReturnData;
+            BaseUtil.SetFormValue(this.Controls, Dbfind);
+        }
+
         private void Screen_Click(object sender, EventArgs e)
         {
             //拼接条件,获取按照用户输入条件的数据集

+ 9 - 0
UAS-MES/FunctionCode/Employee/Employee_PowerSarch.cs

@@ -18,6 +18,8 @@ namespace UAS_MES.Employee
 
         DataHelper dh;
 
+        DataTable Dbfind;
+
         AutoSizeFormClass asc = new AutoSizeFormClass();
 
         LogStringBuilder sql = new LogStringBuilder();
@@ -35,6 +37,7 @@ namespace UAS_MES.Employee
             ug_code.TableName = "CS$USERGROUP";
             ug_code.SelectField = "ug_code # 分组编号,ug_name # 分组名称,ug_inman # 录入人,ug_indate #录入日期";
             ug_code.SetValueField = new string[] { "ug_code" };
+            ug_code.DbChange += Ug_code_Dbchage;
 
             dt = (DataTable)dh.ExecuteSql("select DISTINCT sn_module from CS$SYSNAVATION where sn_using=1", "select");
             ItemObject item = new ItemObject("全部", "");
@@ -47,6 +50,12 @@ namespace UAS_MES.Employee
             }
         }
 
+        private void Ug_code_Dbchage(object sender, EventArgs e)
+        {
+            Dbfind = ug_code.ReturnData;
+            BaseUtil.SetFormValue(this.Controls, Dbfind);
+        }
+
         private void 权限查看_SizeChanged(object sender, EventArgs e)
         {
             asc.controlAutoSize(this);

+ 14 - 8
UAS-MES/FunctionCode/Packing/Packing_CartonTransfer.cs

@@ -224,29 +224,35 @@ namespace UAS_MES.Packing
                                                 }
                                             }
                                         }
-                                        if (pa_checkno != new_pa_checkno) {
-                                            if ((pa_checkno == "" && new_pa_checkno != "")||(pa_checkno != "" && new_pa_checkno == ""))
+                                        if (pa_checkno != new_pa_checkno)
+                                        {
+                                            if ((pa_checkno == "" && new_pa_checkno != "") || (pa_checkno != "" && new_pa_checkno == ""))
                                             {
-                                                if (pa_checkno != "" && ob_result == "") {
+                                                if (pa_checkno != "" && ob_result == "")
+                                                {
                                                     OperateResult.AppendText(">>原箱号处于送检状态,不允许转移\n", Color.Red, sn_code);
                                                     return;
                                                 }
-                                                if (new_pa_checkno != "" && new_pa_checkno == "") {
+                                                if (new_pa_checkno != "" && new_pa_checkno == "")
+                                                {
                                                     OperateResult.AppendText(">>目标箱号处于送检状态,不允许转移\n", Color.Red, sn_code);
                                                     return;
                                                 }
                                             }
-                                            if (pa_checkno != "" && new_pa_checkno != "") {
+                                            if (pa_checkno != "" && new_pa_checkno != "")
+                                            {
                                                 string a_ob_result = dh.getFieldDataByCondition("oqcbatch", "ob_status", "ob_checkno = '" + pa_checkno + "'").ToString();
                                                 string b_ob_result = dh.getFieldDataByCondition("oqcbatch", "ob_status", "ob_checkno = '" + new_pa_checkno + "'").ToString();
-                                                if (!((a_ob_result == b_ob_result) && (b_ob_result == "OK" || b_ob_result == "NG"))) {
+                                                if (!((a_ob_result == b_ob_result) && (b_ob_result == "OK" || b_ob_result == "NG")))
+                                                {
                                                     OperateResult.AppendText(">>原箱号和目标箱号必须抽检完成,并且结果一致才可以转移\n", Color.Red, sn_code);
                                                     return;
                                                 }
                                             }
                                         }
-                                        string new_laststepcode = dh.getFieldDataByCondition("packagedetail inner join makeserial on ms_outboxcode=pd_outboxcode and ms_sncode=pd_barcode and ms_prodcode = pd_prodcode", "max(nvl(ms_currentstepcode,ms_stepcode))", "pd_outboxcode='"+ pa_outboxcode.Text + "'").ToString();
-                                        if (new_laststepcode != laststepcode.Text) {
+                                        string new_laststepcode = dh.getFieldDataByCondition("packagedetail inner join makeserial on ms_outboxcode=pd_outboxcode and ms_sncode=pd_barcode and ms_prodcode = pd_prodcode", "max(nvl(ms_currentstepcode,ms_stepcode))", "pd_outboxcode='" + pa_outboxcode.Text + "'").ToString();
+                                        if (new_laststepcode != laststepcode.Text)
+                                        {
                                             OperateResult.AppendText(">>目标箱号中的序列号最后所在工序与所录入序列号最后所在工序不一致\n", Color.Red, sn_code);
                                             return;
                                         }