public ActionResult EditArticle(InformationModel model)
 {
     if (ModelState.IsValid)
     {
         var information = _db.Informations.Find(model.Id);
         model.ApplyChange(information);
         _db.Entry(information).State = EntityState.Modified;
         _db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View("CreateArticle", model));
 }
        public ActionResult CreateArticle(InformationModel model)
        {
            if (ModelState.IsValid)
            {
                var information = new Information();
                model.ApplyChange(information);

                _db.Informations.Add(information);
                _db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View("CreateArticle", model));
        }
        public ActionResult CreateNews(InformationModel model, HttpPostedFileBase file)
        {
            if (ModelState.IsValid)
            {
                if (file != null && file.ContentLength > 0)
                {
                    //do whatever you want with the file
                }

                var information = new Information();
                model.ApplyChange(information);

                _db.Informations.Add(information);
                _db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View("CreateArticle", model));
        }