| | |
| | | #region 根据用户编码查找已分配客户列表 |
| | | [Route("Xt_User/CustomerPlaylist")] |
| | | [HttpGet] |
| | | public object CustomerPlaylist(string HUserID) |
| | | public object CustomerPlaylist(string HUserID, string CurUserName) |
| | | { |
| | | try |
| | | { |
| | | //查询权限 |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_UserRelationCustomer_Query", 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无查询权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | ds = oCN.RunProcReturn("select HCusID,客户代码 HCustomerNumber,客户名称 HCustomerName from h_v_Gy_UserCustomerList where HUserID='" + HUserID + "' order by HCusID", "h_v_Gy_UserCustomerList"); |
| | | 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/CustomerPlaylistFromUserCustomerList")] |
| | | [HttpGet] |
| | | public object CustomerPlaylistFromUserCustomerList(string HUserID, string HCusNumber, string HCusName, string CurUserName) |
| | | { |
| | | try |
| | | { |
| | | //查询权限 |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_UserRelationCustomer_Query", 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无查询权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn("select HCusID,客户代码 HCustomerNumber,客户名称 HCustomerName from h_v_Gy_UserCustomerList where HUserID='" + HUserID + "' ", "h_v_Gy_UserCustomerList"); |
| | | string sql = "select HCusID,客户代码 HCustomerNumber,客户名称 HCustomerName " + |
| | | "from h_v_Gy_UserCustomerList " + |
| | | "where HUserID='" + HUserID + "' " + |
| | | "and 客户代码 like '%" + HCusNumber + "%' " + |
| | | "and 客户名称 like '%" + HCusName + "%' " + |
| | | " order by 客户代码"; |
| | | |
| | | |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_UserCustomerList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | string msg4 = sArray[2].ToString(); |
| | | |
| | | //查询权限 |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_UserRelationCustomer_Edit", 1, false, msg4)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无编辑权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ListModels oListModels = new ListModels(); |
| | | try |