Пример #1
0
        public void DownloadCart_02_GetCart()
        {
            UserProfileInfo user = serviceUser.GetCurrentUser();

            IList <DownloadCartItem> downloadCart = serviceDownload.GetByUserId(user.Id);

            Assert.IsTrue(downloadCart.Count > 0);
            DownloadCartItem first = downloadCart[0];

            Assert.IsNotNull(first);
            Assert.IsNotNull(first.File);
            Assert.IsFalse(String.IsNullOrEmpty(first.File.PublicUrl));
        }
Пример #2
0
        // GET: /DownloadCart/
        public ActionResult Index()
        {
            var downloadcarts = serviceDownloadCart.GetByUserId(CurrentUser.Id);
            List <VMDownloadCartItem> model = new List <VMDownloadCartItem>();

            foreach (var item in downloadcarts)
            {
                model.Add(new VMDownloadCartItem()
                {
                    FileName    = item.File.DisplayName,
                    Id          = item.Id,
                    ProjectName = item.File.Project.Name,
                    Url         = item.File.PublicUrl
                });
            }
            return(View(model));
        }