Explorar el Código

添加权限控制

章政 hace 7 años
padre
commit
507a6434ff

+ 40 - 126
UAS-出货标签管理(吉利通)/PowerSetting.Designer.cs

@@ -30,25 +30,17 @@
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PowerSetting));
             this.PowerSetDGV = new UAS_LabelMachine.CustomControl.DataGridViewWithSerialNum();
-            this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.lpp_emcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.lpp_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.em_na = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.lpp_cleandetail = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.lpp_savedetail = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.lpp_gencode = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.lpp_collectstrategy = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.lpp_allcollect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.lpp_labelmatain = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.SaveGrid = new UAS_LabelMachine.CustomControl.NormalButton();
-            this.AddRow = new UAS_LabelMachine.CustomControl.NormalButton();
-            this.Delete = new UAS_LabelMachine.CustomControl.NormalButton();
-            this.ChooseAll = new UAS_LabelMachine.CustomControl.ChooseAllButton();
             this.em_name = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.si_expression4_label = new System.Windows.Forms.Label();
             this.em_code = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.label1 = new System.Windows.Forms.Label();
             this.Screen = new UAS_LabelMachine.CustomControl.ChooseAllButton();
+            this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.lpp_emcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.lpp_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.em_na = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.lpp_manual = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.PowerSetDGV)).BeginInit();
             this.SuspendLayout();
             // 
@@ -61,85 +53,17 @@
             this.lpp_emcode,
             this.lpp_id,
             this.em_na,
-            this.lpp_cleandetail,
-            this.lpp_savedetail,
-            this.lpp_gencode,
-            this.lpp_collectstrategy,
-            this.lpp_allcollect,
-            this.lpp_labelmatain});
+            this.lpp_manual});
             this.PowerSetDGV.Location = new System.Drawing.Point(0, 55);
             this.PowerSetDGV.Name = "PowerSetDGV";
             this.PowerSetDGV.RowTemplate.Height = 23;
             this.PowerSetDGV.Size = new System.Drawing.Size(1056, 441);
             this.PowerSetDGV.TabIndex = 0;
             // 
-            // Choose
-            // 
-            this.Choose.HeaderText = "勾选";
-            this.Choose.Name = "Choose";
-            this.Choose.Width = 50;
-            // 
-            // lpp_emcode
-            // 
-            this.lpp_emcode.DataPropertyName = "lpp_emcode";
-            this.lpp_emcode.HeaderText = "员工编号";
-            this.lpp_emcode.Name = "lpp_emcode";
-            // 
-            // lpp_id
-            // 
-            this.lpp_id.DataPropertyName = "lpp_id";
-            this.lpp_id.HeaderText = "lpp_id";
-            this.lpp_id.Name = "lpp_id";
-            this.lpp_id.Visible = false;
-            // 
-            // em_na
-            // 
-            this.em_na.DataPropertyName = "em_name";
-            this.em_na.HeaderText = "员工姓名";
-            this.em_na.Name = "em_na";
-            this.em_na.ReadOnly = true;
-            // 
-            // lpp_cleandetail
-            // 
-            this.lpp_cleandetail.DataPropertyName = "lpp_cleandetail";
-            this.lpp_cleandetail.HeaderText = "清除明细";
-            this.lpp_cleandetail.Name = "lpp_cleandetail";
-            // 
-            // lpp_savedetail
-            // 
-            this.lpp_savedetail.DataPropertyName = "lpp_savedetail";
-            this.lpp_savedetail.HeaderText = "保存明细";
-            this.lpp_savedetail.Name = "lpp_savedetail";
-            // 
-            // lpp_gencode
-            // 
-            this.lpp_gencode.DataPropertyName = "lpp_gencode";
-            this.lpp_gencode.HeaderText = "生成条码";
-            this.lpp_gencode.Name = "lpp_gencode";
-            // 
-            // lpp_collectstrategy
-            // 
-            this.lpp_collectstrategy.DataPropertyName = "lpp_collectstrategy";
-            this.lpp_collectstrategy.HeaderText = "查看采集策略";
-            this.lpp_collectstrategy.Name = "lpp_collectstrategy";
-            this.lpp_collectstrategy.Width = 110;
-            // 
-            // lpp_allcollect
-            // 
-            this.lpp_allcollect.DataPropertyName = "lpp_allcollect";
-            this.lpp_allcollect.HeaderText = "全部采集";
-            this.lpp_allcollect.Name = "lpp_allcollect";
-            // 
-            // lpp_labelmatain
-            // 
-            this.lpp_labelmatain.DataPropertyName = "lpp_labelmatain";
-            this.lpp_labelmatain.HeaderText = "标签维护";
-            this.lpp_labelmatain.Name = "lpp_labelmatain";
-            // 
             // SaveGrid
             // 
             this.SaveGrid.Image = ((System.Drawing.Image)(resources.GetObject("SaveGrid.Image")));
