コード例 #1
0
 static bool hasPayments(Rbr_Db pDb, int pPersonId)
 {
     if (CustomerAcctManager.HasPayments(pDb, pPersonId))
     {
         return(true);
     }
     if (RetailAccountManager.HasPayments(pDb, pPersonId))
     {
         return(true);
     }
     return(false);
 }
コード例 #2
0
        internal static void DeleteCustomerSupportGroup(Rbr_Db pDb, int pGroupId)
        {
            CustomerSupportGroupRow _customerSupportGroupRow = pDb.CustomerSupportGroupCollection.GetByPrimaryKey(pGroupId);

            PersonRow[] _personRows = pDb.PersonCollection.GetByGroup_id(pGroupId);
            foreach (PersonRow _personRow in _personRows)
            {
                if (RetailAccountManager.HasPayments(pDb, _personRow.Person_id))
                {
                    throw new InvalidOperationException("Cannot Delete Group [" + _customerSupportGroupRow.Description + "]; At least one Representative [Login="******"] in this Group has a Payment History.");
                }
            }
            pDb.PersonCollection.DeleteByGroup_id(pGroupId);
            pDb.CustomerSupportGroupCollection.DeleteByPrimaryKey(pGroupId);
        }