Browse Source

去除了放大镜的Leave赋值方法,使用频率较低

章政 8 years ago
parent
commit
0182d12912

+ 2 - 2
UAS-MES/CustomControl/TextBoxWithIcon/SearchTextBox.Designer.cs

@@ -37,12 +37,12 @@
             // 
             this.TextBox.AllPower = null;
             this.TextBox.BackColor = System.Drawing.Color.White;
-            this.TextBox.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.TextBox.Dock = System.Windows.Forms.DockStyle.Left;
             this.TextBox.ID = null;
             this.TextBox.Location = new System.Drawing.Point(0, 0);
             this.TextBox.Name = "TextBox";
             this.TextBox.Power = null;
-            this.TextBox.Size = new System.Drawing.Size(247, 21);
+            this.TextBox.Size = new System.Drawing.Size(225, 25);
             this.TextBox.Str = null;
             this.TextBox.Str1 = null;
             this.TextBox.Str2 = null;

+ 38 - 38
UAS-MES/CustomControl/TextBoxWithIcon/SearchTextBox.cs

@@ -270,44 +270,44 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
         public void TextBox_Leave(object sender, EventArgs e)
         {
             TextBox.BackColor = System.Drawing.Color.White;
-            if (TextBox.Text != "") {
-                DataHelper dh = new DataHelper();
-
-                List<string> fields = new List<string>();
-                //获取查询的字段
-                string[] field = selectField.Replace(",", "#").Trim().Split('#');
-                for (int i = 0; i < field.Length; i++)
-                {
-                    if (i % 2 == 0)
-                        fields.Add(field[i]);
-                }
-                //将查询到的结果返回界面
-                string sql = "select " + BaseUtil.AddField(fields.ToArray()) + " from " + tableName + " where " + Tag + "='" + TextBox.Text + "'";
-                if (condition != null)
-                {
-                    sql += " and " + condition;
-                }
-                DataTable dt = (DataTable)dh.ExecuteSql(sql, "select");
-                FormCollection fmCollection = Application.OpenForms;
-                if (dt.Rows.Count > 0)
-                {
-                    for (int i = 0; i < dt.Columns.Count; i++)
-                    {
-                        for (int j = 0; j < SetValueField.Length; j++)
-                        {
-                            //利用字段的Tag属性来和列名进行比对
-                            object tag = fmCollection[FormName].Controls[SetValueField[j]].Tag;
-                            if (SetValueField[j] == dt.Columns[i].ColumnName.ToLower() || (tag != null && tag == dt.Columns[i].ColumnName.ToLower()))
-                            {
-                                fmCollection[FormName].Controls[SetValueField[j]].Text = dt.Rows[0][dt.Columns[i].ColumnName].ToString();
-                            }
-                        }
-                    }
-                    LeaveFindData = true;
-                }
-                else
-                    LeaveFindData = false;
-            }
+            //if (TextBox.Text != "") {
+            //    DataHelper dh = new DataHelper();
+
+            //    List<string> fields = new List<string>();
+            //    //获取查询的字段
+            //    string[] field = selectField.Replace(",", "#").Trim().Split('#');
+            //    for (int i = 0; i < field.Length; i++)
+            //    {
+            //        if (i % 2 == 0)
+            //            fields.Add(field[i]);
+            //    }
+            //    //将查询到的结果返回界面
+            //    string sql = "select " + BaseUtil.AddField(fields.ToArray()) + " from " + tableName + " where " + Tag + "='" + TextBox.Text + "'";
+            //    if (condition != null)
+            //    {
+            //        sql += " and " + condition;
+            //    }
+            //    DataTable dt = (DataTable)dh.ExecuteSql(sql, "select");
+            //    FormCollection fmCollection = Application.OpenForms;
+            //    if (dt.Rows.Count > 0)
+            //    {
+            //        for (int i = 0; i < dt.Columns.Count; i++)
+            //        {
+            //            for (int j = 0; j < SetValueField.Length; j++)
+            //            {
+            //                //利用字段的Tag属性来和列名进行比对
+            //                object tag = fmCollection[FormName].Controls[SetValueField[j]].Tag;
+            //                if (SetValueField[j] == dt.Columns[i].ColumnName.ToLower() || (tag != null && tag == dt.Columns[i].ColumnName.ToLower()))
+            //                {
+            //                    fmCollection[FormName].Controls[SetValueField[j]].Text = dt.Rows[0][dt.Columns[i].ColumnName].ToString();
+            //                }
+            //            }
+            //        }
+            //        LeaveFindData = true;
+            //    }
+            //    else
+            //        LeaveFindData = false;
+            //}
         }
 
         private void SearchTextBox_Load(object sender, EventArgs e)

