Beispiel #1
0
 public IList <Image> GetAllImagesByPage(Helpers.ApplicationEnums.PageEnum id)
 {
     try
     {
         IContentRepository repos = new ContentRepository();
         return(repos.FetchAllImagesForPage(id, false));
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #2
0
        public ActionResult EditPage(Helpers.ApplicationEnums.PageEnum id = ApplicationEnums.PageEnum.HOME)
        {
            try
            {
                IContentService contentService = new ContentService();
                //  throw new Exception();

                var page = contentService.GetPage(id, false);
                page.PageContent.Add(new Content {
                    PageId = page.PageId, ContentId = 0
                });

                return(View(page));
            }
            catch (Exception e)
            {
                log.ErrorFormat("Error Caught in Edit Page {0}", e.ToString());
                return(RedirectToAction("ErrorPage", new { e = e, errorDesc = string.Format("Error found while Editing Page {0}", id.ToString()) }));
            }
        }
Beispiel #3
0
        public ActionResult ManageImages(Helpers.ApplicationEnums.PageEnum id = ApplicationEnums.PageEnum.HOME, string type = "")
        {
            try
            {
                IContentService contentService = new ContentService();
                var             images         = contentService.GetAllImagesByPage(id);



                ViewBag.PageId = id;
                if (!string.IsNullOrWhiteSpace(type))
                {
                    ViewBag.Type = type;
                }
                return(View(images.ToList()));
            }
            catch (Exception)
            {
                throw;
            }
        }