From 2609bffee3a8de0d1e08b1b2c3fa3cfe13064f4e Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 24 三月 2025 11:40:14 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/ReportPlatFormController.cs | 157 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 156 insertions(+), 1 deletions(-)
diff --git a/WebAPI/Controllers/ReportPlatFormController.cs b/WebAPI/Controllers/ReportPlatFormController.cs
index 34de546..badc91b 100644
--- a/WebAPI/Controllers/ReportPlatFormController.cs
+++ b/WebAPI/Controllers/ReportPlatFormController.cs
@@ -1,4 +1,5 @@
-锘縰sing Newtonsoft.Json.Linq;
+锘縰sing Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
@@ -279,5 +280,159 @@
return objJsonResult;
}
#endregion
+
+ #region 鎶ュ伐骞冲彴鎸夐挳鏌ヨ
+ [Route("ReportPlatForm/getButtonlist")]
+ [HttpGet]
+ public object getButtonlist(string user)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+
+ ds = oCN.RunProcReturn("select * from h_v_Gy_UserButton where 鐢ㄦ埛鍚嶇О='" + user+ "' order by 鎸夐挳鎺掑簭", "h_v_Gy_UserButton");
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鎶ュ伐骞冲彴鎸夐挳娣诲姞
+ [Route("ReportPlatForm/AddButtonlist")]
+ [HttpGet]
+ public object AddButtonlist(string HUserName,string HButtonID, string HButtonName, string HButtonSize, string HButtonOrder)
+ {
+ try
+ {
+
+ ds = oCN.RunProcReturn("select * from Gy_UserButtons where HButtonID='" + HButtonID + "' and HUserName='" + HUserName + "'", "Gy_UserButtons");
+
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "褰撳墠浜哄憳宸插垱寤烘敼鎸夐挳,涓嶅厑璁搁噸澶嶅垱寤猴紒";
+ objJsonResult.data = null;
+
+ }
+ else
+ {
+ oCN.BeginTran();
+ //鍐欏叆鎸夐挳缁戝畾
+ oCN.RunProc("insert into Gy_UserButtons(HUserName,HButtonID,HButtonName,HButtonSize,HButtonOrder)values('" + HUserName+"','"+HButtonID+ "','" + HButtonName + "','" + HButtonSize + "','" + HButtonOrder + "')");
+ oCN.Commit();
+
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+ objJsonResult.data = null;
+ }
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ }
+ return objJsonResult;
+ }
+ #endregion
+
+ #region 鎶ュ伐骞冲彴鎸夐挳鍒犻櫎
+ [Route("ReportPlatForm/DeleteButtonlist")]
+ [HttpGet]
+ public object DeleteButtonlist(int HItemID)
+ {
+ try
+ {
+ oCN.BeginTran();
+ oCN.RunProc("delete from Gy_UserButtons where HItemID ='" + HItemID + "'");
+ oCN.Commit();
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎鎸夐挳鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = e.Message.ToString();
+ objJsonResult.data = null;
+
+ }
+ return objJsonResult;
+ }
+ #endregion
+
+ #region 鎶ュ伐骞冲彴鎸夐挳鍩虹璧勬枡鏌ヨ
+ [Route("ReportPlatForm/GetGy_BGButtons")]
+ [HttpGet]
+ public object GetGy_BGButtons(string sWhere)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("select HItemID 鎸夐挳id,HNumber 鎸夐挳浠g爜,HName 鎸夐挳鍚嶇О from Gy_BGButtons", "Gy_BGButtons");
+ }
+ else
+ {
+ string sql1 = "select HItemID 鎸夐挳id,HNumber 鎸夐挳浠g爜,HName 鎸夐挳鍚嶇О from Gy_BGButtons where 1 = 1 ";
+ string sql = sql1 + sWhere;
+ ds = oCN.RunProcReturn(sql, "Gy_BGButtons");
+ }
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
}
}
--
Gitblit v1.9.1