public void Delete(SqlTransaction trans = null) { if (local == true) { throw new Exception("Can't call ChemicalQuery.Delete() method in Local transaction mode!"); } string mainNo = MainSet.RecNo; trans = AppRes.DB.BeginTrans(); try { ImageSet.RecNo = mainNo; ImageSet.Delete(trans); JoinSet.RecNo = mainNo; JoinSet.Delete(trans); P2Set.MainNo = mainNo; P2Set.Delete(trans); P2ExtendSet.RecNo = mainNo; P2ExtendSet.Delete(trans); MainSet.Delete(trans); ResetReportValidation(trans); AppRes.DB.CommitTrans(); } catch { AppRes.DB.RollbackTrans(); } }
public void Delete() { if (local == true) { throw new Exception("Can't call PhysicalQuery.Delete() method in Local transaction mode!"); } string mainNo = MainSet.RecNo; SqlTransaction trans = AppRes.DB.BeginTrans(); try { P2Set.MainNo = mainNo; P2Set.Delete(trans); P3Set.MainNo = mainNo; P3Set.Delete(trans); P40Set.MainNo = mainNo; P40Set.Delete(trans); P41Set.MainNo = mainNo; P41Set.Delete(trans); P5Set.MainNo = mainNo; P5Set.Delete(trans); ImageSet.RecNo = mainNo; ImageSet.Delete(trans); MainSet.Delete(trans); productSet.JobNo = mainNo; productSet.UpdateJobNoReset(trans); AppRes.DB.CommitTrans(); } catch { AppRes.DB.RollbackTrans(); } }