예제 #1
0
        private void Bind()
        {
            ShareSiteMapProvider ssmp = new ShareSiteMapProvider();
            var currNode = ssmp.FindSiteMapNode(HttpContext.Current);
            var bll      = new ContentDetail();
            var model    = bll.GetModelByTitle(currNode.Title);

            if (model == null)
            {
                MessageBox.Messager(this.Page, MC.Submit_Data_NotExists, MC.AlertTitle_Ex_Error, "error");
                return;
            }

            StringBuilder sb = new StringBuilder();

            sb.Append(model.ContentText);

            string picUrl     = PictureUrlHelper.GetUrl(model.FileDirectory, model.RandomFolder, model.FileExtension, EnumData.PictureType.OriginalPicture, EnumData.Platform.PC);
            var    picFullPth = Server.MapPath("~" + picUrl + "");
            int    width      = 0;
            int    height     = 0;

            if (File.Exists(picFullPth))
            {
                var img = System.Drawing.Image.FromFile(picFullPth);
                width  = img.Width;
                height = img.Height;
            }
            sb.AppendFormat(@"<div id=""myDataAppend"" style=""display:none;"">{{""banner"":""{0}"",""width"":""{1}"",""height"":""{2}""}}</div>", picUrl.Replace("/Files/", "/sw/Files/"), width, height);

            ltrMyData.Text = sb.ToString();
        }
예제 #2
0
        private void Bind()
        {
            ShareSiteMapProvider ssmp = new ShareSiteMapProvider();
            var currNode = ssmp.FindSiteMapNode(HttpContext.Current);

            this.Page.Title = currNode.Title;

            var aId = Guid.Empty;

            if (!string.IsNullOrWhiteSpace(Request.QueryString["aId"]))
            {
                Guid.TryParse(Request.QueryString["aId"], out aId);
            }
            if (!aId.Equals(Guid.Empty))
            {
                if (phUc.FindControl("UCRArticleDetail") == null)
                {
                    Control ctl = this.LoadControl("~/WebUserControls/UCRArticleDetail.ascx");
                    ctl.ID = "UCRArticleDetail";
                    phUc.Controls.Clear();
                    phUc.Controls.Add(ctl);
                }
            }
            else
            {
                BindUc(currNode.Title);
            }

            var bll   = new ContentDetail();
            var model = bll.GetModelByTitle(currNode.Title);

            if (model == null)
            {
                MessageBox.Messager(this.Page, MC.Submit_Data_NotExists, MC.AlertTitle_Ex_Error, "error");
                return;
            }

            StringBuilder sb = new StringBuilder();

            sb.Append(model.ContentText);

            string picUrl = PictureUrlHelper.GetUrl(model.FileDirectory, model.RandomFolder, model.FileExtension, EnumData.PictureType.OriginalPicture, EnumData.Platform.PC);
            int    width  = 0;
            int    height = 0;

            sb.AppendFormat(@"<div id=""myDataAppend"" style=""display:none;"">{{""banner"":""{0}"",""width"":""{1}"",""height"":""{2}""}}</div>", picUrl.Replace("/Files/", "/sw/Files/"), width, height);

            ltrMyData.Text = sb.ToString();
        }
예제 #3
0
        private void Bind()
        {
            ShareSiteMapProvider ssmp = new ShareSiteMapProvider();
            var currNode = ssmp.FindSiteMapNode(HttpContext.Current);
            var bll      = new ContentDetail();
            var model    = bll.GetModelByTitle(currNode.Title);

            if (model == null)
            {
                MessageBox.Messager(this.Page, MC.Submit_Data_NotExists, MC.AlertTitle_Ex_Error, "error");
                return;
            }

            ltrMyData.Text = model.ContentText;
        }