From 19c616c00b49b4785ff429780f8295ceb8171bd5 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 28 八月 2023 10:04:03 +0800
Subject: [PATCH] 异常反馈单 列表

---
 Pub_Class/CustomerCls/ClsPub.cs |  109 ++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 101 insertions(+), 8 deletions(-)

diff --git a/Pub_Class/CustomerCls/ClsPub.cs b/Pub_Class/CustomerCls/ClsPub.cs
index e5e8dcb..a6d9f87 100644
--- a/Pub_Class/CustomerCls/ClsPub.cs
+++ b/Pub_Class/CustomerCls/ClsPub.cs
@@ -919,7 +919,7 @@
                 {
                     if (Msg == true)
                     {
-                        MessageBox.Show("娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒", "鎻愮ず");
+                        MessageBox.Show("娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒" + gnsy.Trim() + "," + CurUserName.Trim(), "鎻愮ず");
                     }
                     return false;
                 }
@@ -930,12 +930,12 @@
                 if (LogTF == 1 || LogTF == 3)//闇�瑕佸垽鏂潈闄�
                 {
                     //鏍规嵁鐢ㄦ埛鍚嶇О鍒ゆ柇鏉冮檺
-                    DsUser = oCn.RunProcReturn("select * from gy_czygl where czymc='" + UserID.Trim() + "'", "gy_czygl");
+                    DsUser = oCn.RunProcReturn("select ManagerFlag,isnull(AuthorityID,'') AuthorityID,Czybm from gy_czygl where czymc='" + UserID.Trim() + "'", "gy_czygl");
                     if (DsUser.Tables[0].Rows.Count == 0)
                     {
                         if (Msg == true)
                         {
-                            MessageBox.Show("娌℃湁鎵惧埌褰撳墠鎿嶄綔鍛橈紒", "鎻愮ず");
+                            MessageBox.Show("娌℃湁鎵惧埌褰撳墠鎿嶄綔鍛橈紒" + gnsy.Trim() + "," + CurUserName.Trim(), "鎻愮ず");
                         }
                         return false;
                     }
@@ -946,7 +946,8 @@
                     }
                     else
                     {
-                        if (DsUser.Tables[0].Rows[0]["AuthorityID"].ToString().Trim().Substring((int)ModID - 1, 1) == "1")
+                        if (ClsPub.isStrNull(DsUser.Tables[0].Rows[0]["AuthorityID"]).Length >= ModID
+                            && DsUser.Tables[0].Rows[0]["AuthorityID"].ToString().Trim().Substring((int)ModID - 1, 1) == "1")
                         {
                             HavRight = true;
                         }
@@ -955,14 +956,14 @@
                             //鑾峰彇鐢ㄦ埛缁�  骞跺惊鐜垽鏂潈闄�
                             //鍒ゆ柇瑙掕壊鏄惁鏈夋潈闄�
                             DsJS = oCn.RunProcReturn("select isnull(AuthorityID,'') AuthorityID from System_UserGroupinfo a inner join System_UserGroup b on a.GroupID=b.GroupID " + 
-                                " Where a.USERID='" + UserID.Trim() + "'", "gy_czygl");
+                                " Where a.USERID='" + DsUser.Tables[0].Rows[0]["Czybm"].ToString().Trim() + "'", "gy_czygl");
                             if (DsJS == null)
                             {
                                 HavRight = false;
                             }
                             else
                             {
-                                HavRight = false;
+                                //HavRight = false;
                                 for (int i = 0; i < DsJS.Tables[0].Rows.Count; i++)
                                 {
                                     if (ClsPub.isStrNull(DsJS.Tables[0].Rows[i]["AuthorityID"]).Length > ModID)
@@ -983,7 +984,7 @@
                     {
                         if (Msg == true)
                         {
-                            MessageBox.Show("鎮ㄦ病鏈夋潈闄�,璇蜂笌绠$悊鍛樿仈绯伙紒", "鎻愮ず");
+                            MessageBox.Show("鎮ㄦ病鏈夋潈闄�,璇蜂笌绠$悊鍛樿仈绯伙紒" + gnsy.Trim() + "," + CurUserName.Trim(), "鎻愮ず");
                         }
                     }
                 }
@@ -998,7 +999,7 @@
             {
                 if (Msg == true)
                 {
-                    MessageBox.Show("鍒ゆ柇鏉冮檺鏃跺彂鐜伴敊璇�,璇蜂笌绠$悊鍛樿仈绯伙紒", "鎻愮ず");
+                    MessageBox.Show("鍒ゆ柇鏉冮檺鏃跺彂鐜伴敊璇�,璇蜂笌绠$悊鍛樿仈绯伙紒" + gnsy.Trim() + "," + CurUserName.Trim(), "鎻愮ず");
                 }
                 return false;
             }
@@ -2502,5 +2503,97 @@
             }
             return sb.ToString();
         }
