public void Edit(DTOShopItem context) { ShopItem model = new ShopItem { Id = context.Id, Name = context.Name, Description = context.Description, Price = context.Price, PhotoPath = context.PhotoPath }; unitOfWork.ShopItemRepository.Edit(model); }
public void Create(DTOShopItem model) { var shopItem = new ShopItem { Name = model.Name, Description = model.Description, Price = model.Price, PhotoPath = model.PhotoPath }; unitOfWork.ShopItemRepository.Create(shopItem); }
private void editItem(ShopItemViewModel context, string modelPath) { DTOShopItem model = new DTOShopItem { Id = context.Id, Name = context.Name, Description = context.Description, Price = context.Price, PhotoPath = modelPath }; itemService.Edit(model); }
private void createItem(ShopItemViewModel context, string modelPath) { try { DTOShopItem model = new DTOShopItem { Name = context.Name, Description = context.Description, Price = context.Price, PhotoPath = modelPath }; itemService.Create(model); } catch (Exception) { throw new Exception("Failed to create item on server"); } }