示例#1
0
        public async Task <IActionResult> BookPageDetail(Guid Id)
        {
            var content = await contentBusiness.GetContentById(Id);

            ViewData["DataModel"] = content.MediaResource.OrderBy(x => x.Order).Select(x => x.ActualPath).ToList();
            return(View());
        }
示例#2
0
        public async Task <IActionResult> AddOrUpdate(Guid?Id)
        {
            ViewData["DataType"] = typeof(ContentEntry);
            if (Id != null)
            {
                var contentEntry = await contentBusiness.GetContentById(Id.Value);

                ViewData["DataModel"] = contentEntry;
            }

            return(View());
        }
示例#3
0
        public async Task <IActionResult> GetContentDetail(Guid Id)
        {
            var          userIdStr = User.Claims?.FirstOrDefault(x => x.Type == "OryxUser")?.Value;
            ContentEntry apiMsg;

            if (!string.IsNullOrEmpty(userIdStr))
            {
                apiMsg = await contentBusiness.GetContentByIdSetLog(Id, userIdStr);
            }
            else
            {
                apiMsg = await contentBusiness.GetContentById(Id);
            }


            return(Json(apiMsg));
        }
示例#4
0
        public async Task OnGet(Guid?cid)
        {
            await HttpContext.Session.LoadAsync();

            var userId = HttpContext.Session.GetString(UserAccountBusiness.UserAccountSessionkey);

            if (cid != null)
            {
                contentEntry = await contentBusiness.GetContentById(cid.Value);

                if (contentEntry.Order > 1)
                {
                    if (string.IsNullOrEmpty(userId))
                    {
                        NeedPay = true;
                    }
                    else
                    {
                        var _userId   = Guid.Parse(userId);
                        var payapiLog = userAccountBusiness.userAccountAccessor.All <PayAPILog>().FirstOrDefault(x => x.UserAccountId == _userId);
                        if (payapiLog == null)
                        {
                            NeedPay = true;
                        }
                        else
                        {
                            if (payapiLog.EndTime == null || payapiLog.EndTime < DateTime.Now)
                            {
                                NeedPay = true;
                            }
                        }
                    }
                }
                NextCid = await contentBusiness.GetNextContentId(contentEntry);

                PrevCid = await contentBusiness.GetPrevContentId(contentEntry);
            }
            else
            {
                NotFound();
            }
        }
示例#5
0
        public async Task OnGet(Guid id)
        {
            var content = await contentBusiness.GetContentById(id);

            ImgList = content.MediaResource.Select(x => x.ActualPath).ToList();
        }