// Exceptions: // System.ArgumentException: // Load Failed protected void LoadInternal(ItemBase itemBase, bool loadChildren) { try { List <UInt64> uniqueIDs; //ClearValues(itemBase); Not sure why I did this mItemBaseDAL.Load(itemBase, itemBase.UniqueID); try { mResourceDescriptionBO.Load(itemBase.ResourceDescription); } catch { itemBase.ResourceDescription = new ResourceDescription(itemBase.UniqueID); mResourceDescriptionBO.Save(itemBase.ResourceDescription); } if (loadChildren) { uniqueIDs = mItemBaseDAL.GetChildrenUniqueIDsByEventParent(itemBase.UniqueID); foreach (UInt64 childUniqueID in uniqueIDs) { ItemBase childItemBase = new ItemBase(childUniqueID); Load(childItemBase); itemBase.ItemChildren.Add(childItemBase); } } uniqueIDs = mHoldingsInfoBO.GetUniqueIDsByItemOwner(itemBase.UniqueID); foreach (UInt64 holdingsUniqueID in uniqueIDs) { HoldingsInfo holdingsInfo = new HoldingsInfo(holdingsUniqueID); // mHoldingsInfoBO.Load(holdingsInfo); // No Need to load yet... itemBase.HoldingsInfo.Add(holdingsInfo); } } catch { throw new System.ArgumentException("Load Failed", "itemBase"); } }
// Exceptions: // System.ArgumentException: // Load Failed // currentUser is to check validation protected void LoadInternal(EventBase eventBase, UserBase currentUser, bool loadChildren) { try { mEventBaseDAL.Load(eventBase, eventBase.UniqueID); mEventTimeInfoBO.Load(eventBase.EventTimeInfo); mEventLocationBO.Load(eventBase.EventLocation); mResourceDescriptionBO.Load(eventBase.ResourceDescription); if (loadChildren) { List <UInt64> uniqueIDs = mEventBaseDAL.GetChildrenUniqueIDs(eventBase.UniqueID); foreach (UInt64 tempUniqueID in uniqueIDs) { EventBase childEventBase = new EventBase(tempUniqueID); Load(childEventBase, currentUser); eventBase.EventChildren.Add(childEventBase); } uniqueIDs = mItemBaseDAL.GetChildrenUniqueIDsByEventParent(eventBase.UniqueID); foreach (UInt64 tempUniqueID in uniqueIDs) { ItemBase childItemBase = new ItemBase(tempUniqueID); mItemBaseBO.Load(childItemBase); eventBase.ItemChildren.Add(childItemBase); } uniqueIDs = mHoldingsInfoBO.GetUniqueIDsByEventOwner(eventBase.UniqueID); foreach (UInt64 tempUniqueID in uniqueIDs) { HoldingsInfo holdingsInfo = new HoldingsInfo(tempUniqueID); mHoldingsInfoBO.Load(holdingsInfo); // Should I load it here?? eventBase.HoldingsInfo.Add(holdingsInfo); } } } catch { throw new System.ArgumentException("Load Failed", "eventBase"); } }