public void Edit(EditAdvertisementViewModel model) { Advertisement getAdv = advertisementService.getAdvertisementId(model.AdvertisementId); getAdv.AdvertisementName = model.AdvertisementName; getAdv.Description = model.Description; getAdv.Cost = model.Cost; advertisementService.save(); }
public ActionResult Edit(EditAdvertisementViewModel model) { if (ModelState.IsValid) { editAdvertisement.Edit(model); return(RedirectToAction("UserAdvertisement", "User")); } return(View()); }