-            this.SaveGrid.Location = new System.Drawing.Point(578, 503);
+            this.SaveGrid.Location = new System.Drawing.Point(491, 504);
             this.SaveGrid.Name = "SaveGrid";
             this.SaveGrid.Size = new System.Drawing.Size(75, 29);
             this.SaveGrid.TabIndex = 1;
@@ -147,37 +71,6 @@
             this.SaveGrid.UseVisualStyleBackColor = true;
             this.SaveGrid.Click += new System.EventHandler(this.SaveGrid_Click);
             // 
-            // AddRow
-            // 
-            this.AddRow.Image = ((System.Drawing.Image)(resources.GetObject("AddRow.Image")));
-            this.AddRow.Location = new System.Drawing.Point(407, 503);
-            this.AddRow.Name = "AddRow";
-            this.AddRow.Size = new System.Drawing.Size(75, 29);
-            this.AddRow.TabIndex = 2;
-            this.AddRow.Text = "新增";
-            this.AddRow.UseVisualStyleBackColor = true;
-            this.AddRow.Click += new System.EventHandler(this.AddRow_Click);
-            // 
-            // Delete
-            // 
-            this.Delete.Image = ((System.Drawing.Image)(resources.GetObject("Delete.Image")));
-            this.Delete.Location = new System.Drawing.Point(491, 503);
-            this.Delete.Name = "Delete";
-            this.Delete.Size = new System.Drawing.Size(75, 29);
-            this.Delete.TabIndex = 3;
-            this.Delete.Text = "删除";
-            this.Delete.UseVisualStyleBackColor = true;
-            this.Delete.Click += new System.EventHandler(this.Delete_Click);
-            // 
-            // ChooseAll
-            // 
-            this.ChooseAll.Location = new System.Drawing.Point(1, 55);
-            this.ChooseAll.Name = "ChooseAll";
-            this.ChooseAll.Size = new System.Drawing.Size(40, 22);
-            this.ChooseAll.TabIndex = 4;
-            this.ChooseAll.Text = "全选";
-            this.ChooseAll.UseVisualStyleBackColor = true;
-            // 
             // em_name
             // 
             this.em_name.ID = null;
@@ -234,6 +127,38 @@
             this.Screen.UseVisualStyleBackColor = true;
             this.Screen.Click += new System.EventHandler(this.Screen_Click);
             // 
+            // Choose
+            // 
+            this.Choose.HeaderText = "勾选";
+            this.Choose.Name = "Choose";
+            this.Choose.Width = 50;
+            // 
+            // lpp_emcode
+            // 
+            this.lpp_emcode.DataPropertyName = "em_code";
+            this.lpp_emcode.HeaderText = "员工编号";
+            this.lpp_emcode.Name = "lpp_emcode";
+            // 
+            // lpp_id
+            // 
+            this.lpp_id.DataPropertyName = "lpp_id";
+            this.lpp_id.HeaderText = "lpp_id";
+            this.lpp_id.Name = "lpp_id";
+            this.lpp_id.Visible = false;
+            // 
+            // em_na
+            // 
+            this.em_na.DataPropertyName = "em_name";
+            this.em_na.HeaderText = "员工姓名";
+            this.em_na.Name = "em_na";
+            this.em_na.ReadOnly = true;
+            // 
+            // lpp_manual
+            // 
+            this.lpp_manual.DataPropertyName = "lpp_manual";
+            this.lpp_manual.HeaderText = "允许手动采集";
+            this.lpp_manual.Name = "lpp_manual";
+            // 
             // PowerSetting
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -244,9 +169,6 @@
             this.Controls.Add(this.label1);
             this.Controls.Add(this.em_name);
             this.Controls.Add(this.si_expression4_label);
