public string GetLoadingSites(int parentId, string administrator, int publishmentSystemId) { var arrayList = new ArrayList(); var sitesIdList = DataProvider.PublishmentSystemDao.GetPublishmentSystemIdListByParent(parentId); foreach (int siteId in sitesIdList) { var siteInfo = PublishmentSystemManager.GetPublishmentSystemInfo(siteId); arrayList.Add(SiteLoading.GetSiteRowHtml(siteInfo, -1, administrator, publishmentSystemId)); } StringBuilder builder = new StringBuilder(); foreach (string item in arrayList) { builder.Append(item); } return(builder.ToString()); }
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); }