예제 #1
0
        /** Add new entry to ArchivedGifts table */
        private BLLAppDTO.ArchivedGiftResponseBLL?AddArchivedGift(Guid giftId, Guid userId, Guid receiverId)
        {
            // Create
            var archivedGiftBLL = new BLLAppDTO.ArchivedGiftFullBLL
            {
                StatusId       = new Guid(_archivedId),
                ActionTypeId   = new Guid(_activeId),
                GiftId         = giftId,
                UserGiverId    = userId,
                UserReceiverId = receiverId,
                DateArchived   = DateTime.UtcNow,
                IsConfirmed    = false
            };
            // Add
            var newArchivedGift = UOW.ArchivedGifts.Add(Mapper.MapArchivedGiftFullToDAL(archivedGiftBLL), userId);

            // Track
            UOW.AddToEntityTracker(newArchivedGift, archivedGiftBLL);
            // Check added data
            var isArchivalSuccessful = archivedGiftBLL.GiftId == giftId;

            return(newArchivedGift != null && isArchivalSuccessful?Mapper.MapArchivedGiftFullToResponse(archivedGiftBLL) : null);
        }
예제 #2
0
 public BLLAppDTO.ArchivedGiftResponseBLL MapArchivedGiftFullToResponse(BLLAppDTO.ArchivedGiftFullBLL inObject) // TODO: Fix
 {
     return(Mapper.Map <BLLAppDTO.ArchivedGiftResponseBLL>(inObject));
 }
예제 #3
0
 public DALAppDTO.ArchivedGiftDAL MapArchivedGiftFullToDAL(BLLAppDTO.ArchivedGiftFullBLL inObject)
 {
     return(Mapper.Map <DALAppDTO.ArchivedGiftDAL>(inObject));
 }