public ActionResult Create(Article article) { try { if (ModelState.IsValid) { _articleService.Add(article); TempData["Messeage"] = ValidateMesseage.AddSuccessful; return RedirectToAction("Index"); } return View(article); } catch (WebException ex) { TempData["Messeage"] = ex.Message; return RedirectToAction("Index"); } }
public void Update(Article entity) { _articleRepository.Update(entity); }
public void Add(Article entity) { _articleRepository.Insert(entity); }
public ActionResult Edit(int id, Article article) { try { if (ModelState.IsValid) { _articleService.Update(article); TempData["Messeage"] = ValidateMesseage.UpdateSuccessful; return RedirectToAction("Index"); } return View(article); } catch { return View(); } }