public IActionResult Edit(Guid id, Newsletter newsletter) { var model = _newsletterRepository.GetNewsletters() .FirstOrDefault(x => id == x.Id); model.Title = newsletter.Title; model.Desciption = newsletter.Desciption; model.BodyText = newsletter.BodyText; _newsletterRepository.Update(model); _newsletterRepository.Save(); return(RedirectToAction("ViewAll", "Newsletter")); }
public void UpdateNewsLetter(NewsLetterViewModel newsLetterVm) { var newsLetter = _newsLetterRepository.FindById(newsLetterVm.Id); if (newsLetter != null) { newsLetter.Status = newsLetterVm.Status; newsLetter.TotalReceiver = newsLetterVm.TotalReceiver; newsLetter.Title = newsLetterVm.Title; newsLetter.Content = newsLetterVm.Content; _newsLetterRepository.Update(newsLetter); } }
public int UpdateNewsLetter(DLModel.NewsLetter _policy) { return(_newsLetterRepository.Update(_policy)); }