Пример #1
0
 public ActionResult Create(article a)
 {
     if (ModelState.IsValid)
         {
             ause.AddArticle(a);
             return RedirectToAction("Index");
         }
         else
         {
             return View();
         }
 }
Пример #2
0
        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");
        }
Пример #3
0
 public article getArticle(int id)
 {
     article a = new article();
     a = utwk.ArticleRepository.GetById(id);
     return a;
 }
Пример #4
0
 public article UpdateArticle(article a )
 {
     utwk.ArticleRepository.Update(a);
     return a;
 }
Пример #5
0
 public void AddArticle(article a)
 {
     utwk.ArticleRepository.Add(a);
     utwk.Commit();
 }