|  |  | 
 |  |  |                 var num = 0; | 
 |  |  |                 //LogService.Write($"3.事务开始,用时" + sw.Elapsed); | 
 |  |  |  | 
 |  |  |                 //保存前控制========================================= | 
 |  |  |                 string HBillNote = ""; | 
 |  |  |                 ds = oCN.RunProcReturn("Exec  h_p_Sc_StationOutBill_BeforeSaveCtrl  " + HInterID.ToString() + ", '" + HBillNo + "','" + HBillNote + "',1 ", " h_p_Sc_StationOutBill_BeforeSaveCtrl "); | 
 |  |  |                 if (ds == null) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "保存前判断失败!"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |                 if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |                 //========================================================= | 
 |  |  |  | 
 |  |  |  | 
 |  |  |                 //若MAINDI重复则重新获取 | 
 |  |  |                 oCN.BeginTran(); | 
 |  |  |                 if ("Add".Equals(eventType)) | 
 |  |  | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 //=========================保存后控制   | 
 |  |  |                 DataSet ds2 = oCN.RunProcReturn("Exec h_p_Sc_StationOutBill_AfterSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "',1 ", "h_p_Sc_StationOutBill_AfterSaveCtrl"); | 
 |  |  |                 if (ds2 == null) | 
 |  |  |                 { | 
 |  |  |                     oCN.RollBack(); | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "保存后控制判断失败!"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |  | 
 |  |  |                 } | 
 |  |  |                 if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") | 
 |  |  |                 { | 
 |  |  |                     oCN.RollBack(); | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]); | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |                 //============================ | 
 |  |  |  | 
 |  |  |  | 
 |  |  |                 //LogService.Write($"10.事务结束,用时" + sw.Elapsed); | 
 |  |  |                 oCN.Commit(); |