|  |  | 
 |  |  |         { | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 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 = "0"; | 
 |  |  |                     objJsonResult.count = 1; | 
 |  |  |                     objJsonResult.Message = "获取信息成功!"; | 
 |  |  |                     objJsonResult.data = ds.Tables[0]; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |                 //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) | 
 |  |  |             { | 
 |  |  | 
 |  |  |         /// <returns></returns> | 
 |  |  |         [Route("QC_Management/MES_QC_CheckProjectList_Json")] | 
 |  |  |         [HttpGet] | 
 |  |  |         public object MES_QC_CheckProjectList_Json(string sWhere) | 
 |  |  |         public object MES_QC_CheckProjectList_Json(string sWhere,string user) | 
 |  |  |         { | 
 |  |  |             DataSet ds; | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 //判断权限 | 
 |  |  |                 if (!DBUtility.ClsPub.Security_Log("Gy_QCCheckProject_Query", 1, false, user)) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "无查询权限"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); | 
 |  |  |                 if (sWhere == null || sWhere.Equals("")) | 
 |  |  |                 { | 
 |  |  |                     ds = oCN.RunProcReturn("select  * from h_v_Gy_QCCheckProjectList", "h_v_Gy_QCCheckProjectList"); | 
 |  |  |                     ds = oCN.RunProcReturn("select  * from h_v_Gy_QCCheckProjectList order by hmainid desc ", "h_v_Gy_QCCheckProjectList"); | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     string sql1 = "select * from h_v_Gy_QCCheckProjectList where 1=1"; | 
 |  |  |                     string sql = sql1 + sWhere; | 
 |  |  |                     string sql = sql1 + sWhere+ " order by hmainid desc "; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "h_v_Gy_QCCheckProjectList"); | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  | 
 |  |  |         /// <returns></returns> | 
 |  |  |         [Route("QC_Management/MES_QC_FirstPieceCheckBillList_Json")] | 
 |  |  |         [HttpGet] | 
 |  |  |         public object MES_QC_FirstPieceCheckBillList_Json(string sqlWhere) | 
 |  |  |         public object MES_QC_FirstPieceCheckBillList_Json(string sqlWhere,string user) | 
 |  |  |         { | 
 |  |  |             DataSet ds; | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 //查看权限 | 
 |  |  |                 if (!DBUtility.ClsPub.Security_Log("QC_FirstPieceCheckBill_Query", 1, false, user)) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "无查看权限!"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); | 
 |  |  |                 if (sqlWhere == null || sqlWhere.Equals("")) | 
 |  |  |                 { | 
 |  |  |                     ds = oCN.RunProcReturn("select top 500 * from h_v_QC_FirstPieceCheckBillList  where  关闭人='' ", "h_v_QC_FirstPieceCheckBillList"); | 
 |  |  |                     ds = oCN.RunProcReturn("select top 500 * from h_v_QC_FirstPieceCheckBillList  where  关闭人='' order by hmainid desc ", "h_v_QC_FirstPieceCheckBillList"); | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     string sql1 = "select * from h_v_QC_FirstPieceCheckBillList where 关闭人='' "; | 
 |  |  |                     string sql = sql1 + sqlWhere; | 
 |  |  |                     string sql = sql1 + sqlWhere+ " order by hmainid desc "; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "h_v_QC_FirstPieceCheckBillList"); | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  | 
 |  |  |         /// <returns></returns> | 
 |  |  |         [Route("QC_Management/MES_QC_PatrolProcCheckBillList_Json")] | 
 |  |  |         [HttpGet] | 
 |  |  |         public object MES_QC_PatrolProcCheckBillList_Json(string sqlWhere) | 
 |  |  |         public object MES_QC_PatrolProcCheckBillList_Json(string sqlWhere,string user) | 
 |  |  |         { | 
 |  |  |             DataSet ds; | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 //查看权限 | 
 |  |  |                 if (!DBUtility.ClsPub.Security_Log("QC_PatrolProcCheckBill_Query", 1, false, user)) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "无查看权限!"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); | 
 |  |  |                 if (sqlWhere == null || sqlWhere.Equals("")) | 
 |  |  |                 { | 
 |  |  |                     ds = oCN.RunProcReturn("select top 500 * from h_v_QC_PatrolProcCheckBillList where  关闭人=''", "h_v_QC_PatrolProcCheckBillList"); | 
 |  |  |                     ds = oCN.RunProcReturn("select top 500 * from h_v_QC_PatrolProcCheckBillList where  关闭人='' order by hmainid desc ", "h_v_QC_PatrolProcCheckBillList"); | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     string sql1 = "select * from h_v_QC_PatrolProcCheckBillList where 关闭人='' "; | 
 |  |  |                     string sql = sql1 + sqlWhere; | 
 |  |  |                     string sql = sql1 + sqlWhere+ " order by hmainid desc "; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "h_v_QC_PatrolProcCheckBillList"); | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  | 
 |  |  |             string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); | 
 |  |  |             string msg2 = sArray[0].ToString(); | 
 |  |  |             string msg3 = sArray[1].ToString(); | 
 |  |  |             string user = sArray[2].ToString();//用户名 | 
 |  |  |  | 
 |  |  |             //判断权限 | 
 |  |  |             if (!DBUtility.ClsPub.Security_Log("Gy_QCCheckProject_Edit", 1, false, user)) | 
 |  |  |             { | 
 |  |  |                 objJsonResult.code = "0"; | 
 |  |  |                 objJsonResult.count = 0; | 
 |  |  |                 objJsonResult.Message = "无编辑权限"; | 
 |  |  |                 objJsonResult.data = null; | 
 |  |  |                 return objJsonResult; | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |             string UserName = ""; | 
 |  |  |             ListModels oListModels = new ListModels(); | 
 |  |  | 
 |  |  |                     oItem.HMaker = ""; | 
 |  |  |                     oItem.HStandard = false; | 
 |  |  |                     oItem.HMainSourceInterID = oItem.HInterID; | 
 |  |  |                     oItem.HMaterTypeID = 0; | 
 |  |  |                     //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); | 
 |  |  |                     if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") | 
 |  |  |                     { | 
 |  |  | 
 |  |  |                     oItemSub.HRelationQty = 0; | 
 |  |  |                     oItemSub.HRelationMoney = 0; | 
 |  |  |                     oItemSub.HCloseMan = ""; | 
 |  |  |                     oItemSub.HRemark = ""; | 
 |  |  |                     oBill.DetailColl.Add(oItemSub); | 
 |  |  |  | 
 |  |  |                 } | 
 |  |  | 
 |  |  |  | 
 |  |  |             DBUtility.ClsPub.CurUserName = UserName; | 
 |  |  |             //编辑权限 | 
 |  |  |             if (!DBUtility.ClsPub.Security_Log("Gy_QCCheckProject_Delete", 1, true, DBUtility.ClsPub.CurUserName)) | 
 |  |  |             if (!DBUtility.ClsPub.Security_Log("Gy_QCCheckProject_Delete", 1, false, DBUtility.ClsPub.CurUserName)) | 
 |  |  |             { | 
 |  |  |                 objJsonResult.code = "0"; | 
 |  |  |                 objJsonResult.count = 0; | 
 |  |  | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 //删除权限 | 
 |  |  |                 //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName)) | 
 |  |  |                 //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName)) | 
 |  |  |                 //{ | 
 |  |  |                 //    objJsonResult.code = "0"; | 
 |  |  |                 //    objJsonResult.count = 0; | 
 |  |  | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         #region 来料检验 | 
 |  |  |         /// <summary> | 
 |  |  | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 //删除权限 | 
 |  |  |                 //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName)) | 
 |  |  |                 //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName)) | 
 |  |  |                 //{ | 
 |  |  |                 //    objJsonResult.code = "0"; | 
 |  |  |                 //    objJsonResult.count = 0; | 
 |  |  | 
 |  |  |         /// <returns></returns> | 
 |  |  |         [Route("DeltetQC_FirstPieceCheck")] | 
 |  |  |         [HttpGet] | 
 |  |  |         public object DeltetQC_FirstPieceCheck(string HInterID) | 
 |  |  |         public object DeltetQC_FirstPieceCheck(string HInterID,string user) | 
 |  |  |         { | 
 |  |  |             DataSet ds; | 
 |  |  |             //string ModRightNameCheck = "Sc_ProcessReport_check"; | 
 |  |  |             string ModRightNameCheck = "QC_FirstPieceCheckBill_Delete"; | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 //删除权限 | 
 |  |  |                 //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName)) | 
 |  |  |                 //{ | 
 |  |  |                 //    objJsonResult.code = "0"; | 
 |  |  |                 //    objJsonResult.count = 0; | 
 |  |  |                 //    objJsonResult.Message = "审核失败!无权限!"; | 
 |  |  |                 //    objJsonResult.data = null; | 
 |  |  |                 //    return objJsonResult; | 
 |  |  |                 //} | 
 |  |  |                 if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, user)) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "审核失败!无权限!"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); | 
 |  |  |                 if (string.IsNullOrWhiteSpace(HInterID)) | 
 |  |  | 
 |  |  |             string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); | 
 |  |  |             string msg2 = sArray[0].ToString(); | 
 |  |  |             string msg3 = sArray[1].ToString(); | 
 |  |  |             string user = sArray[2].ToString(); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |             string UserName = ""; | 
 |  |  |             ListModels oListModels = new ListModels(); | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 //判断权限 | 
 |  |  |                 if (!DBUtility.ClsPub.Security_Log("QC_PatrolProcCheckBill_Edit", 1, false, user)) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "无保存权限"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 WebAPI.DLL.ClsQC_PatrolProcCheckBill oBill = new WebAPI.DLL.ClsQC_PatrolProcCheckBill(); | 
 |  |  |                 List<Model.ClsQC_PatrolProcCheckBillMain> lsmain = new List<Model.ClsQC_PatrolProcCheckBillMain>(); | 
 |  |  |                 msg2 = msg2.Replace("\\", ""); | 
 |  |  | 
 |  |  |         /// <returns></returns> | 
 |  |  |         [Route("DeltetQC_PatrolProcCheck")] | 
 |  |  |         [HttpGet] | 
 |  |  |         public object DeltetQC_PatrolProcCheck(string HInterID) | 
 |  |  |         public object DeltetQC_PatrolProcCheck(string HInterID,string user) | 
 |  |  |         { | 
 |  |  |             DataSet ds; | 
 |  |  |             //string ModRightNameCheck = "Sc_ProcessReport_check"; | 
 |  |  |             string ModRightNameCheck = "QC_PatrolProcCheckBill_Delete"; | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 //删除权限 | 
 |  |  |                 //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName)) | 
 |  |  |                 //{ | 
 |  |  |                 //    objJsonResult.code = "0"; | 
 |  |  |                 //    objJsonResult.count = 0; | 
 |  |  |                 //    objJsonResult.Message = "审核失败!无权限!"; | 
 |  |  |                 //    objJsonResult.data = null; | 
 |  |  |                 //    return objJsonResult; | 
 |  |  |                 //} | 
 |  |  |                 if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, user)) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "删除失败!无权限!"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); | 
 |  |  |                 if (string.IsNullOrWhiteSpace(HInterID)) |