public ActionResult Edit([Bind(Include = "Id,Title,Published,content,RowVersion")] ViewProjectNews projectNews)
 {
     if (ModelState.IsValid)
     {
         projectNews.ImportFromModel(mngr.Edit(projectNews.ExportToModel()));
         return(RedirectToAction("Index"));
     }
     return(View(projectNews));
 }
        // GET: ProjectNews
        public ActionResult Index()
        {
            List <ViewProjectNews> vlist = new List <ViewProjectNews>();
            List <ProjectNews>     list  = mngr.List();

            foreach (var v in list)
            {
                ViewProjectNews vl = new ViewProjectNews();
                vl.ImportFromModel(v);
                vlist.Add(vl);
            }
            return(View(vlist));
        }
        // GET: ProjectNews/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ProjectNews projectNews = mngr.Details(id);

            if (projectNews == null)
            {
                return(HttpNotFound());
            }
            ViewProjectNews vl = new ViewProjectNews();

            vl.ImportFromModel(projectNews);

            return(View(vl));
        }
        public ActionResult GetNewsByProjectId(int id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var projectNews = mngr.ListByProjectId(id);
            List <ViewProjectNews> vlist = new List <ViewProjectNews>();
            List <ProjectNews>     list  = projectNews;

            if (list != null)
            {
                foreach (var v in list)
                {
                    ViewProjectNews vl = new ViewProjectNews();
                    vl.ImportFromModel(v);
                    vlist.Add(vl);
                }
            }
            return(View(vlist));
        }