Пример #1
0
 public ActionResult EditBlogPost(BlogPost m_BlogPost)
 {
     BlogPost a_BlogPost = BlogPostRepository.RetrieveOne(m_BlogPost.Id);
     m_BlogPost.PageWorkFlowState = a_BlogPost.PageWorkFlowState;
     if (ModelState.IsValid)
     {
         m_BlogPost.BlogPostSet();
         BlogPostRepository.Update(m_BlogPost);
         return RedirectToAction("Index", "BlogPost");
     }
     else
     {
         if (m_BlogPost.Categories == null)
         {
             List<int> mCats = new List<int>();
             m_BlogPost.Categories = mCats;
         }
         ViewBag.Categories = BlogPostRepository.getCategories();
         ViewBag.myContentGroups = Utility.ContentGroups();
         ViewBag.NewsImages = ImageRepository.RetrieveAll(23);
         return View("EditBlogPost", m_BlogPost);
     }
 }