| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region æ ¹æ®ç¨æ·ç¼ç æ¥æ¾å·²åé
ç»ç»å表 |
| | | [Route("Xt_User/UserByOrgPlaylist")] |
| | | [HttpGet] |
| | | public object UserByOrgPlaylist(string HUserID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select HOrgID HItemID,对åºç»ç»ä»£ç HNumber,对åºç»ç»åç§° HName from h_v_Gy_UserByOrgRelationList where ç¨æ·ç¼ç ='" + HUserID + "' ", "h_v_Gy_UserByOrgRelationList"); |
| | | 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/SaveUserByOrg")] |
| | | [HttpPost] |
| | | public object SaveUserByOrg([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.Xt_ORGANIZATIONS> lsmain = new List<Models.Xt_ORGANIZATIONS>(); |
| | | msg2 = msg2.Substring(1, msg2.Length - 2); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Xt_ORGANIZATIONS(msg2); |
| | | oCN.BeginTran(); |
| | | //å é¤å·²ç»å
³èçæ°æ® |
| | | oCN.RunProc("Delete From Gy_UserByOrgRelation where HUserID='" + msg3.ToString() + "'"); |
| | | foreach (Models.Xt_ORGANIZATIONS oItem in lsmain) |
| | | { |
| | | //éæ°åå
¥å
³èæ°æ® |
| | | oCN.RunProc("insert into Gy_UserByOrgRelation (HOrgID,HBillType,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 |
| | | |
| | | #region æ ¹æ®ç¨æ·ç¼ç æ¥æ¾å·²åé
ä»åºå表 |
| | | [Route("Xt_User/UserStocklistPlaylist")] |
| | | [HttpGet] |
| | | public object UserStocklistPlaylist(string HUserID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select HWHID HItemID,ä»åºä»£ç HNumber,ä»åºåç§° HName from h_v_Gy_UserStockRelationList where HUserID='" + HUserID + "' ", "h_v_Gy_UserStockRelationList"); |
| | | 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/SaveUserStock")] |
| | | [HttpPost] |
| | | public object SaveUserStock([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.Warehouse> lsmain = new List<Models.Warehouse>(); |
| | | msg2 = msg2.Substring(1, msg2.Length - 2); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Warehouse(msg2); |
| | | oCN.BeginTran(); |
| | | //å é¤å·²ç»å
³èçæ°æ® |
| | | oCN.RunProc("Delete From Gy_UserStockRelation where HUserID='" + msg3.ToString() + "'"); |
| | | foreach (Models.Warehouse oItem in lsmain) |
| | | { |
| | | //éæ°åå
¥å
³èæ°æ® |
| | | oCN.RunProc("insert into Gy_UserStockRelation (HWHID,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 |
| | | |
| | | #region æ ¹æ®ç¨æ·ç¼ç æ¥æ¾å·²åé
çç»å表 |
| | | [Route("Xt_User/UserGrouplistPlaylist")] |
| | | [HttpGet] |
| | | public object UserGrouplistPlaylist(string HUserID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select HGroupID HItemID,çç»ä»£ç HNumber,çç»åç§° HName from h_v_Gy_UserGroupRelationList where HUserID='" + HUserID + "' ", "h_v_Gy_UserGroupRelationList"); |
| | | 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/SaveUserGroup")] |
| | | [HttpPost] |
| | | public object SaveUserGroup([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.Gy_Group> lsmain = new List<Models.Gy_Group>(); |
| | | msg2 = msg2.Substring(1, msg2.Length - 2); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Gy_Group(msg2); |
| | | oCN.BeginTran(); |
| | | //å é¤å·²ç»å
³èçæ°æ® |
| | | oCN.RunProc("Delete From Gy_UserGroupRelation where HUserID='" + msg3.ToString() + "'"); |
| | | foreach (Models.Gy_Group oItem in lsmain) |
| | | { |
| | | //éæ°åå
¥å
³èæ°æ® |
| | | oCN.RunProc("insert into Gy_UserGroupRelation (HGroupID,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 |
| | | |
| | | #region æ ¹æ®ç¨æ·ç¼ç æ¥æ¾å·²åé
é¨é¨å表 |
| | | [Route("Xt_User/UserDeptlistPlaylist")] |
| | | [HttpGet] |
| | | public object UserDeptlistPlaylist(string HUserID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select HDeptID HItemID,é¨é¨ä»£ç HNumber,é¨é¨åç§° HName from h_v_Gy_UserDeptRelationList where HUserID='" + HUserID + "' ", "h_v_Gy_UserDeptRelationList"); |
| | | 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/SaveUserDept")] |
| | | [HttpPost] |
| | | public object SaveUserDept([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.Department> lsmain = new List<Models.Department>(); |
| | | msg2 = msg2.Substring(1, msg2.Length - 2); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Department(msg2); |
| | | oCN.BeginTran(); |
| | | //å é¤å·²ç»å
³èçæ°æ® |
| | | oCN.RunProc("Delete From Gy_UserDeptRelation where HUserID='" + msg3.ToString() + "'"); |
| | | foreach (Models.Department oItem in lsmain) |
| | | { |
| | | //éæ°åå
¥å
³èæ°æ® |
| | | oCN.RunProc("insert into Gy_UserDeptRelation (HDeptID,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 |
| | | |
| | | #region æ ¹æ®ç¨æ·ç¼ç æ¥æ¾å·²åé
å·¥ä½å表 |
| | | [Route("Xt_User/UserByWorkStationlistPlaylist")] |
| | | [HttpGet] |
| | | public object UserByWorkStationlistPlaylist(string HUserID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select HWorkStationID HItemID,å·¥ä½ä»£ç HNumber,å·¥ä½åç§° HName from h_v_Gy_UserByWorkStationList where HUserID='" + HUserID + "' ", "h_v_Gy_UserByWorkStationList"); |
| | | 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/SaveUserByWorkStation")] |
| | | [HttpPost] |
| | | public object SaveUserByWorkStation([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.Department> lsmain = new List<Models.Department>(); |
| | | msg2 = msg2.Substring(1, msg2.Length - 2); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Department(msg2); |
| | | oCN.BeginTran(); |
| | | //å é¤å·²ç»å
³èçæ°æ® |
| | | oCN.RunProc("Delete From Gy_UserByWorkStationRelation where HUserID='" + msg3.ToString() + "'"); |
| | | foreach (Models.Department oItem in lsmain) |
| | | { |
| | | //éæ°åå
¥å
³èæ°æ® |
| | | oCN.RunProc("insert into Gy_UserByWorkStationRelation (HWorkStationID,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 |
| | | } |
| | | } |