示例#1
0
        public ActionResult UpdatePhoto(int photoID)
        {
            ActionResult response = null;

            if (Session["RoleID"] != null && (byte)Session["RoleID"] == 3)
            {
                try
                {
                    response = View(PhotoMapper.PhotoDOtoPO(_dataAccess.ReadPhotoById(photoID)));
                }
                catch (Exception ex)
                {
                    LogFile.DataFile(ex: ex);
                    throw ex;
                }
                finally
                {
                }
            }
            else
            {
                TempData["Statement"] = "Please contact Admin to gain permissions to the page you are requesting.";
                response = RedirectToAction("Index", "Home");
            }
            return(response);
        }
示例#2
0
        public ActionResult ViewPhotoDetails(int photoID)
        {
            ActionResult response = null;
            PhotoDO      photo    = new PhotoDO();

            if (Session["RoleID"] != null)
            {
                try
                {
                    photo    = _dataAccess.ReadPhotoById(photoID);
                    response = View(PhotoMapper.PhotoDOtoPO(photo));
                }
                catch (Exception ex)
                {
                    LogFile.DataFile(ex: ex);
                }
                finally
                {
                }
            }
            else
            {
                TempData["Statement"] = "Please register to view this page.";
                response = RedirectToAction("Index", "Home");
            }
            return(response);
        }
示例#3
0
        public void SetBackgroundImageTempData()
        {
            int photoID;
            List <PhotoAlbumDO> junctionList = new List <PhotoAlbumDO>();

            try
            {
                junctionList = _dataAccess.ReadAllJunctions();
                PhotoAlbumBLO photoAlbumBLO = new PhotoAlbumBLO();
                photoID = photoAlbumBLO.PhotoInMostAlbums(PhotoAlbumMapper.ListPhotoAlbumDOtoPO(junctionList));
                PhotoPO mostCommonPhoto = PhotoMapper.PhotoDOtoPO(_photoDataAccess.ReadPhotoById(photoID));
                Session["BackgroundImageLocation"] = mostCommonPhoto.Photo;
            }
            catch (Exception ex)
            {
                LogFile.DataFile(ex: ex);
            }
            finally
            {
            }
        }