public static int CanFamilyMergeIntoDifferentClass(long APartnerKey) { int ReturnValue = 0; TDBTransaction Transaction = null; DBAccess.GDBAccessObj.BeginAutoReadTransaction(IsolationLevel.ReadCommitted, ref Transaction, delegate { PPersonTable PersonTable = PPersonAccess.LoadViaPFamily(APartnerKey, Transaction); if (PersonTable.Rows.Count > 0) { ReturnValue = 1; } AGiftDetailTable GiftDetailTable = AGiftDetailAccess.LoadViaPPartnerRecipientKey(APartnerKey, Transaction); if (GiftDetailTable.Rows.Count > 0) { ReturnValue = 2; } PBankingDetailsTable BankingDetailsTable = PBankingDetailsAccess.LoadViaPPartner(APartnerKey, Transaction); if (BankingDetailsTable.Rows.Count > 0) { ReturnValue = 3; } }); return(ReturnValue); }
public static int CanFamilyMergeIntoDifferentClass(long APartnerKey) { TDBTransaction Transaction = DBAccess.GDBAccessObj.BeginTransaction(IsolationLevel.ReadCommitted); try { PPersonTable PersonTable = PPersonAccess.LoadViaPFamily(APartnerKey, Transaction); if (PersonTable.Rows.Count > 0) { return(1); } AGiftDetailTable GiftDetailTable = AGiftDetailAccess.LoadViaPPartnerRecipientKey(APartnerKey, Transaction); if (GiftDetailTable.Rows.Count > 0) { return(2); } PBankingDetailsTable BankingDetailsTable = PBankingDetailsAccess.LoadViaPPartner(APartnerKey, Transaction); if (BankingDetailsTable.Rows.Count > 0) { return(3); } } catch (Exception e) { TLogging.Log(e.ToString()); } finally { DBAccess.GDBAccessObj.RollbackTransaction(); TLogging.LogAtLevel(7, "TMergePartnersWebConnector.CanFamilyMergeIntoDifferentClass: rollback own transaction."); } return(0); }