| | |
| | | |
| | | if (IsAudit == 0) //审核判断 |
| | | { |
| | | //审核前控制 |
| | | DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_QC_PatrolProcCheckBill_BeforeCheckCtrl " + HInterID.ToString() + ",'" + CurUserName + "'", "h_p_QC_PatrolProcCheckBill_BeforeCheckCtrl "); |
| | | if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "审核前判断失败!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "审核失败!" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | oCN.RunProc("update QC_PatrolProcCheckBillMain set HChecker='" + CurUserName + "',HCheckDate=getdate() where HInterID=" + HInterID); |
| | | |
| | | //审核后控制 |
| | | DataSet EndDs = oCN.RunProcReturn("Exec h_p_QC_PatrolProcCheckBill_AfterCheckCtrl " + HInterID.ToString() + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + CurUserName + "'", "h_p_QC_PatrolProcCheckBill_AfterCheckCtrl"); |
| | | if (EndDs == null || EndDs.Tables.Count == 0 || EndDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "审核后判断失败!"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(EndDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "审核失败!" + DBUtility.ClsPub.isStrNull(EndDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | } |
| | | if (IsAudit == 1) //反审核判断 |
| | | { |
| | | //反审核前控制 |
| | | DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_QC_PatrolProcCheckBill_BeforeUnCheckCtrl " + HInterID.ToString() + ",'" + CurUserName + "'", "h_p_QC_PatrolProcCheckBill_BeforeUnCheckCtrl"); |
| | | if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "反审核前判断失败!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "反审核失败!" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | oCN.RunProc("update QC_PatrolProcCheckBillMain set HChecker='',HCheckDate=null where HInterID=" + HInterID); |
| | | |
| | | //反审核后控制 |
| | | DataSet EndDs = oCN.RunProcReturn("Exec h_p_QC_PatrolProcCheckBill_AfterUnCheckCtrl " + HInterID.ToString() + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + CurUserName + "'", " h_p_QC_PatrolProcCheckBill_AfterUnCheckCtrl"); |
| | | if (EndDs == null || EndDs.Tables.Count == 0 || EndDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "反审核后判断失败!"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(EndDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "反审核失败!" + DBUtility.ClsPub.isStrNull(EndDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //删除前控制 |
| | | DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_QC_PatrolProcCheckBill_BeforeDelCtrl " + HInterID.ToString() + ",'" + user + "'", "h_p_QC_PatrolProcCheckBill_BeforeDelCtrl"); |
| | | if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "删除前判断失败!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "删除失败!" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | oCN.RunProc("update QC_PatrolProcCheckBillMain set HCloseMan='-1',HCloseDate=GETDATE() where HInterID=" + HInterID); |
| | | oCN.RunProc("update QC_PatrolProcCheckBillSub set HCloseMan='-1',HEntryCloseDate=GETDATE() where HInterID=" + HInterID); |
| | | |
| | | |
| | | //删除后控制 |
| | | DataSet EndDs = oCN.RunProcReturn("Exec h_p_QC_PatrolProcCheckBill_AfterDelCtrl " + HInterID.ToString() + ",'" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','" + user + "'", "h_p_QC_PatrolProcCheckBill_AfterDelCtrl"); |
| | | if (EndDs == null || EndDs.Tables.Count == 0 || EndDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "删除后判断失败!"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(EndDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "删除失败!" + DBUtility.ClsPub.isStrNull(EndDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | oCN.Commit();//提交事务 |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |