public void CreateShop(ShopCUDTO model) { var shop = _mapper.Map <Shop>(model); _uow.Shop.Create(shop); _uow.Commit(); }
public IActionResult Edit(int Id) { ShopCUDTO Shop = _shopOperation.GetShop(Id); var model = GetUpdateShopModel(Shop); return(View(model)); }
public void DeleteShop(ShopCUDTO model) { var dbShop = _uow.Shop.GetShop(model.Id); _mapper.Map <ShopCUDTO, Shop>(model, dbShop); _uow.Shop.Delete(dbShop); _uow.Commit(); }
public IActionResult Delete(int Id) { ShopCUDTO Shop = _shopOperation.GetShop(Id); _shopOperation.DeleteShop(Shop); return(RedirectToAction(nameof(Index))); }
private ShopCUVM GetCreateShopModel(ShopCUDTO shop) { IEnumerable <ProductListDTO> Products = _productOperation.GetAll(); ShopCUVM model = new ShopCUVM() { Components = _shopOperation.GetShopFormComponents(), Shop = shop, Products = Products }; return(model); }