-            this.Controls.Add(this.ChooseAll);
-            this.Controls.Add(this.Delete);
-            this.Controls.Add(this.AddRow);
             this.Controls.Add(this.SaveGrid);
             this.Controls.Add(this.PowerSetDGV);
             this.Name = "PowerSetting";
@@ -262,9 +184,6 @@
 
         private CustomControl.DataGridViewWithSerialNum PowerSetDGV;
         private CustomControl.NormalButton SaveGrid;
-        private CustomControl.NormalButton AddRow;
-        private CustomControl.NormalButton Delete;
-        private CustomControl.ChooseAllButton ChooseAll;
         private CustomControl.EnterTextBox em_name;
         private System.Windows.Forms.Label si_expression4_label;
         private CustomControl.EnterTextBox em_code;
@@ -274,11 +193,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn lpp_emcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn lpp_id;
         private System.Windows.Forms.DataGridViewTextBoxColumn em_na;
-        private System.Windows.Forms.DataGridViewCheckBoxColumn lpp_cleandetail;
-        private System.Windows.Forms.DataGridViewCheckBoxColumn lpp_savedetail;
-        private System.Windows.Forms.DataGridViewCheckBoxColumn lpp_gencode;
-        private System.Windows.Forms.DataGridViewCheckBoxColumn lpp_collectstrategy;
-        private System.Windows.Forms.DataGridViewCheckBoxColumn lpp_allcollect;
-        private System.Windows.Forms.DataGridViewCheckBoxColumn lpp_labelmatain;
+        private System.Windows.Forms.DataGridViewCheckBoxColumn lpp_manual;
     }
 }

+ 13 - 30
UAS-出货标签管理(吉利通)/PowerSetting.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Data;
+using System.Text;
 using System.Windows.Forms;
 using UAS_LabelMachine.Entity;
 
@@ -23,47 +24,29 @@ namespace UAS_LabelMachine
         {
             dh = SystemInf.dh;
             LoadData();
-            ChooseAll.ChooseAll(PowerSetDGV);
-        }
-
-        private void AddRow_Click(object sender, EventArgs e)
-        {
-            if (PowerSetDGV.DataSource as DataTable != null)
-                (PowerSetDGV.DataSource as DataTable).Rows.Add();
         }
 
         private void SaveGrid_Click(object sender, EventArgs e)
         {
-            dt = (DataTable)PowerSetDGV.DataSource;
-            string sql = "insert into labelprintpower(lpp_id,lpp_emcode,LPP_CLEANDETAIL,LPP_GENCODE,LPP_LABELMATAIN,LPP_SAVEDETAIL,LPP_COLLECTSTRATEGY,";
-            sql += "LPP_ALLCOLLECT) values(labelprintpower_seq.nextval,:lpp_emcode,:LPP_CLEANDETAIL,:LPP_GENCODE,:LPP_LABELMATAIN,:LPP_SAVEDETAIL,";
-            sql += ":LPP_COLLECTSTRATEGY,:LPP_ALLCOLLECT)";
-            dh.UpDateTableByCondition(dt.GetChanges(), "labelprintpower", "lpp_id", sql.ToLower());
-            dh.ExecuteSql("insert into MessageLog (ml_id,ml_date,ml_man,ml_content,code) select MessageLog_seq.nextval,sysdate,'"+User.UserName+"','修改打印权限','LabelPrint' from dual", "insert");
-            LoadData();
-        }
-
-        private void Delete_Click(object sender, EventArgs e)
-        {
-            dt = (DataTable)PowerSetDGV.DataSource;
-            List<string> deleteid = new List<string>();
+            dt = ((DataTable)PowerSetDGV.DataSource).GetChanges();
+            StringBuilder sql = new StringBuilder();
+            List<string> SQLS = new List<string>();
             for (int i = 0; i < dt.Rows.Count; i++)
             {
-                if (PowerSetDGV.Rows[i].Cells["Choose"].FormattedValue.ToString() == "True")
-                {
-                    deleteid.Add(PowerSetDGV.Rows[i].Cells["lpp_id"].Value.ToString());
-                }
-            }
-            if (deleteid.ToArray().Length > 0)
-            {
-                dh.DeleteDataByID("labelprintpower", "lpp_id", deleteid.ToArray());
-                LoadData();
+                sql.Clear();
+                sql.Append("MERGE INTO labelprintpower alias1 USING (select '" + dt.Rows[i]["em_code"].ToString() + "' em_code from  dual) alias2 ");
+                sql.Append("ON (alias1.lpp_emcode=alias2.em_code) WHEN MATCHED THEN  UPDATE  SET lpp_manual = '" + dt.Rows[i]["lpp_manual"].ToString() + "' ");
+                sql.Append("WHEN NOT MATCHED THEN INSERT (lpp_id,lpp_emcode,lpp_manual) VALUES (labelprintpower_seq.nextval,");
+                sql.Append(" '" + dt.Rows[i]["em_code"].ToString() + "', '" + dt.Rows[i]["lpp_manual"].ToString() + "')");
+                SQLS.Add(sql.ToString());
             }
+            dh.ExecuteSQLTran(SQLS.ToArray());
+            LoadData();
         }
 
         private void LoadData()
         {
-            string sql = " select lpp_emcode,em_name,lpp_id,LPP_CLEANDETAIL,LPP_GENCODE,LPP_LABELMATAIN,LPP_SAVEDETAIL,LPP_COLLECTSTRATEGY,LPP_ALLCOLLECT from labelprintpower left join employee on em_code = lpp_emcode " + condition;
+            string sql = "select em_code,em_name,lpp_id,lpp_emcode,lpp_manual from employee left join labelprintpower on em_code = lpp_emcode " + condition;
             dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
             BaseUtil.FillDgvWithDataTable(PowerSetDGV, dt);
         }

