public ActionResult Edit(NewsItem newsItem, HttpPostedFileBase file)
        {
            var filePath = HttpContext.Server.MapPath("../MyFiles");

            var fullPath = Path.Combine(filePath, "news.jpg");

            if(file!=null)
                ImageProcessor.ResizeAndSaveImage(400,400, fullPath, file.InputStream);
            else
            {
                //delete news image
                if(System.IO.File.Exists(fullPath))
                    System.IO.File.Delete(fullPath);
            }

            using (var artGalleryDbContext = new ArtGalleryDBContext())
            {
                var currentNews = artGalleryDbContext.NewsItem.FirstOrDefault();
                if (currentNews != null)
                {
                    currentNews.Body = newsItem.Body;
                    currentNews.Subject = newsItem.Subject;
                }
                else
                    artGalleryDbContext.NewsItem.Add(newsItem);

                artGalleryDbContext.SaveChanges();
            }

            return RedirectToAction("Index");
            //news.Image = new byte[file.InputStream.Length];
            //file.InputStream.Rea
        }
        public ActionResult LandingPagePictureReplacer(int landPageItemId, int newPictureId)
        {
            using(var artDb = new ArtGalleryDBContext())
            {
                var landingPageDal = new LandingPageDal(artDb);
                var landingPageItem = landingPageDal.Enitities.FirstOrDefault(x => x.Id == landPageItemId);
                landingPageItem.PictureId = newPictureId;
                artDb.SaveChanges();

            }
            return RedirectToAction("Index", "Home");
        }