From 756c87c9467e9ba5ec472ca3e39fd9ad58eb85c5 Mon Sep 17 00:00:00 2001
From: YL <YL@LAPTOP-SE03PLUR>
Date: 星期一, 18 十月 2021 08:45:02 +0800
Subject: [PATCH] 动态菜单

---
 WebAPI/Controllers/PublicPageMethodController.cs |  106 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 106 insertions(+), 0 deletions(-)

diff --git a/WebAPI/Controllers/PublicPageMethodController.cs b/WebAPI/Controllers/PublicPageMethodController.cs
index 410fe8d..95086de 100644
--- a/WebAPI/Controllers/PublicPageMethodController.cs
+++ b/WebAPI/Controllers/PublicPageMethodController.cs
@@ -2992,6 +2992,112 @@
 
         #endregion
 
+        #region 閫夋嫨鐧诲綍缁勭粐鍩虹璧勬枡
+
+        #region 鏉′欢鏌ヨ缁勭粐鍒楄〃
+        [Route("PublicPageMethod/OrganizationsList")]
+        [HttpGet]
+        public object OrganizationsList(string sWhere)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Xt_ORGANIZATIONS " + sWhere + " Order by HItemID ", "Xt_ORGANIZATIONS");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犵粍缁囨暟鎹紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "Sucess锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region  鏍规嵁鏍戝瀷id鏌ユ壘缁勭粐鍒楄〃   
+        [Route("Gy_MaintenanceMode/OrganizationsCX")]
+        [HttpGet]
+        public object OrganizationsCX(long HInterID)
+        {
+            try
+            {
+
+                ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_CusType Xt_ORGANIZATIONS HitemID=" + HInterID + " UNION ALL select s.* from Xt_ORGANIZATIONS AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Xt_ORGANIZATIONS");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "false锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "Sucess锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 鏍戝瀷鍒楄〃缁勭粐鍒楄〃鏁版嵁    
+        [Route("Gy_MaintenanceMode/OrganizationsLoadTree")]
+        [HttpGet]
+        public object OrganizationsLoadTree(string sWhere)
+        {
+            SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN();
+            //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList");
+
+            ds = oCN.RunProcReturn("Select HItemID id,HNumber,(CAST(HNumber as varchar(100))+'-'+CAST(HName as varchar(100))) as title,HParentID ParentID,HLevel from Xt_ORGANIZATIONS " + sWhere + "", "Xt_ORGANIZATIONS");
+            if (ds == null || ds.Tables[0].Rows.Count == 0)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏃犵粍缁囨暟鎹紒";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            else
+            {
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #endregion
+
+       
 
     }
 }

--
Gitblit v1.9.1