|  |  | 
 |  |  |  | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 //=========================保存后控制   | 
 |  |  |                 //=========================保存后控制  ============================ | 
 |  |  |                 DataSet ds2 = oCN.RunProcReturn("Exec h_p_Sc_StationInBill_AfterSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "',1 ", "h_p_Sc_StationInBill_AfterSaveCtrl"); | 
 |  |  |                 if (ds2 == null) | 
 |  |  |                 { | 
 |  |  | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |                 //============================ | 
 |  |  |                 //======================================================= | 
 |  |  |  | 
 |  |  |                 oCN.Commit(); | 
 |  |  |                 | 
 |  |  | 
 |  |  |         { | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 string ModRightNameCheck = ""; | 
 |  |  |  | 
 |  |  |                 if (HBillSubType == "SUB") | 
 |  |  |                 { | 
 |  |  |                     //审核权限 | 
 |  |  | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 //审核前控制 | 
 |  |  |                 //审核前控制========================================================================== | 
 |  |  |                 string HBillNo = oBill.omodel.HBillNo; | 
 |  |  |                 string sql = "exec h_p_Sc_StationInBill_BeforeCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'"; | 
 |  |  |                 ds = oCN.RunProcReturn(sql, "h_p_Sc_StationInBill_BeforeCheckCtrl"); | 
 |  |  | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 //============================================================================= | 
 |  |  |                 //审核 | 
 |  |  |                 if (Cj_StationInBillCheckBill(HInterID, HBillNo, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo)) | 
 |  |  |                 { | 
 |  |  | 
 |  |  |                 { | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 //审核后控制 | 
 |  |  |                 //审核后控制======================================================= | 
 |  |  |                 string sql = "exec h_p_Sc_StationInBill_AfterCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'"; | 
 |  |  |                 ds = oCN.RunProcReturn(sql, "h_p_Sc_StationInBill_AfterCheckCtrl"); | 
 |  |  |                 if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) | 
 |  |  | 
 |  |  |                     oCN.RollBack(); | 
 |  |  |                     return false; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 //==================================================================== | 
 |  |  |                 sReturn = sReturn + " 审核功能!"; | 
 |  |  |                 oCN.Commit(); | 
 |  |  |                 return true; | 
 |  |  | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 //反审核前控制 | 
 |  |  |                 //反审核前控制============================================================================= | 
 |  |  |                 string HBillNo = oBill.omodel.HBillNo; | 
 |  |  |                 string sql = "exec h_p_Sc_StationInBill_BeforeUnCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'"; | 
 |  |  |                 ds = oCN.RunProcReturn(sql, "h_p_Sc_StationInBill_BeforeUnCheckCtrl"); | 
 |  |  | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 //============================================================================================ | 
 |  |  |                 //反审核 | 
 |  |  |                 if (Cj_StationInBillAbandonCheckBill(HInterID, HBillNo, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo)) | 
 |  |  |                 { | 
 |  |  | 
 |  |  |                 { | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 //反审核后控制 | 
 |  |  |                 //反审核后控制======================================================================== | 
 |  |  |                 string sql = "exec h_p_Sc_StationInBill_AfterUnCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'"; | 
 |  |  |                 ds = oCN.RunProcReturn(sql, "h_p_Sc_StationInBill_AfterUnCheckCtrl"); | 
 |  |  |                 if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) | 
 |  |  | 
 |  |  |                     oCN.RollBack(); | 
 |  |  |                     return false; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 //============================================================================================ | 
 |  |  |                 sReturn = sReturn + "反审核功能!"; | 
 |  |  |                 oCN.Commit(); | 
 |  |  |                 return true; | 
 |  |  | 
 |  |  |                             return objJsonResult; | 
 |  |  |                         } | 
 |  |  |                     } | 
 |  |  |                     var HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); | 
 |  |  |  | 
 |  |  |                     //关闭前控制=========================================       | 
 |  |  |                     string sql1 = "exec h_p_Sc_ShiftsBeginInfoBill_BeforeCloseCtrl " + HInterID + ",'" +HBillNo + "','" + user + "'"; | 
 |  |  |                     ds = oCN.RunProcReturn(sql1, "h_p_Sc_ShiftsBeginInfoBill_BeforeCloseCtrl"); | 
 |  |  |                     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 (!BillOld.CloseBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) | 
 |  |  |                     if (!BillOld.CloseBill(Int64.Parse(HInterID), HBillNo, "h_p_Sc_ShiftsBeginInfoBill_AfterCloseCtrl", user,ref ClsPub.sExeReturnInfo)) | 
 |  |  |                     { | 
 |  |  |                         objJsonResult.code = "0"; | 
 |  |  |                         objJsonResult.count = 1; | 
 |  |  | 
 |  |  |                             return objJsonResult; | 
 |  |  |                         } | 
 |  |  |                     } | 
 |  |  |                     var HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); | 
 |  |  |                     //反关闭前控制=========================================       | 
 |  |  |                     string sql1 = "exec h_p_Sc_StationInBill_BeforeUnCloseCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'"; | 
 |  |  |                     ds = oCN.RunProcReturn(sql1, "h_p_Sc_StationInBill_BeforeUnCloseCtrl"); | 
 |  |  |                     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 (!BillOld.CancelClose(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) | 
 |  |  |                     if (!BillOld.CancelClose(Int64.Parse(HInterID), HBillNo, "h_p_Sc_StationInBill_AfterUnCloseCtrl", user, ref ClsPub.sExeReturnInfo)) | 
 |  |  |                     { | 
 |  |  |                         objJsonResult.code = "0"; | 
 |  |  |                         objJsonResult.count = 1; |