|  |  | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 ds = oCN.RunProcReturn("select * from h_v_Sb_EquipBeginBillMainList where HInterID = " + HInterID, " h_v_Sb_EquipBeginBillMainList"); | 
 |  |  |                 ds = oCN.RunProcReturn("select * from h_v_Sb_EquipBeginBillMain_Edit where HInterID = " + HInterID, " h_v_Sb_EquipBeginBillMain_Edit"); | 
 |  |  |  | 
 |  |  |                 objJsonResult.code = "1"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  | 
 |  |  |  | 
 |  |  |                 oCN.BeginTran(); | 
 |  |  |  | 
 |  |  |                 oCN.RunProc("delete from Sb_EquipBeginBillMain where HInterID = " + HInterID); | 
 |  |  |                 BillOld.MvarItemKey = "Sb_EquipBeginBillMain"; | 
 |  |  |                 //删除前控制=========================================       | 
 |  |  |                 string sql1 = "exec h_p_Sb_EquipBeginBill_BeforeDelCtrl " + HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'"; | 
 |  |  |                 ds = oCN.RunProcReturn(sql1, "h_p_Sb_EquipBeginBill_BeforeDelCtrl"); | 
 |  |  |                 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; | 
 |  |  |                 } | 
 |  |  |                 //==================================================================================   | 
 |  |  |  | 
 |  |  |                 bool IsDete = BillOld.DeleteBill(Convert.ToInt32(HInterID), BillOld.omodel.HBillNo, "h_p_Sb_EquipBeginBill_AfterDelCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo); | 
 |  |  |                 //oCN.RunProc("delete from Sb_EquipBeginBillMain where HInterID = " + HInterID); | 
 |  |  |  | 
 |  |  |                 oCN.Commit(); | 
 |  |  |  | 
 |  |  |                 objJsonResult.code = "1"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  |                 objJsonResult.Message = "Sucess!"; | 
 |  |  |                 objJsonResult.data = null; | 
 |  |  |                 return objJsonResult; | 
 |  |  |                 if (IsDete) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "1"; | 
 |  |  |                     objJsonResult.count = 1; | 
 |  |  |                     objJsonResult.Message = "删除成功!"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |             catch (Exception e) | 
 |  |  |             { | 
 |  |  | 
 |  |  |                             objJsonResult.data = null; | 
 |  |  |                             return objJsonResult; | 
 |  |  |                         } | 
 |  |  |                         //审核单据 | 
 |  |  |                         if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) | 
 |  |  |  | 
 |  |  |                         //审核前控制=========================================       | 
 |  |  |                         string sql1 = "exec h_p_Sb_EquipBeginBill_BeforeCheckCtrl " + HInterID + ",'','" + user + "'"; | 
 |  |  |                         ds = oCN.RunProcReturn(sql1, "h_p_Sb_EquipBeginBill_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; | 
 |  |  |                             oCN.RollBack(); | 
 |  |  |                             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; | 
 |  |  |                             oCN.RollBack(); | 
 |  |  |                             return objJsonResult; | 
 |  |  |                         } | 
 |  |  |                         //==================================================================================   | 
 |  |  |  | 
 |  |  |                         if (!BillOld.CheckBill(int.Parse(HInterID), "", "h_p_Sb_EquipBeginBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo)) | 
 |  |  |                         { | 
 |  |  |                             objJsonResult.code = "0"; | 
 |  |  |                             objJsonResult.count = 1; | 
 |  |  | 
 |  |  |                             objJsonResult.data = null; | 
 |  |  |                             return objJsonResult; | 
 |  |  |                         } | 
 |  |  |                         //反审核单据 | 
 |  |  |                         if (!BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) | 
 |  |  |  | 
 |  |  |                         //反审核前控制=========================================         | 
 |  |  |                         string sql1 = "exec h_p_Sb_EquipBeginBill_BeforeUnCheckCtrl " + HInterID + ",'','" + user + "'"; | 
 |  |  |                         ds = oCN.RunProcReturn(sql1, "h_p_Sb_EquipBeginBill_BeforeUnCheckCtrl"); | 
 |  |  |                         if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) | 
 |  |  |                         { | 
 |  |  |                             objJsonResult.code = "0"; | 
 |  |  |                             objJsonResult.count = 1; | 
 |  |  |                             objJsonResult.Message = "反审核失败!原因:" + ClsPub.sExeReturnInfo; | 
 |  |  |                             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.AbandonCheck(int.Parse(HInterID), "", "h_p_Sb_EquipBeginBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo)) | 
 |  |  |                         { | 
 |  |  |                             objJsonResult.code = "0"; | 
 |  |  |                             objJsonResult.count = 1; | 
 |  |  |                             objJsonResult.Message = "审核失败!原因:" + ClsPub.sExeReturnInfo; | 
 |  |  |                             objJsonResult.data = null; | 
 |  |  |                             return objJsonResult; | 
 |  |  |                         } | 
 |  |  | 
 |  |  |                             objJsonResult.data = null; | 
 |  |  |                             return objJsonResult; | 
 |  |  |                         } | 
 |  |  |                         //关闭单据 | 
 |  |  |                         if (!BillOld.CloseBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) | 
 |  |  |  | 
 |  |  |                         string sql2 = ""; | 
 |  |  |                         //关闭前控制===============================================Begin=================================================================== | 
 |  |  |                         sql2 = "exec h_p_Sb_EquipBeginBill_BeforeCloseCtrl " + HInterID + ",'','" + user + "'"; | 
 |  |  |                         ds = oCN.RunProcReturn(sql2, "h_p_Sb_EquipBeginBill_BeforeCloseCtrl"); | 
 |  |  |                         if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) | 
 |  |  |                         { | 
 |  |  |                             objJsonResult.code = "0"; | 
 |  |  |                             objJsonResult.count = 1; | 
 |  |  |                             objJsonResult.Message = "关闭失败!原因:" + ClsPub.sExeReturnInfo; | 
 |  |  |                             objJsonResult.count = 0; | 
 |  |  |                             objJsonResult.Message = "关闭失败!原因:关闭前前判断失败,无返回信息,请与网络管理人员联系"; | 
 |  |  |                             objJsonResult.data = null; | 
 |  |  |                             return objJsonResult; | 
 |  |  |  | 
 |  |  |                         } | 
 |  |  |                         if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") | 
 |  |  |                         { | 
 |  |  |                             objJsonResult.code = "0"; | 
 |  |  |                             objJsonResult.count = 0; | 
 |  |  |                             objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; | 
 |  |  |                             objJsonResult.data = null; | 
 |  |  |                             return objJsonResult; | 
 |  |  |                         } | 
 |  |  |                         //关闭前控制===============================================End=================================================================== | 
 |  |  |  | 
 |  |  |                         //关闭提交 | 
 |  |  |                         if (BillOld.CloseBill(Convert.ToInt32(HInterID),"", "h_p_Sb_EquipBeginBill_AfterCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true) | 
 |  |  |                         { | 
 |  |  |                             objJsonResult.code = "1"; | 
 |  |  |                             objJsonResult.count = 1; | 
 |  |  |                             objJsonResult.Message = "关闭成功"; | 
 |  |  |                             objJsonResult.data = null; | 
 |  |  |                             return objJsonResult; | 
 |  |  |                         } | 
 |  |  |                         else | 
 |  |  |                         { | 
 |  |  |                             objJsonResult.code = "0"; | 
 |  |  |                             objJsonResult.count = 0; | 
 |  |  |                             objJsonResult.Message = "关闭失败!原因:" + DBUtility.ClsPub.sExeReturnInfo; | 
 |  |  |                             objJsonResult.data = null; | 
 |  |  |                             return objJsonResult; | 
 |  |  |                         }                         | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  | 
 |  |  |                             objJsonResult.data = null; | 
 |  |  |                             return objJsonResult; | 
 |  |  |                         } | 
 |  |  |                         //反关闭单据 | 
 |  |  |                         if (!BillOld.CancelClose(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) | 
 |  |  |  | 
 |  |  |  | 
 |  |  |                         string sql2 = ""; | 
 |  |  |                         //反关闭前控制===============================================Begin=================================================================== | 
 |  |  |                         sql2 = "exec h_p_Sb_EquipBeginBill_BeforeUnCloseCtrl " + HInterID + ",'','" + user + "'"; | 
 |  |  |                         ds = oCN.RunProcReturn(sql2, "h_p_Sb_EquipBeginBill_BeforeUnCloseCtrl"); | 
 |  |  |                         if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) | 
 |  |  |                         { | 
 |  |  |                             objJsonResult.code = "0"; | 
 |  |  |                             objJsonResult.count = 1; | 
 |  |  |                             objJsonResult.Message = "反关闭失败!原因:" + ClsPub.sExeReturnInfo; | 
 |  |  |                             objJsonResult.count = 0; | 
 |  |  |                             objJsonResult.Message = "反关闭失败!原因:反关闭前前判断失败,无返回信息,请与网络管理人员联系"; | 
 |  |  |                             objJsonResult.data = null; | 
 |  |  |                             return objJsonResult; | 
 |  |  |  | 
 |  |  |                         } | 
 |  |  |                         if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") | 
 |  |  |                         { | 
 |  |  |                             objJsonResult.code = "0"; | 
 |  |  |                             objJsonResult.count = 0; | 
 |  |  |                             objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; | 
 |  |  |                             objJsonResult.data = null; | 
 |  |  |                             return objJsonResult; | 
 |  |  |                         } | 
 |  |  |                         //反关闭前控制===============================================End=================================================================== | 
 |  |  |  | 
 |  |  |                         //反关闭提交 | 
 |  |  |                         if (BillOld.CancelClose(Convert.ToInt32(HInterID), "", "h_p_Sb_EquipBeginBill_AfterUnCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true) | 
 |  |  |                         { | 
 |  |  |                             objJsonResult.code = "1"; | 
 |  |  |                             objJsonResult.count = 1; | 
 |  |  |                             objJsonResult.Message = "反关闭成功"; | 
 |  |  |                             objJsonResult.data = null; | 
 |  |  |                             return objJsonResult; | 
 |  |  |                         } | 
 |  |  |                         else | 
 |  |  |                         { | 
 |  |  |                             objJsonResult.code = "0"; | 
 |  |  |                             objJsonResult.count = 0; | 
 |  |  |                             objJsonResult.Message = "反关闭失败!原因:" + DBUtility.ClsPub.sExeReturnInfo; | 
 |  |  |                             objJsonResult.data = null; | 
 |  |  |                             return objJsonResult; | 
 |  |  |                         }                        | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |  |