コード例 #1
0
        public ActionResult VideoGallery()
        {
            AdminViewModel av = new AdminViewModel();

            av.VideoGalleries = NewsEventsManager.GetAllVideoGallery();
            return(View(av));
        }
コード例 #2
0
        public ActionResult News()
        {
            AdminViewModel av = new AdminViewModel();

            av.NewsList = NewsEventsManager.GetAllNews();
            return(View(av));
        }
コード例 #3
0
        public ActionResult InsertImage(AdminViewModel av, HttpPostedFileBase image)
        {
            if (av.ImageGallery != null && av.ImageGallery.Id > 0)
            {
                if (av.File != null)
                {
                    av.ImageGallery.ImagePath = _UploadSingleImage(av, image);
                }

                NewsEventsManager.UpdateImageGallery(av.ImageGallery);
            }
            else
            {
                if (av.ImageGallery != null)
                {
                    if (av.File != null)
                    {
                        av.ImageGallery.ImagePath = _UploadSingleImage(av, image);

                        NewsEventsManager.InsertImageGallery(av.ImageGallery);
                    }
                    else
                    {
                        FlashMessage.Danger("Image Required");
                        return(View(av));
                    }
                }
            }

            return(RedirectToAction("ImageGallery"));
        }
コード例 #4
0
        public ActionResult News(long?newsId)
        {
            PublicViewModel publicViewModel = new PublicViewModel();

            if (Session["CompanySetting"] != null)
            {
                publicViewModel.CompanySetting = (CompanySetting)Session["CompanySetting"];
            }
            else
            {
                publicViewModel.CompanySetting = CompanySettingsManager.GetCompanySettings(1);
            }

            if (string.IsNullOrEmpty(newsId.ToString()))
            {
                publicViewModel.NewsList = NewsEventsManager.GetAllNews();
                if (publicViewModel.NewsList.Any() && publicViewModel.NewsList.Count > 0)
                {
                    publicViewModel.News = publicViewModel.NewsList.FirstOrDefault();
                }
            }
            else
            {
                publicViewModel.NewsList = NewsEventsManager.GetAllNews();
                publicViewModel.News     = NewsEventsManager.GetNewsById(newsId);
            }

            return(View(publicViewModel));
        }
コード例 #5
0
        public ActionResult Gallery()
        {
            PublicViewModel pv = new PublicViewModel();

            pv.ImageGalleries = NewsEventsManager.GetAllImageGallery();
            pv.VideoGalleries = NewsEventsManager.GetAllVideoGallery();

            return(View(pv));
        }
コード例 #6
0
        public ActionResult UpdateImage(AdminViewModel av, long Id)
        {
            if (Id > 0)
            {
                av.ImageGallery = NewsEventsManager.GetImageGalleryById(Id);
                if (av.ImageGallery != null)
                {
                    return(View("~/Views/ImageAndVideo/InsertImage.cshtml", av));
                }
            }

            return(RedirectToAction("ImageGallery"));
        }
コード例 #7
0
        public ActionResult UpdateNews(AdminViewModel av, long Id)
        {
            if (Id > 0)
            {
                av.News = NewsEventsManager.GetNewsById(Id);
                if (av.News != null)
                {
                    return(View("~/Views/News/InsertNews.cshtml", av));
                }
            }

            return(RedirectToAction("News"));
        }
コード例 #8
0
        public ActionResult InsertVideo(AdminViewModel av)
        {
            if (av.VideoGallery != null && av.VideoGallery.Id > 0)
            {
                NewsEventsManager.UpdateVideoGallery(av.VideoGallery);
            }
            else
            {
                if (av.VideoGallery != null)
                {
                    NewsEventsManager.InsertVideoGallery(av.VideoGallery);
                }
            }

            return(RedirectToAction("VideoGallery"));
        }
コード例 #9
0
 public ActionResult DeleteImage(long Id)
 {
     NewsEventsManager.DeleteImageGallery(Id);
     return(RedirectToAction("ImageGallery"));
 }
コード例 #10
0
 public ActionResult DeleteNews(long Id)
 {
     NewsEventsManager.DeleteNews(Id);
     return(RedirectToAction("News"));
 }