Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // 1 获取分类的信息
            string requestArticleGuid = Request.QueryString["ArticleGuid"];
            if (string.IsNullOrEmpty(requestArticleGuid) || !Wis.Toolkit.Validator.IsGuid(requestArticleGuid))
            {
                Warning.InnerHtml = "不正确的文章编号";
                return;
            }

            if (articleManager == null) articleManager = new Wis.Website.DataManager.ArticleManager();
            Guid articleGuid = new Guid(requestArticleGuid);
            article = articleManager.GetArticleByArticleGuid(articleGuid);
            if (string.IsNullOrEmpty(article.Title))
            {
                Warning.InnerHtml = "未读取到文章信息";
                return;
            }

            HyperLinkCategory.Text = article.Category.CategoryName;
            HyperLinkCategory.NavigateUrl = string.Format("ArticleList.aspx?CategoryGuid={0}", article.Category.CategoryGuid);
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // 临时目录不存在,则创建
            string outputPath = "~/Uploads/Temp/";
            string physicalOutputPath = Server.MapPath(outputPath);
            if (!System.IO.Directory.Exists(physicalOutputPath))
                System.IO.Directory.CreateDirectory(physicalOutputPath);

            #warning 在aspx中配置临时目录
            FileSystemProcessor fs = new FileSystemProcessor();
            fs.OutputPath = outputPath;
            DJUploadController1.DefaultFileProcessor = fs;
            VideoFile.FileProcessor = fs;

            // 获取文章信息
            string requestArticleGuid = Request.QueryString["ArticleGuid"];
            if (string.IsNullOrEmpty(requestArticleGuid) || !Wis.Toolkit.Validator.IsGuid(requestArticleGuid))
            {
                Warning.InnerHtml = "不正确的文章编号,请<a href='ArticleSelectCategory.aspx'>点击这里</a>重新操作";
                return;
            }
            this.ArticleGuid = new Guid(requestArticleGuid);
            if (article == null)
            {
                if (articleManager == null) articleManager = new Wis.Website.DataManager.ArticleManager();
                article = articleManager.GetArticleByArticleGuid(this.ArticleGuid);
            }

            //if (article.Category.ArticleType != 3)
            //{
            //    Wis.Toolkit.ClientScript.Window.Alert("当前内容不为视频内容,请先设定好该新闻分类的类别");
            //    Wis.Toolkit.ClientScript.Window.Redirect(string.Format("CategoryUpdate.aspx?CategoryGuid={0}", article.Category.CategoryGuid));
            //    return;
            //}

            HyperLinkCategory.Text = article.Category.CategoryName;
            HyperLinkCategory.NavigateUrl = string.Format("ArticleList.aspx?CategoryGuid={0}", article.Category.CategoryGuid);

            if (!article.Category.ThumbnailWidth.HasValue || !article.Category.ThumbnailHeight.HasValue)
            {
                Warning.InnerHtml = "缩微图的宽度和高度需要指定,请<a href='CategoryUpdate.aspx?CategoryGuid={0}' target='_blank'>点击这里</a>设定";
                return;
            }
            this.ThumbnailWidth = article.Category.ThumbnailWidth.Value;
            this.ThumbnailHeight = article.Category.ThumbnailHeight.Value;
        }