Example #1
0
        protected override void Render(HtmlTextWriter writer)
        {
            var builder = new StringBuilder();

            var body = new RequestBody();

            var publishmentSystemId = body.AdministratorInfo.PublishmentSystemId;

            _publishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(publishmentSystemId);
            var scripts = SiteLoading.GetScript(_publishmentSystemInfo, ELoadingType.ContentTree, null);

            builder.Append(scripts);
            if (Page.Request.QueryString["PublishmentSystemID"] != null)
            {
                if (!StringUtils.EqualsIgnoreCase(publishmentSystemId.ToString(), Page.Request.QueryString["PublishmentSystemID"]))
                {
                    PageUtils.RedirectToErrorPage("你对此站点无权限!");
                    return;
                }
                try
                {
                    var publishmentSystemIdList = new List <int>();
                    publishmentSystemIdList.Add(publishmentSystemId);
                    publishmentSystemIdList.AddRange(PublishmentSystemManager.GetPublishmentSystemIdListByParentId(publishmentSystemId));
                    foreach (var publishmentSystem in publishmentSystemIdList)
                    {
                        var publishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(publishmentSystem);
                        builder.Append(SiteLoading.GetSiteRowHtml(publishmentSystemInfo, publishmentSystemId, body.AdministratorInfo.UserName, publishmentSystemId));
                    }
                }
                catch (Exception ex)
                {
                    PageUtils.RedirectToErrorPage(ex.Message);
                }
            }
            writer.Write(builder);
        }