| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 销售订单 根据用户获取用户关联客户过滤条件 |
| | | [Route("Xs_SeOrderBill/getCusIDListByUser")] |
| | | [HttpGet] |
| | | public object getCusIDListByUser(string CurUserID, string CurUserName) |
| | | { |
| | | string sWhere = ""; |
| | | string ModRightNameCheck = "Gy_UserLookAllCus"; |
| | | DBUtility.ClsPub.CurUserName = CurUserName; |
| | | try |
| | | { |
| | | //权限判断:是否可以查看所有客户 |
| | | if (DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName)) |
| | | { |
| | | sWhere = ""; |
| | | } |
| | | else |
| | | { |
| | | string sql = "select * from Gy_UserCustomerRelation where HUserID = '" + CurUserID + "'"; |
| | | ds = oCN.RunProcReturn(sql, "Gy_UserCustomerRelation"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sWhere = " and 1 = 0"; |
| | | } |
| | | else |
| | | { |
| | | sWhere = " and HCusID in ("; |
| | | for(var i = 0; i < ds.Tables[0].Rows.Count; i++) |
| | | { |
| | | if (i < ds.Tables[0].Rows.Count - 1) |
| | | { |
| | | sWhere += ds.Tables[0].Rows[i]["HCusID"].ToString() + ","; |
| | | } |
| | | else |
| | | { |
| | | sWhere += ds.Tables[0].Rows[i]["HCusID"].ToString() + ")"; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = sWhere; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sWhere = " and 1=0 "; |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exception!" + e.ToString(); |
| | | objJsonResult.data = sWhere; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 销售订单 下推生产订单(无列表)-获取数据 |
| | | [Route("Xs_SeOrderBill/loadXs_SeOrderBill_InitICMO")] |
| | | [HttpGet] |
| | | public object loadXs_SeOrderBill_InitICMO(long HInterID,long HEntryID) |
| | | { |
| | | try |
| | | { |
| | | string sql = "select * from h_v_IF_SeOrderBillList where hmainid = " + HInterID + " and HSubID = " + HEntryID; |
| | | ds = oCN.RunProcReturn(sql, "h_v_IF_SeOrderBillList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "false!"; |
| | | 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 |
| | | } |
| | | } |