示例#1
0
        public ActionResult Portfolio()
        {
            List<PhotosPO> mappedPhotos = new List<PhotosPO>();
            ActionResult oResult = RedirectToAction("Index", "Home");
            try
            {
                mappedPhotos = PhotosMapper.MapDoToPO(dataAccess.ViewPhotosById(4));
                oResult = View(mappedPhotos);
            }
            catch (Exception ex)
            {
                //Logs exception using exceptionLog class.
                exceptionLog.ExceptionLog("Critical", ex.Message, "HomeController", "Portfolio", ex.StackTrace);
            }

            return oResult;
        }
        public ActionResult Index(long albumId)
        {
            //Instanciating a list of photo objects to fill.
            List <PhotosPO> mappedItems = new List <PhotosPO>();

            try
            {
                //Display photos that belong to user and provide actions to authenticated users.
                List <PhotosDO> dataObjects = dataAccess.ViewPhotosById(albumId);
                mappedItems = PhotosMapper.MapDoToPO(dataObjects);
            }
            catch (Exception ex)
            {
                //Logs exception using exceptionLog class.
                exceptionLog.ExceptionLog("Critical", ex.Message, "PhotosController", "Index", ex.StackTrace);
                TempData["Error"] = ex.Message;
            }

            return(View(mappedItems));
        }