From 12b53bc939e70508f1c9b0169ee32165e1959f7d Mon Sep 17 00:00:00 2001
From: zzr99 <1940172413@qq.com>
Date: 星期一, 06 九月 2021 18:57:15 +0800
Subject: [PATCH] 设备保养计划单列表双网格修订,加载列表页面的接口视图重写

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

diff --git a/WebAPI/Controllers/PublicPageMethodController.cs b/WebAPI/Controllers/PublicPageMethodController.cs
index e5308b8..410fe8d 100644
--- a/WebAPI/Controllers/PublicPageMethodController.cs
+++ b/WebAPI/Controllers/PublicPageMethodController.cs
@@ -1794,7 +1794,7 @@
                 }
                 else
                 {
-                    string sql1 = "Select HItemID,HParentID,HNumber,HName from h_v_IF_Unit where 1 = 1 ";
+                    string sql1 = "Select HItemID,HParentID,HNumber,HName from h_v_IF_Unit ";
                     string sql = sql1 + sWhere;
                     ds = oCN.RunProcReturn(sql, "h_v_IF_Unit");
                 }
@@ -2007,6 +2007,990 @@
 
         #endregion
 
+        #region 閫夋嫨淇濆吇椤圭洰鍩虹璧勬枡
+
+        #region 鏉′欢鏌ヨ淇濆吇椤圭洰鍒楄〃
+        [Route("PublicPageMethod/MaintainList")]
+        [HttpGet]
+        public object MaintainList(string sWhere)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_Maintain " + sWhere + " Order by HItemID ", "Gy_Maintain");
+                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/MaintainCX")]
+        [HttpGet]
+        public object MaintainCX(long HInterID)
+        {
+            try
+            {
+
+                ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_Maintain WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_Maintain AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_Maintain");
+                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/MaintainLoadTree")]
+        [HttpGet]
+        public object MaintainLoadTree(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 Gy_Maintain " + sWhere + "", "Gy_Maintain");
+            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
+
+        #region 閫夋嫨妫�楠岄」鐩熀纭�璧勬枡
+
+        #region 鏉′欢鏌ヨ妫�楠岄」鐩垪琛�
+        [Route("PublicPageMethod/CheckItemList")]
+        [HttpGet]
+        public object CheckItemList(string sWhere)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_QCCheckItem " + sWhere + " Order by HItemID ", "Gy_QCCheckItem");
+                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/CheckItemCX")]
+        [HttpGet]
+        public object CheckItemCX(long HInterID)
+        {
+            try
+            {
+
+                ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_QCCheckItem WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_QCCheckItem AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_QCCheckItem");
+                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/CheckItemLoadTree")]
+        [HttpGet]
+        public object CheckItemLoadTree(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 Gy_QCCheckItem " + sWhere + "", "Gy_QCCheckItem");
+            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
+
+        #region 閫夋嫨鐗╂枡绫诲瀷鍩虹璧勬枡
+
+        #region 鏉′欢鏌ヨ鐗╂枡绫诲瀷鍒楄〃
+        [Route("PublicPageMethod/MaterTypeList")]
+        [HttpGet]
+        public object MaterTypeList(string sWhere)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_MaterType " + sWhere + " Order by HItemID ", "Gy_MaterType");
+                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/MaterTypeCX")]
+        [HttpGet]
+        public object MaterTypeCX(long HInterID)
+        {
+            try
+            {
+
+                ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_MaterType WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_MaterType AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_QCCheckItem");
+                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/MaterTypeLoadTree")]
+        [HttpGet]
+        public object MaterTypeLoadTree(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 Gy_MaterType " + sWhere + "", "Gy_MaterType");
+            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
+
+        #region 閫夋嫨宸ヨ壓璺嚎鍩虹璧勬枡
+
+        #region 鏉′欢鏌ヨ宸ヨ壓璺嚎鍒楄〃
+        [Route("PublicPageMethod/RouteList")]
+        [HttpGet]
+        public object RouteList(string sWhere)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("select HItemID,'' HParentID,HNumber,HName  from h_v_IF_MouldRouting " + sWhere + " Order by HItemID ", "h_v_IF_MouldRouting");
+                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
+
+        #endregion
+
+        #region 閫夋嫨BOM缁勫熀纭�璧勬枡
+
+        #region 鏉′欢鏌ヨBOM缁勫垪琛�
+        [Route("PublicPageMethod/BomGroupList")]
+        [HttpGet]
+        public object BomGroupList(string sWhere)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_ICBomGroup " + sWhere + " Order by HItemID ", "Gy_ICBomGroup");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃燘OM鏁版嵁锛�";
+                    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鏌ユ壘BOM缁勫垪琛�   
+        [Route("Gy_MaintenanceMode/BomGroupCX")]
+        [HttpGet]
+        public object BomGroupCX(long HInterID)
+        {
+            try
+            {
+
+                ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_ICBomGroup WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_ICBomGroup AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_ICBomGroup");
+                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 鏍戝瀷鍒楄〃BOM缁勫垪琛ㄦ暟鎹�    
+        [Route("Gy_MaintenanceMode/BomGroupLoadTree")]
+        [HttpGet]
+        public object BomGroupLoadTree(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 Gy_ICBomGroup " + sWhere + "", "Gy_ICBomGroup");
+            if (ds == null || ds.Tables[0].Rows.Count == 0)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏃燘OM鏁版嵁锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            else
+            {
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #endregion
+
+        #region 閫夋嫨浠撲綅缁勫熀纭�璧勬枡
+
+        #region 鏉′欢鏌ヨ浠撲綅缁勫垪琛�
+        [Route("PublicPageMethod/HSPGroupList")]
+        [HttpGet]
+        public object HSPGroupList(string sWhere)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_StockPlaceGroup " + sWhere + " Order by HItemID ", "Gy_StockPlaceGroup");
+                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/HSPGroupCX")]
+        [HttpGet]
+        public object HSPGroupCX(long HInterID)
+        {
+            try
+            {
+
+                ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_StockPlaceGroup WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_StockPlaceGroup AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_StockPlaceGroup");
+                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/HSPGroupLoadTree")]
+        [HttpGet]
+        public object HSPGroupLoadTree(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 Gy_StockPlaceGroup " + sWhere + "", "Gy_StockPlaceGroup");
+            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
+
+        #region 閫夋嫨鍦板尯鍩虹璧勬枡
+
+        #region 鏉′欢鏌ヨ鍦板尯鍒楄〃
+        [Route("PublicPageMethod/AreaList")]
+        [HttpGet]
+        public object AreaList(string sWhere)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_AreaSet " + sWhere + " Order by HItemID ", "Gy_AreaSet");
+                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/AreaCX")]
+        [HttpGet]
+        public object AreaCX(long HInterID)
+        {
+            try
+            {
+
+                ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_AreaSet WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_AreaSet AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_AreaSet");
+                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/AreaLoadTree")]
+        [HttpGet]
+        public object AreaLoadTree(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 Gy_AreaSet " + sWhere + "", "Gy_AreaSet");
+            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
+
+        #region 閫夋嫨璐у竵鍩虹璧勬枡
+
+        #region 鏉′欢鏌ヨ璐у竵鍒楄〃
+        [Route("PublicPageMethod/CurrencyList")]
+        [HttpGet]
+        public object CurrencyList(string sWhere)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_Currency " + sWhere + " Order by HItemID ", "Gy_Currency");
+                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/CurrencyCX")]
+        [HttpGet]
+        public object CurrencyCX(long HInterID)
+        {
+            try
+            {
+
+                ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_Currency WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_Currency AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_Currency");
+                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/CurrencyLoadTree")]
+        [HttpGet]
+        public object CurrencyLoadTree(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 Gy_Currency " + sWhere + "", "Gy_Currency");
+            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
+
+        #region 閫夋嫨缁撶畻鏂瑰紡鍩虹璧勬枡
+
+        #region 鏉′欢鏌ヨ缁撶畻鏂瑰紡鍒楄〃
+        [Route("PublicPageMethod/SettleStyleList")]
+        [HttpGet]
+        public object SettleStyleList(string sWhere)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_SettleStyle " + sWhere + " Order by HItemID ", "Gy_SettleStyle");
+                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/SettleStyleCX")]
+        [HttpGet]
+        public object SettleStyleCX(long HInterID)
+        {
+            try
+            {
+
+                ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_SettleStyle WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_SettleStyle AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_SettleStyle");
+                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/SettleStyleLoadTree")]
+        [HttpGet]
+        public object SettleStyleLoadTree(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 Gy_SettleStyle " + sWhere + "", "Gy_SettleStyle");
+            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
+
+        #region 閫夋嫨瀹㈡埛鍒嗙被鍩虹璧勬枡
+
+        #region 鏉′欢鏌ヨ瀹㈡埛鍒嗙被鍒楄〃
+        [Route("PublicPageMethod/CusTypeList")]
+        [HttpGet]
+        public object CusTypeList(string sWhere)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("Select HItemID,HParentID,HNumber,HName from Gy_CusType " + sWhere + " Order by HItemID ", "Gy_CusType");
+                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/CusTypeCX")]
+        [HttpGet]
+        public object CusTypeCX(long HInterID)
+        {
+            try
+            {
+
+                ds = oCN.RunProcReturn(string.Format(@"WITH a AS (select * from Gy_CusType WHERE HitemID=" + HInterID + " UNION ALL select s.* from Gy_CusType AS s,a WHERE s.hparentid=a.HitemID) SELECT * FROM a"), "Gy_CusType");
+                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/CusTypeLoadTree")]
+        [HttpGet]
+        public object CusTypeLoadTree(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 Gy_CusType " + sWhere + "", "Gy_CusType");
+            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