public ActionResult VideoGallery() { AdminViewModel av = new AdminViewModel(); av.VideoGalleries = NewsEventsManager.GetAllVideoGallery(); return(View(av)); }
public ActionResult News() { AdminViewModel av = new AdminViewModel(); av.NewsList = NewsEventsManager.GetAllNews(); return(View(av)); }
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")); }
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)); }
public ActionResult Gallery() { PublicViewModel pv = new PublicViewModel(); pv.ImageGalleries = NewsEventsManager.GetAllImageGallery(); pv.VideoGalleries = NewsEventsManager.GetAllVideoGallery(); return(View(pv)); }
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")); }
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")); }
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")); }
public ActionResult DeleteImage(long Id) { NewsEventsManager.DeleteImageGallery(Id); return(RedirectToAction("ImageGallery")); }
public ActionResult DeleteNews(long Id) { NewsEventsManager.DeleteNews(Id); return(RedirectToAction("News")); }