+ 27 - 21
UAS-MES/FunctionCode/Employee/Employee_Power.Designer.cs

@@ -48,9 +48,10 @@
             // 
             this.sn_module_label.AutoSize = true;
             this.sn_module_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sn_module_label.Location = new System.Drawing.Point(272, 14);
+            this.sn_module_label.Location = new System.Drawing.Point(363, 18);
+            this.sn_module_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.sn_module_label.Name = "sn_module_label";
-            this.sn_module_label.Size = new System.Drawing.Size(74, 21);
+            this.sn_module_label.Size = new System.Drawing.Size(92, 27);
             this.sn_module_label.TabIndex = 211;
             this.sn_module_label.Text = "对应模块";
             // 
@@ -58,9 +59,10 @@
             // 
             this.label1.AutoSize = true;
             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(16, 14);
+            this.label1.Location = new System.Drawing.Point(21, 18);
+            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(58, 21);
+            this.label1.Size = new System.Drawing.Size(72, 27);
             this.label1.TabIndex = 212;
             this.label1.Text = "用户组";
             // 
@@ -68,10 +70,10 @@
             // 
             this.sn_module.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.sn_module.FormattingEnabled = true;
-            this.sn_module.Location = new System.Drawing.Point(368, 18);
-            this.sn_module.Margin = new System.Windows.Forms.Padding(2);
+            this.sn_module.Location = new System.Drawing.Point(491, 22);
+            this.sn_module.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.sn_module.Name = "sn_module";
-            this.sn_module.Size = new System.Drawing.Size(140, 20);
+            this.sn_module.Size = new System.Drawing.Size(185, 23);
             this.sn_module.TabIndex = 237;
             this.sn_module.Tag = "sn_classname";
             this.sn_module.SelectedIndexChanged += new System.EventHandler(this.sn_module_SelectedIndexChanged);
@@ -83,16 +85,16 @@
             this.ug_code.Condition = null;
             this.ug_code.DBTitle = null;
             this.ug_code.FormName = null;
-            this.ug_code.Location = new System.Drawing.Point(95, 16);
-            this.ug_code.Margin = new System.Windows.Forms.Padding(2);
+            this.ug_code.Location = new System.Drawing.Point(127, 20);
+            this.ug_code.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.ug_code.Name = "ug_code";
             this.ug_code.Power = null;
             this.ug_code.SelectField = null;
             this.ug_code.SetValueField = null;
-            this.ug_code.Size = new System.Drawing.Size(148, 20);
+            this.ug_code.Size = new System.Drawing.Size(197, 25);
             this.ug_code.TabIndex = 236;
             this.ug_code.TableName = null;
-            this.ug_code.Tag = "ugp_groupcode";
+            this.ug_code.Tag = "ug_code";
             this.ug_code.TextBoxEnable = true;
             this.ug_code.UserControlTextChanged += new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox.OnTextChange(this.ug_code_UserControlTextChanged);
             // 
@@ -103,12 +105,13 @@
             this.Screen.DownImage = ((System.Drawing.Image)(resources.GetObject("Screen.DownImage")));
             this.Screen.Image = ((System.Drawing.Image)(resources.GetObject("Screen.Image")));
             this.Screen.IsShowBorder = true;
