| | |
| | | /// </summary> |
| | | [Route("Gy_BadReason/list")] |
| | | [HttpGet] |
| | | public object list(string sWhere) |
| | | public object list(string sWhere,string user) |
| | | { |
| | | try |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_BadReasonList where 禁用标记='' " + sWhere, "h_v_IF_BadReasonList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_IF_BadReasonList where 禁用标记='' "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_IF_BadReasonList"); |
| | | } |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | //查看权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_BadReason", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "false!"; |
| | | objJsonResult.Message = "无查看权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_BadReasonList " + sWhere+ " order by 不良原因代码 ", "h_v_IF_BadReasonList"); |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | string sql1 = "select * from h_v_IF_BadReasonList where 1 = 1"; |
| | | string sql = sql1 + sWhere+ " order by 不良原因代码 "; |
| | | ds = oCN.RunProcReturn(sql, "h_v_IF_BadReasonList"); |
| | | } |
| | | |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | | //{ |
| | | //objJsonResult.code = "0"; |
| | | //objJsonResult.count = 0; |
| | | //objJsonResult.Message = "无数据"; |
| | | //objJsonResult.data = null; |
| | | //return objJsonResult; |
| | | //} |
| | | } |
| | | catch (Exception e) |
| | | { |