From db054d938d008ea7f968eef47120b806bb476f98 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期二, 18 十月 2022 14:25:57 +0800
Subject: [PATCH] 功能维护
---
WebAPI/Controllers/BLL/Xt_UserController.cs | 88 ++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 85 insertions(+), 3 deletions(-)
diff --git a/WebAPI/Controllers/BLL/Xt_UserController.cs b/WebAPI/Controllers/BLL/Xt_UserController.cs
index e7bf010..38d1af4 100644
--- a/WebAPI/Controllers/BLL/Xt_UserController.cs
+++ b/WebAPI/Controllers/BLL/Xt_UserController.cs
@@ -86,9 +86,9 @@
// return objJsonResult;
//}
- Int64 lngBillKey = 0;
- lngBillKey = DBUtility.ClsPub.isLong(HCzybm);
- if (lngBillKey == 0)
+ string lngBillKey = "";
+ lngBillKey = DBUtility.ClsPub.isStrNull(HCzybm);
+ if (lngBillKey == "")
{
objJsonResult.code = "0";
objJsonResult.count = 0;
@@ -770,5 +770,87 @@
}
}
#endregion
+
+ #region 鏍规嵁鐢ㄦ埛缂栫爜鏌ユ壘宸插垎閰嶈亴鍛樺垪琛�
+ [Route("Xt_User/UserEmployeelistPlaylist")]
+ [HttpGet]
+ public object UserEmployeelistPlaylist(string HUserID)
+ {
+ try
+ {
+
+ ds = oCN.RunProcReturn("select HEmployeeID HItemID,鑱屽憳浠g爜 HNumber,鑱屽憳鍚嶇О HName from h_v_Gy_UserEmployeeRelationList where HUserID='" + HUserID + "' ", "h_v_Gy_UserEmployeeRelationList");
+ 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 鐢ㄦ埛鍏宠仈鑱屽憳淇濆瓨
+ [Route("Xt_User/SaveUserEmployee")]
+ [HttpPost]
+ public object SaveUserEmployee([FromBody] JObject msg)
+ {
+ var _value = msg["msg"].ToString();
+ string msg1 = _value.ToString();
+ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ string msg2 = sArray[0].ToString();
+ string msg3 = sArray[1].ToString();
+
+ ListModels oListModels = new ListModels();
+ try
+ {
+ List<Models.Employee> lsmain = new List<Models.Employee>();
+ msg2 = msg2.Substring(1, msg2.Length - 2);
+ msg2 = msg2.Replace("\\", "");
+ msg2 = msg2.Replace("\n", ""); //\n
+ lsmain = oListModels.getObjectByJson_Employee(msg2);
+ oCN.BeginTran();
+ //鍒犻櫎宸茬粡鍏宠仈鐨勬暟鎹�
+ oCN.RunProc("Delete From Gy_UserEmployeeRelation where HUserID='" + msg3.ToString() + "'");
+ foreach (Models.Employee oItem in lsmain)
+ {
+ //閲嶆柊鍐欏叆鍏宠仈鏁版嵁
+ oCN.RunProc("insert into Gy_UserEmployeeRelation (HEmployeeID,HUserID) values ('" + oItem.HItemID + "','" + msg3.ToString() + "')");
+ }
+ oCN.Commit();
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ #endregion
}
}
\ No newline at end of file
--
Gitblit v1.9.1