public async Task <int> Update(HtmlLoadModel model) { var entity = await _pageDetailsRepository.GetById(model.Id); if (entity == null) { throw new NullReferenceException("Cannot find HTML !!!"); } entity.Description = model.Html; await _pageDetailsRepository.Update(entity); return(entity.RPageDetailsId); }
public async Task <HtmlLoadModel> Load(HtmlLoadModel model) { if (model.Id == 0) { } else { model = await GetById(model.Id); } model.Codes = await Lookup(); return(model); }
public async Task <IActionResult> PageDetails_Save(HtmlLoadModel model) { await _htmlService.Update(model); return(RedirectToAction("PageDetails")); }
public async Task <IActionResult> PageDetails_GetHTML(HtmlLoadModel model) { return(View("PageDetails", await _htmlService.Load(model))); }