+ 1 - 40
UAS-出货标签管理(吉利通)/PowerSetting.resx

@@ -129,22 +129,7 @@
   <metadata name="em_na.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="lpp_cleandetail.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="lpp_savedetail.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="lpp_gencode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="lpp_collectstrategy.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="lpp_allcollect.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="lpp_labelmatain.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="lpp_manual.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
@@ -158,30 +143,6 @@
         w4gTK17MuLHjow0iS55MubLly5gza958lIHnz6BDix5NurTp06iPGljNurXr17Bjy55Nu/bRALhz697N
         u7fv38CDCz9aoLjx48iTK1/OvLnz50cBSJ9Ovbr169iza9/O/eiA7+DDi0EfT768+fPo0x+FwL69+/fw
         48ufT7++/fX28+vfzz/+UQIABijggAQWaOCBCCao4FEaNejggxBG1NCEFFZoIUIBAQA7
-</value>
-  </data>
-  <data name="AddRow.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        R0lGODlhUgAXAIQAAK/G1qjB1dzn6bTK2MfZ46rE1arD1/D4+/n//d/o7/X6/ez1/K7D1tLj6+Pt9ubx
-        877S3fT09DxZeQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBF
-        Mi4wAwEBAAAh+QQAAAAAACwAAAAAUgAXAAAI/wAlCBxIsKDBgwgTKlzIsGCEhxAjSpxIsaLFixgzPhQY
-        AYHHjyBDihxJsqTJkygjcFTAsqXLlzBjypxJs6ZNlRIiHNjJs6fPn0CDCh1KtCjOCAuSKl3KtKnTp1Cj
-        Sp169IHVq1izat3KtavXr2Crgh1LtqzZrUcdqF3Ltq3bt3Djyp1L92iCu3jz6t3Lt6/fv4ADHxVAuLDh
-        w4gTK17MuLHjow0iS55MubLly5gza958lIHnz6BDix5NurTp06iPGljNurXr17Bjy55Nu/bRALhz697N
-        u7fv38CDCz9aoLjx48iTK1/OvLnz50cBSJ9Ovbr169iza9/O/eiA7+DDi0EfT768+fPo0x+FwL69+/fw
-        48ufT7++/fX28+vfzz/+UQIABijggAQWaOCBCCao4FEaNejggxBG1NCEFFZoIUIBAQA7
-</value>
-  </data>
-  <data name="Delete.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        R0lGODlhUgAXAIQAAK/G1qjB1dzn6bTK2MfZ46rE1arD1/D4+/n//d/o7/X6/ez1/K7D1tLj6+Pt9ubx
-        877S3fT09DxZeQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBF
-        Mi4wAwEBAAAh+QQAAAAAACwAAAAAUgAXAAAI/wAlCBxIsKDBgwgTKlzIsGCEhxAjSpxIsaLFixgzPhQY
-        AYHHjyBDihxJsqTJkygjcFTAsqXLlzBjypxJs6ZNlRIiHNjJs6fPn0CDCh1KtCjOCAuSKl3KtKnTp1Cj
-        Sp169IHVq1izat3KtavXr2Crgh1LtqzZrUcdqF3Ltq3bt3Djyp1L92iCu3jz6t3Lt6/fv4ADHxVAuLDh
-        w4gTK17MuLHjow0iS55MubLly5gza958lIHnz6BDix5NurTp06iPGljNurXr17Bjy55Nu/bRALhz697N
-        u7fv38CDCz9aoLjx48iTK1/OvLnz50cBSJ9Ovbr169iza9/O/eiA7+DDi0EfT768+fPo0x+FwL69+/fw
-        48ufT7++/fX28+vfzz/+UQIABijggAQWaOCBCCao4FEaNejggxBG1NCEFFZoIUIBAQA7
 </value>
   </data>
 </root>

