public ActionResult CompleteStaged(ItemViewModelStringItemPrice viewModel)
        {
            var newViewModel = new ItemViewModel
            {
                ItemID = viewModel.ItemID,
                PalletGroupID = viewModel.PalletGroupID,
                CompanyID = viewModel.CompanyID,
                CategoryID = viewModel.CategoryID,
                UPC = viewModel.UPC,
                IsFeautured = viewModel.IsFeautured,
                ItemPrice = viewModel.ItemPrice.CurrencyAsDouble(),
                ImagePath = viewModel.ImagePath,
                Name = viewModel.Name,
                StockCount = viewModel.StockCount
            };
            _itemBll.CreateItem(newViewModel);
            _stagedItemBll.DeleteStagedItem(viewModel.UPC);

            return RedirectToAction("Index");
        }
Beispiel #2
0
 public void DestroyItem(ItemViewModel viewModel)
 {
     _itemDal.Destroy(ConvertViewModelToEntity(viewModel));
 }
Beispiel #3
0
 public void DeleteItem(ItemViewModel viewModel)
 {
     _itemDal.Create(ConvertViewModelToEntity(viewModel));
 }
Beispiel #4
0
 public int CreateItem(ItemViewModel viewModel)
 {
     return _itemDal.Create(ConvertViewModelToEntity(viewModel));
 }
Beispiel #5
0
 private Item ConvertViewModelToEntity(ItemViewModel viewModel)
 {
     return new Item
     {
         PalletGroupID = viewModel.PalletGroupID,
         CompanyID = viewModel.CompanyID,
         CategoryID = viewModel.CategoryID,
         Name = viewModel.Name,
         UPC = viewModel.UPC,
         IsFeatured = viewModel.IsFeautured,
         ImagePath = viewModel.ImagePath,
         Reviews = viewModel.Reviews,
         Tags = viewModel.Tags,
         Likes = viewModel.Likes,
         StockCount = viewModel.StockCount,
         ItemPrice = viewModel.ItemPrice
     };
 }