public ActionResult AddNews(int id = 0) { var model = new NewsAddViewModel(); NewsTypeManager newsTypeManager = new NewsTypeManager(); var newsTypes = newsTypeManager.GetAll(); ViewBag.NewsTypes = newsTypes; if (id != 0) { var news = new NewsManager().Get(n => n.NewsId == id); model.News = news; } return(View(model)); }
public List <NewsType> Get() { var newsType = _newsTypeManager.GetAll(); return(newsType); }
public ActionResult ListNewsType() { var newsType = _newsTypeManager.GetAll(); return(View(newsType)); }