From 33a5c824cc07854081e08aa9344bafe00cd03fc7 Mon Sep 17 00:00:00 2001
From: 仲国强 <519541279@qq.com>
Date: 星期三, 25 八月 2021 22:00:34 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/BaseSet/Gy_DepartmentController.cs | 80 +---------------------------------------
1 files changed, 2 insertions(+), 78 deletions(-)
diff --git a/WebAPI/Controllers/BaseSet/Gy_DepartmentController.cs b/WebAPI/Controllers/BaseSet/Gy_DepartmentController.cs
index 224833f..465de7c 100644
--- a/WebAPI/Controllers/BaseSet/Gy_DepartmentController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_DepartmentController.cs
@@ -512,27 +512,8 @@
public object LoadTree_Json(string sWhere)
{
SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN();
- string sSql = "";
- // sSql = "select Name title,code id from province where code=330000 ";
- //sSql = "Select HItemID id,HName title,HParentID HParentID,1 HLevel,'true' lazy from Gy_Department";
- //List<Tree_Model> GetRegionList = GetRegion(sSql);
- //if (GetRegionList == null)
- //{
- // objJsonResult.code = "0";
- // objJsonResult.count = 0;
- // objJsonResult.Message = "鏄剧ず澶辫触锛佸師鍥狅細" + DBUtility.ClsPub.sExeReturnInfo;
- // objJsonResult.data = null;
- // return objJsonResult;
- //}
- //else
- //{
- // objJsonResult.code = "0";
- // objJsonResult.count = 1;
- // objJsonResult.Message = "鑾峰彇鎴愬姛锛�";
- // objJsonResult.data = GetRegionList;
- // return objJsonResult;
- //}
- ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList");
+ //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList");
+ ds = oCN.RunProcReturn("select * from h_v_DepartmentLoadTree", "h_v_DepartmentLoadTree");
if (ds == null || ds.Tables[0].Rows.Count == 0)
{
objJsonResult.code = "0";
@@ -551,64 +532,7 @@
}
}
- public List<Tree_Model> GetRegion(string sSql)
- {
- try
- {
- SqlDataReader reader = GetReader(sSql);
- List<Tree_Model> ModuleList = new List<Tree_Model>();
- while (reader.Read())
- {
- ModuleList.Add(new Tree_Model()
- {
- id = Convert.ToInt32(reader["id"]),
- HParentID = Convert.ToInt32(reader["HParentID"]),
- HLevel = Convert.ToInt32(reader["HLevel"]),
- lazy = Convert.ToBoolean(reader["lazy"]),
- title = reader["title"].ToString()
- });
- }
- reader.Close();
- return ModuleList;
- }
- catch(Exception e)
- {
- return null;
- }
- }
- public class Tree_Model
- {
- public long id;
- public string title;
- public string code;
- public long HParentID;
- public string HParentName;
- public long HLevel;
- public bool lazy;
- }
- public static SqlDataReader GetReader(string sql)
- {
- SqlConnection conn = new SqlConnection("Data Source=192.168.0.175;Initial Catalog=HX_LimsSys;User Id=HX_USER,Password=lc@841022;Integrated Security=True");
- SqlCommand cmd = new SqlCommand(sql, conn);
- try
- {
- conn.Open();
- SqlDataReader objReader =
- cmd.ExecuteReader(CommandBehavior.CloseConnection);
- return objReader;
- }
- catch (Exception ex)
- {
- conn.Close();
- throw ex;
- }
- //finally
- //{
- // conn.Close();
- // conn.Dispose();
- //}
- }
//
}
--
Gitblit v1.9.1