public ActionResult Create(article a) { if (ModelState.IsValid) { ause.AddArticle(a); return RedirectToAction("Index"); } else { return View(); } }
public ActionResult Edit(int id, article a) { article article = ause.getArticle(id); //article.pubDate = Request.Form["pubDate"]; article.text = Request.Form["text"]; article.title = Request.Form["title"]; article.video = Request.Form["video"]; ause.UpdateArticle(article); return RedirectToAction("Index"); }
public article getArticle(int id) { article a = new article(); a = utwk.ArticleRepository.GetById(id); return a; }
public article UpdateArticle(article a ) { utwk.ArticleRepository.Update(a); return a; }
public void AddArticle(article a) { utwk.ArticleRepository.Add(a); utwk.Commit(); }