-            this.Screen.Location = new System.Drawing.Point(530, 15);
+            this.Screen.Location = new System.Drawing.Point(707, 19);
+            this.Screen.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             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(52, 24);
+            this.Screen.Size = new System.Drawing.Size(69, 30);
             this.Screen.TabIndex = 232;
             this.Screen.Tag = "IfRead|ifAll";
             this.Screen.Text = "筛选";
@@ -122,12 +125,13 @@
             this.SavePower.DownImage = ((System.Drawing.Image)(resources.GetObject("SavePower.DownImage")));
             this.SavePower.Image = ((System.Drawing.Image)(resources.GetObject("SavePower.Image")));
             this.SavePower.IsShowBorder = true;
-            this.SavePower.Location = new System.Drawing.Point(401, 478);
+            this.SavePower.Location = new System.Drawing.Point(535, 598);
+            this.SavePower.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.SavePower.MoveImage = ((System.Drawing.Image)(resources.GetObject("SavePower.MoveImage")));
             this.SavePower.Name = "SavePower";
             this.SavePower.NormalImage = ((System.Drawing.Image)(resources.GetObject("SavePower.NormalImage")));
             this.SavePower.Power = "ifwrite";
-            this.SavePower.Size = new System.Drawing.Size(60, 24);
+            this.SavePower.Size = new System.Drawing.Size(80, 30);
             this.SavePower.TabIndex = 1;
             this.SavePower.Tag = "";
             this.SavePower.Text = "保存";
@@ -145,10 +149,11 @@
             this.ugp_id,
             this.Column1,
             this.Column2});
-            this.GroupPowerDGV.Location = new System.Drawing.Point(3, 70);
+            this.GroupPowerDGV.Location = new System.Drawing.Point(4, 88);
+            this.GroupPowerDGV.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.GroupPowerDGV.Name = "GroupPowerDGV";
             this.GroupPowerDGV.RowTemplate.Height = 23;
-            this.GroupPowerDGV.Size = new System.Drawing.Size(855, 400);
+            this.GroupPowerDGV.Size = new System.Drawing.Size(1140, 500);
             this.GroupPowerDGV.TabIndex = 0;
             this.GroupPowerDGV.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.GroupPower_DataError);
             // 
@@ -189,11 +194,11 @@
             this.Column2.HeaderText = "";
             this.Column2.Name = "Column2";
             // 
-            // 权限控制
+            // Employee_Power
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(862, 508);
+            this.ClientSize = new System.Drawing.Size(1149, 635);
             this.Controls.Add(this.sn_module);
             this.Controls.Add(this.ug_code);
             this.Controls.Add(this.Screen);
@@ -202,7 +207,8 @@
             this.Controls.Add(this.SavePower);
             this.Controls.Add(this.GroupPowerDGV);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Name = "权限控制";
+            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Name = "Employee_Power";
             this.Tag = "Employee!Power";
             this.Text = "权限控制";
             this.Load += new System.EventHandler(this.权限控制_Load);

+ 2 - 2
UAS-MES/Program.cs

@@ -42,7 +42,7 @@ namespace UAS_MES
                 FileStream fs = new FileStream(sysdisc + @":\Log\" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt", FileMode.OpenOrCreate, FileAccess.ReadWrite);
                 fs.Close();
                 if (principal.IsInRole(WindowsBuiltInRole.Administrator))
-                    Application.Run(new Form1());
+                    Application.Run(new Login());
                 else
                 {
                     //创建启动对象
@@ -91,7 +91,7 @@ namespace UAS_MES
             if (ex != null)
             {
                 sb.AppendLine(ex.Message);
-                //sb.AppendLine("【异常方法】:" + ex.TargetSite);
+                sb.AppendLine("【异常方法】:" + ex.TargetSite);
             }
             else { sb.AppendLine("【未处理异常】:" + backStr); }
             return sb.ToString();