예제 #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();
 }