+ 16 - 7
UAS-出货标签管理(吉利通)/PublicMethod/DataHelper.cs

@@ -956,17 +956,17 @@ namespace UAS_LabelMachine
             {
                 if (names[0][i - 1].ToString().ToUpper().Contains("DATE"))
                 {
+                    DateTime[] time = new DateTime[names[i].Length];
+                    for (int j = 0; j < names[i].Length; j++)
+                    {
+                        time[j] = Convert.ToDateTime(names[i][j]);
+                    }
                     try
                     {
-                        DateTime[] time = new DateTime[names[i].Length];
-                        for (int j = 0; j < names[i].Length; j++)
-                        {
-                            time[j] = Convert.ToDateTime(names[i][j]);
-                        }
                         command.Parameters.Add(new OracleParameter(names[0][i - 1].ToString(), OracleDbType.Date, time, ParameterDirection.Input));
                     }
                     catch (Exception)
-                    {   
+                    {
                         command.Parameters.Add(new OracleParameter(names[0][i - 1].ToString(), OracleDbType.Varchar2, names[i], ParameterDirection.Input));
                     }
                 }
@@ -975,7 +975,16 @@ namespace UAS_LabelMachine
                     command.Parameters.Add(new OracleParameter(names[0][i - 1].ToString(), OracleDbType.Varchar2, names[i], ParameterDirection.Input));
                 }
             }
-            command.ExecuteNonQuery();
+            try
+            {
+                command.ExecuteNonQuery();
+            }
+            catch (Exception)
+            {
+                command.Connection = new OracleConnection(DBConnectionString);
+                command.Connection.Open();
+                command.ExecuteNonQuery();
+            }
             command.Dispose();
         }
 

+ 8 - 47
UAS-出货标签管理(吉利通)/PublicMethod/GlobalEventsHandler.cs

@@ -24,9 +24,9 @@ namespace UAS_Labeling.PublicMethod
             //通过句柄去获取具体触发事件的控件
             Control c = Control.FromHandle(m.HWnd);
             //可进行数据操作的控件需要进行权限的判断,结合WM_LBUTTONDOWN对按钮进行判断
-            if (c != null && m.Msg == WM_LBUTTONDOWN && c is Button)
+            if (c != null && m.Msg == WM_LBUTTONDOWN && c is RadioButton)
             {
-                LogManager.DoLog("点击【" + c.Text+"】");
+                LogManager.DoLog("点击【" + c.Text + "】");
                 return CheckPower(c);
             }
             else
