예제 #1
0
 private void UpdateStagedItems(StagedItemDTO item)
 {
     _stagedItemDal.Update(DTOtoEntityMapper(item));
 }
예제 #2
0
        public int UpdateFromStagedItem(StagedItemDTO staged)
        {
            var matchingEntity = _itemDal.Get(staged.UPC);

            matchingEntity.StockCount = staged.StockCount;
            matchingEntity.ItemPrice = staged.ItemPrice;

            return _itemDal.Update(matchingEntity);
        }
예제 #3
0
 private bool StagedItemAlreadyExists(StagedItemDTO item)
 {
     try
     {
         return (_stagedItemDal.Get(item.UPC) != null);
     }
     catch (Exception)
     {
         return false;
     }
 }
예제 #4
0
 private bool ItemAlreadyExits(StagedItemDTO item)
 {
     return (_itemBll.GetItemByUPC(item.UPC) != null);
 }
예제 #5
0
 private StagedItem DTOtoEntityMapper(StagedItemDTO stagedItemDTO)
 {
     return new StagedItem
     {
         ItemPrice = stagedItemDTO.ItemPrice,
         Name = CleanName(stagedItemDTO.Name),
         UPC = stagedItemDTO.UPC,
         StockCount = stagedItemDTO.StockCount
     };
 }
예제 #6
0
 private void CreateStagedItems(StagedItemDTO stagedItemDTO)
 {
     _stagedItemDal.Create(DTOtoEntityMapper(stagedItemDTO));
 }
예제 #7
0
 private StagedItem ConvertDTOToEntity(StagedItemDTO dto)
 {
     return new StagedItem
     {
         ID = dto.ID,
         ItemPrice = dto.ItemPrice,
         Name = dto.Name,
         StockCount = dto.StockCount,
         UPC = dto.UPC
     };
 }