예제 #1
0
        private PicturesViewModel GetPictures(int page = 1)
        {
            var picturesModel = new PicturesViewModel();
            PictureClient pictureClient = new PictureClient();

            var resp = pictureClient.Get(page, PerPage);
            picturesModel.ImageList.AddRange(PictureHelper.GetPictureData(resp.Items));
            picturesModel.PagingInfo = new PagingInfo()
            {
                CurrentPage = 1,
                ItemsPerPage = PerPage,
                TotalItems = resp.TotalItems
            };
            return picturesModel;
        }
 private PicturesViewModel GetPictures(int page = 1)
 {
     var picturesModel = new PicturesViewModel();
     PictureClient pictureClient = new PictureClient();
     string cookie = HttpContext.Request.Cookies["sessionId"].Value;
     ;
     var userId = SessionHelper.GetAuthorizedUser(cookie);
     if (userId == null) return null;
     var resp = pictureClient.GetByUser(userId.Value, page, PerPage);
     picturesModel.ImageList.AddRange(PictureHelper.GetPictureData(resp.Items));
     picturesModel.PagingInfo = new PagingInfo()
     {
         CurrentPage = 1,
         ItemsPerPage = PerPage,
         TotalItems = resp.TotalItems
     };
     return picturesModel;
 }