@@ -46,60 +46,21 @@ namespace UAS_Labeling.PublicMethod
             {
                 if (dh.getRowCount("labelprintpower") > 0)
                 {
-                    string sql = " select LPP_CLEANDETAIL,LPP_GENCODE,LPP_LABELMATAIN,LPP_SAVEDETAIL,LPP_COLLECTSTRATEGY,LPP_ALLCOLLECT from labelprintpower left join employee on em_code = lpp_emcode where lpp_emcode = '" + User.UserCode + "'";
+                    string sql = " select * from labelprintpower where lpp_emcode = '" + User.UserCode + "' and lpp_manual=1";
                     DataTable dt = (DataTable)dh.ExecuteSql(sql, "select");
                     if (dt.Rows.Count > 0)
                     {
-                        switch (c.Text)
+                        switch (c.Name)
                         {
-                            case "采集策略设置":
-                                if (dt.Rows[0]["LPP_COLLECTSTRATEGY"].ToString() != "1")
-                                {
-                                    MessageBox.Show("没有" + c.Text + "的权限");
-                                    return true;
-                                }
-                                break;
-                            case "生成条码":
-                                if (dt.Rows[0]["LPP_GENCODE"].ToString() != "1")
-                                {
-                                    MessageBox.Show("没有" + c.Text + "的权限");
-                                    return true;
-                                }
-                                break;
-                            case "标签维护":
-                                if (dt.Rows[0]["LPP_LABELMATAIN"].ToString() != "1")
-                                {
-                                    MessageBox.Show("没有" + c.Text + "的权限");
-                                    return true;
-                                }
-                                break;
-                            case "保存明细":
-                                if (dt.Rows[0]["LPP_SAVEDETAIL"].ToString() != "1")
-                                {
-                                    MessageBox.Show("没有" + c.Text + "的权限");
-                                    return true;
-                                }
-                                break;
-                            case "清除明细":
-                                if (dt.Rows[0]["LPP_CLEANDETAIL"].ToString() != "1")
-                                {
-                                    MessageBox.Show("没有" + c.Text + "的权限");
-                                    return true;
-                                }
-                                break;
-                            case "全部已采":
-                                if (dt.Rows[0]["LPP_ALLCOLLECT"].ToString() != "1")
-                                {
-                                    MessageBox.Show("没有" + c.Text + "的权限");
-                                    return true;
-                                }
+                            case "ManualCollection":
                                 break;
                             default:
                                 break;
                         }
                     }
-                    else {
-                        MessageBox.Show("尚未配置权限,请与管理员联系");
+                    else
+                    {
+                        MessageBox.Show("尚未配置权限,请与管理员联系", "提示");
                         return true;
                     }
                 }

+ 31 - 30
UAS-出货标签管理(吉利通)/UAS_出货标签管理.Designer.cs

@@ -115,8 +115,8 @@
             this.RecheckCuprodcode = new System.Windows.Forms.RadioButton();
             this.DetailRange = new System.Windows.Forms.CheckBox();
             this.label21 = new System.Windows.Forms.Label();
-            this.radioButton1 = new System.Windows.Forms.RadioButton();
-            this.radioButton2 = new System.Windows.Forms.RadioButton();
+            this.ManualCollection = new System.Windows.Forms.RadioButton();
+            this.AutoCollection = new System.Windows.Forms.RadioButton();
             this.Process_midboxcode = new System.Windows.Forms.Label();
             this.Process_outboxcode = new System.Windows.Forms.Label();
             this.CollectedCount = new System.Windows.Forms.Label();
@@ -563,7 +563,8 @@
             "附加信息设置",
             "客户标签维护",
             "客户采集规则",
-            "参数配置"});
+            "参数配置",
+            "权限管理"});
             this.ListButtonMenu.Location = new System.Drawing.Point(232, 89);
             this.ListButtonMenu.Name = "ListButtonMenu";
             this.ListButtonMenu.Size = new System.Drawing.Size(97, 84);
@@ -789,8 +790,8 @@
             this.CollectionProcess.Controls.Add(this.RecheckCuprodcode);
             this.CollectionProcess.Controls.Add(this.DetailRange);
             this.CollectionProcess.Controls.Add(this.label21);
