public ActionResult VideosList(int pageIndex = 1, string viewName = "VideosList") { int pageSize = 6; int startIndex = (pageIndex > 1) ? (((pageIndex - 1) * pageSize) + 1) : 0; int endIndex = pageIndex * pageSize; int totalItemCount = 0; Maticsoft.BLL.CMS.Video video = new Maticsoft.BLL.CMS.Video(); PagedList<Maticsoft.Model.CMS.Video> model = new PagedList<Maticsoft.Model.CMS.Video>(video.GetListByPage(startIndex, endIndex, out totalItemCount), pageIndex, pageSize, totalItemCount); ((dynamic) base.ViewBag).pageIndex = pageIndex; ((dynamic) base.ViewBag).totalPage = (int) Math.Ceiling((double) (((double) totalItemCount) / ((double) pageSize))); return base.View(viewName, model); }
private void ShowInfo() { Maticsoft.Model.CMS.Video model = new Maticsoft.BLL.CMS.Video().GetModel(this.VideoID); if (model != null) { string videoUrl = model.VideoUrl; int urlType = model.UrlType; if (!string.IsNullOrWhiteSpace(videoUrl) && (urlType == 0)) { this.localVideoUrl = videoUrl; } } }
public ActionResult VideoDetail(int vid = -1, string viewName = "VideoDetail") { Maticsoft.Model.CMS.Video modelByCache = new Maticsoft.BLL.CMS.Video().GetModelByCache(vid); return base.View(viewName, modelByCache); }
private void ShowInfo() { Maticsoft.Model.CMS.Video modelEx = new Maticsoft.BLL.CMS.Video().GetModelEx(this.VideoID); if (modelEx == null) { return; } this.lblTitle.Text = modelEx.Title; this.lblDescription.Text = modelEx.Description; if (modelEx.AlbumID.HasValue) { this.lblAlbumID.Text = modelEx.AlbumID.ToString(); } this.lblCreatedUserID.Text = modelEx.CreatedUserName; this.lblCreatedDate.Text = modelEx.CreatedDate.ToString(); if (modelEx.LastUpdateUserID.HasValue) { this.lblLastUpdateUserID.Text = modelEx.LastUpdateUserName; } if (modelEx.LastUpdateDate.HasValue) { this.lblLastUpdateDate.Text = modelEx.LastUpdateDate.ToString(); } this.lblSequence.Text = modelEx.Sequence.ToString(); if (modelEx.VideoClassID.HasValue) { this.lblVideoClassID.Text = modelEx.VideoClassID.ToString(); } this.lblIsRecomend.Text = base.GetboolText(modelEx.IsRecomend); this.imgImageUrl.ImageUrl = Maticsoft.Components.MvcApplication.UploadFolder + modelEx.ImageUrl; this.imgThumbImageUrl.ImageUrl = Maticsoft.Components.MvcApplication.UploadFolder + modelEx.ThumbImageUrl; this.imgNormalImageUrl.ImageUrl = Maticsoft.Components.MvcApplication.UploadFolder + modelEx.NormalImageUrl; if (modelEx.TotalTime.HasValue) { this.lblTotalTime.Text = TimeParser.SecondToDateTime(modelEx.TotalTime.Value); } this.lblTotalComment.Text = modelEx.TotalComment.ToString(); this.lblTotalFav.Text = modelEx.TotalFav.ToString(); this.lblTotalUp.Text = modelEx.TotalUp.ToString(); this.lblReference.Text = modelEx.Reference.ToString(); this.lblPvCount.Text = modelEx.PvCount.ToString(); this.lblTags.Text = modelEx.Tags; string videoUrl = modelEx.VideoUrl; this.lblVideoUrl.Text = videoUrl; int urlType = modelEx.UrlType; if (!string.IsNullOrWhiteSpace(videoUrl)) { switch (urlType) { case 0: this.trLocalVideo.Visible = true; this.trVideoFormat.Visible = true; this.localVideoUrl = videoUrl; break; case 1: { this.trDomain.Visible = true; string flashUrl = this.GetFlashUrl(modelEx.VideoUrl); if (!string.IsNullOrWhiteSpace(flashUrl)) { this.trOnlineVideo.Visible = true; this.onlineVideoUrl = flashUrl; } goto Label_02EA; } } } Label_02EA: this.lblUrlType.Text = this.GetUrlType(urlType); this.lblVideoFormat.Text = modelEx.VideoFormat; this.lblDomain.Text = modelEx.Domain; this.lblGrade.Text = modelEx.Grade.ToString(); string attachment = modelEx.Attachment; if (!string.IsNullOrWhiteSpace(attachment)) { this.lnkAttachment.NavigateUrl = Maticsoft.Components.MvcApplication.UploadFolder + attachment; } this.lblPrivacy.Text = this.GetVideoPrivacy(modelEx.Privacy); this.lblState.Text = this.GetVideoState(modelEx.State); this.lblRemark.Text = modelEx.Remark; }
public int? GetVideInfo(object target, out string videourl, out int? UType, out int vid) { videourl = ""; UType = 0; vid = 0; if (!StringPlus.IsNullOrEmpty(target) && PageValidate.IsNumber(target.ToString())) { Maticsoft.Model.CMS.Video modelEx = new Maticsoft.BLL.CMS.Video().GetModelEx(Globals.SafeInt(target.ToString(), 0)); if (modelEx == null) { return null; } vid = modelEx.VideoID; string videoUrl = modelEx.VideoUrl; UType = new int?(modelEx.UrlType); if (UType.HasValue) { switch (UType.Value) { case 0: videourl = videoUrl; return UType; case 1: { string flashUrl = this.GetFlashUrl(videoUrl); if (!string.IsNullOrWhiteSpace(flashUrl)) { videourl = flashUrl; } return UType; } } } } return UType; }