+
+        //鎷兼帴sql锛屾寜杞﹂棿锛屽伐浣滀腑蹇冩煡璇�
+        public static string SpliceSQL(string czymc,string ListName)
+        {
+            DataSet ds;
+            ClsSqlHelper oCN = new ClsSqlHelper();
+            string sql = "";
+
+            //鍒ゆ柇鏄惁鏈夋煡璇㈠垪琛ㄦ墍鏈変俊鎭潈闄�
+            if (!Security_Log("Xt_List_All", 1, false, czymc))
+            {
+                //鏃�
+                switch (ListName)
+                {
+                    case "宸ヨ壓璺嚎鍒楄〃":
+                        sql = " and HCenterID in (select HWorkCenterID from Gy_UserWorkCenterRelation where HUserID = (select Czybm from gy_czygl where czymc = '" + czymc + "'))";
+                        break;
+                    case "鐢熶骇璁㈠崟鍒楄〃":
+                        sql = " and HDeptID in (select HDeptID from Gy_UserDeptRelation where HUserID = (select Czybm from gy_czygl where czymc = '" + czymc + "'))";
+                        break;
+                    case "宸ュ簭娲惧伐鍗曞垪琛�":
+                        sql = " and HDeptID in (select HDeptID from Gy_UserDeptRelation where HUserID = (select Czybm from gy_czygl where czymc = '" + czymc + "'))";
+                        break;
+                    case "宸ュ簭娲惧伐鍗曟槑缁嗗垪琛�":
+                        sql = " and HDeptID in (select HDeptID from Gy_UserDeptRelation where HUserID = (select Czybm from gy_czygl where czymc = '" + czymc + "'))";
+                        break;
+                    case "宸ュ簭姹囨姤鍗曞垪琛�":
+                        sql = " and HCenterID in (select HWorkCenterID from Gy_UserWorkCenterRelation where HUserID = (select Czybm from gy_czygl where czymc = '" + czymc + "'))";
+                        break;
+                    case "鐢熶骇杞﹂棿宸ュ簭鎶ヨ〃":
+                        sql = ",'" + czymc +"'";
+                        break;
+                    case "宸ュ簭鍦ㄥ埗鍝佹姤琛�":
+                        sql = ",'" + czymc + "'";
+                        break;
+                    case "宸ュ簭姹囨姤鏃ユ姤琛�":
+                        sql = ",'" + czymc + "'";
+                        break;
+                    case "璁′欢宸ヨ祫鎶ヨ〃":
+                        sql = ",'" + czymc + "'";
+                        break;
+                    case "璁′欢宸ヨ祫姹囨�绘姤琛�":
+                        sql = ",'" + czymc + "'";
+                        break;
+                }
+                return sql;
+            }
+            else
+            {
+                //鏈�
+                return sql;
+            }
+
+            //ds = oCN.RunProcReturn("select * from gy_czygl where Czymc='" + czymc + "'", "gy_czygl");
+            ////鍒ゆ柇鏄惁鏌ヨ鍒扮浉鍏崇敤鎴蜂俊鎭�
+            //if (ds != null || ds.Tables[0].Rows.Count != 0)
+            //{
+            //    Int64 HManagerFlag = Convert.ToInt64(ds.Tables[0].Rows[0]["ManagerFlag"]);
+            //    if (HManagerFlag == 1)//鏈夌鐞嗗憳鏉冮檺
+            //    {
+            //        return sql;
+            //    }
+            //    else //娌℃湁绠$悊鍛樻潈闄�
+            //    {
+            //        switch (ListName)
+            //        {
+            //            case "宸ヨ壓璺嚎鍒楄〃":
+            //                sql = " and HCenterID in (select HWorkCenterID from Gy_UserWorkCenterRelation where HUserID = (select Czybm from gy_czygl where czymc = '" + czymc + "'))";
+            //                break;
+            //            case "鐢熶骇璁㈠崟鍒楄〃":
+            //                sql = " and HDeptID in (select HDeptID from Gy_UserDeptRelation where HUserID = (select Czybm from gy_czygl where czymc = '" + czymc + "'))";
+            //                break;
+            //            case "宸ュ簭娲惧伐鍗曞垪琛�":
+            //                sql = " and HDeptID in (select HDeptID from Gy_UserDeptRelation where HUserID = (select Czybm from gy_czygl where czymc = '" + czymc + "'))";
+            //                break;
+            //            case "宸ュ簭娲惧伐鍗曟槑缁嗗垪琛�":
+            //                sql = " and HDeptID in (select HDeptID from Gy_UserDeptRelation where HUserID = (select Czybm from gy_czygl where czymc = '" + czymc + "'))";
+            //                break;
+            //            case "宸ュ簭姹囨姤鍗曞垪琛�":
+            //                sql = " and HCenterID in (select HWorkCenterID from Gy_UserWorkCenterRelation where HUserID = (select Czybm from gy_czygl where czymc = '" + czymc + "'))";
+            //                break;
+            //        }                   
+            //        return sql;
+            //    }
+            //}
+            //else
+            //{
+            //    sql = "娌℃湁鏌ヨ鍒扮浉鍏崇敤鎴蜂俊鎭�";
+            //    return sql;
+            //}
+        }
+
     }
 }

--
Gitblit v1.9.1