-            this.CollectionProcess.Controls.Add(this.radioButton1);
-            this.CollectionProcess.Controls.Add(this.radioButton2);
+            this.CollectionProcess.Controls.Add(this.ManualCollection);
+            this.CollectionProcess.Controls.Add(this.AutoCollection);
             this.CollectionProcess.Controls.Add(this.Process_midboxcode);
             this.CollectionProcess.Controls.Add(this.Process_outboxcode);
             this.CollectionProcess.Controls.Add(this.CollectedCount);
@@ -1096,29 +1097,29 @@
             this.label21.TabIndex = 90;
             this.label21.Text = "-";
             // 
-            // radioButton1
-            // 
-            this.radioButton1.AutoSize = true;
-            this.radioButton1.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.radioButton1.Location = new System.Drawing.Point(64, 116);
-            this.radioButton1.Name = "radioButton1";
-            this.radioButton1.Size = new System.Drawing.Size(50, 21);
-            this.radioButton1.TabIndex = 77;
-            this.radioButton1.TabStop = true;
-            this.radioButton1.Text = "手动";
-            this.radioButton1.UseVisualStyleBackColor = true;
-            // 
-            // radioButton2
-            // 
-            this.radioButton2.AutoSize = true;
-            this.radioButton2.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.radioButton2.Location = new System.Drawing.Point(8, 116);
-            this.radioButton2.Name = "radioButton2";
-            this.radioButton2.Size = new System.Drawing.Size(50, 21);
-            this.radioButton2.TabIndex = 76;
-            this.radioButton2.TabStop = true;
-            this.radioButton2.Text = "自动";
-            this.radioButton2.UseVisualStyleBackColor = true;
+            // ManualCollection
+            // 
+            this.ManualCollection.AutoSize = true;
+            this.ManualCollection.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.ManualCollection.Location = new System.Drawing.Point(64, 116);
+            this.ManualCollection.Name = "ManualCollection";
+            this.ManualCollection.Size = new System.Drawing.Size(50, 21);
+            this.ManualCollection.TabIndex = 77;
+            this.ManualCollection.TabStop = true;
+            this.ManualCollection.Text = "手动";
+            this.ManualCollection.UseVisualStyleBackColor = true;
+            // 
+            // AutoCollection
+            // 
+            this.AutoCollection.AutoSize = true;
+            this.AutoCollection.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.AutoCollection.Location = new System.Drawing.Point(8, 116);
+            this.AutoCollection.Name = "AutoCollection";
+            this.AutoCollection.Size = new System.Drawing.Size(50, 21);
+            this.AutoCollection.TabIndex = 76;
+            this.AutoCollection.TabStop = true;
+            this.AutoCollection.Text = "自动";
+            this.AutoCollection.UseVisualStyleBackColor = true;
             // 
             // Process_midboxcode
             // 
@@ -2382,8 +2383,8 @@
         private System.Windows.Forms.Label CollectedCount;
         private System.Windows.Forms.Label Process_outboxcode;
         private System.Windows.Forms.Label Process_midboxcode;
-        private System.Windows.Forms.RadioButton radioButton2;
-        private System.Windows.Forms.RadioButton radioButton1;
+        private System.Windows.Forms.RadioButton AutoCollection;
+        private System.Windows.Forms.RadioButton ManualCollection;
         private System.Windows.Forms.Label label21;
         private System.Windows.Forms.CheckBox DetailRange;
         private System.Windows.Forms.RadioButton RecheckCuprodcode;

+ 6 - 1
UAS-出货标签管理(吉利通)/UAS_出货标签管理.cs

@@ -306,7 +306,7 @@ namespace UAS_LabelMachine
                                 }
                                 else if (Expression.Checked)
                                 {
-                                    
+
                                 }
                                 if (msgArr[i] == LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodspec"].Value.ToString())
                                 {
@@ -1545,6 +1545,11 @@ namespace UAS_LabelMachine
                     BaseUtil.SetFormCenter(form2);
                     form2.ShowDialog();
                     break;
+                case "权限管理":
+                    PowerSetting pws = new PowerSetting();
+                    BaseUtil.SetFormCenter(pws);
+                    pws.ShowDialog();
+                    break;
                 default:
                     break;
             }