| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | string HBillNo = ""; |
| | | |
| | | DataSet Ds = oCN.RunProcReturn("Select * from Sc_ProcExchRecordBackBillMain Where HInterID=" + HInterID, "Sc_ProcExchRecordBackBillMain"); |
| | | if (Ds.Tables[0].Rows.Count > 0) |
| | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据已审核!不能再次审核"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //审核前控制 |
| | | HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | string sql = "exec h_p_Sc_ProcExchRecordBackBill_BeforeCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'"; |
| | | Ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcExchRecordBackBill_BeforeCheckCtrl"); |
| | | if (Ds == null || Ds.Tables.Count == 0 || Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | if (Ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "审核失败!原因:" + Ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //反审核前控制 |
| | | HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString(); |
| | | string sql = "exec h_p_Sc_ProcExchRecordBackBill_BeforeUnCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'"; |
| | | Ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcExchRecordBackBill_BeforeUnCheckCtrl"); |
| | | if (Ds == null || Ds.Tables.Count == 0 || Ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "反审核失败!原因:反审核前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | if (Ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "反审核失败!原因:" + Ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | //审核 |
| | | if (Cj_StationInBillCheckBill(HInterID, num, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | if (Cj_StationInBillCheckBill(HInterID, HBillNo, num, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | } |
| | | |
| | | //审核 |
| | | public bool Cj_StationInBillCheckBill(Int64 HInterID, int num, string CurUserName, ref string sReturn) |
| | | public bool Cj_StationInBillCheckBill(Int64 HInterID,string HBillNo, int num, string CurUserName, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | |
| | | if (num == 1) |
| | | { |
| | | oCN.RunProc(" Update Sc_ProcExchRecordBackBillMain set HChecker='" + CurUserName + "',HBillStatus=2,HCheckDate=getdate() Where HInterID=" + HInterID.ToString()); |
| | | |
| | | //审核后控制 |
| | | string sql = "exec h_p_Sc_ProcExchRecordBackBill_AfterCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcExchRecordBackBill_AfterCheckCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sReturn = "审核过程中出错,请与网络管理人员联系"; |
| | | oCN.RollBack(); |
| | | return false; |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString(); |
| | | oCN.RollBack(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | if (num == 2) |
| | | { |
| | | oCN.RunProc(" Update Sc_ProcExchRecordBackBillMain set HChecker='',HBillStatus=1,HCheckDate=null Where HInterID=" + HInterID.ToString()); |
| | | |
| | | //反审核后控制 |
| | | string sql = "exec h_p_Sc_ProcExchRecordBackBill_AfterUnCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sc_ProcExchRecordBackBill_AfterUnCheckCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sReturn = "反审核过程中出错,请与网络管理人员联系"; |
| | | oCN.RollBack(); |
| | | return false; |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString(); |
| | | oCN.RollBack(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | oCN.Commit(); |