private void InitSpecial() { StringBuilder builder = new StringBuilder(); string specialInfoIds = ""; switch (this.m_SpecialInfoType) { case 1: { int generalId = DataConverter.CLng(HttpContext.Current.Request["GeneralId"]); if (generalId > 0) { specialInfoIds = Special.GetSpecialInfoIds(generalId); } break; } case 2: { int id = DataConverter.CLng(HttpContext.Current.Request["ItemId"]); if (id > 0) { specialInfoIds = CollectionItem.GetInfoById(id).SpecialId; } break; } } if (!string.IsNullOrEmpty(specialInfoIds)) { this.HdnSpecial.Value = specialInfoIds; string[] strArray = specialInfoIds.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < strArray.Length; i++) { SpecialInfo specialInfoById = Special.GetSpecialInfoById(DataConverter.CLng(strArray[i])); SpecialCategoryInfo specialCategoryInfoById = Special.GetSpecialCategoryInfoById(specialInfoById.SpecialCategoryId); builder.Append("\n<span id='SpecialSpanId" + specialInfoById.SpecialId + "'>"); builder.Append(specialCategoryInfoById.SpecialCategoryName + ">>" + specialInfoById.SpecialName); builder.Append(" <input type='button' class='button' onclick=\"javascript:DelSpecial('" + specialInfoById.SpecialId + "')\" value='删除此专题' /><br /></span>"); } } if (builder.Length <= 0) { builder.Append("<span id='SpecialSpanId0'>无专题<br /></span>"); } this.UlSpecial.InnerHtml = builder.ToString(); }
protected void RptContent_ItemDataBound(object sender, RepeaterItemEventArgs e) { if ((e.Item.ItemType == ListItemType.AlternatingItem) || (e.Item.ItemType == ListItemType.Item)) { Literal literal2; StringBuilder builder; FieldInfo dataItem = e.Item.DataItem as FieldInfo; this.InitTabByFieldType(e, dataItem); ExtendedLiteral literal = e.Item.FindControl("LitContentText") as ExtendedLiteral; Panel panel = e.Item.FindControl("PnlContent") as Panel; string status = this.contentDataTable.Rows[0][dataItem.FieldName].ToString(); if (dataItem.FieldType == FieldType.KeywordType) { status = StringHelper.ReplaceChar(this.contentDataTable.Rows[0][dataItem.FieldName].ToString(), '|', ' '); } switch (dataItem.FieldType) { case FieldType.SpecialType: literal2 = new Literal(); builder = new StringBuilder(); if (this.m_GeneralId > 0) { string[] strArray = Special.GetSpecialInfoIds(this.m_GeneralId).Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < strArray.Length; i++) { SpecialInfo specialInfoById = Special.GetSpecialInfoById(DataConverter.CLng(strArray[i])); SpecialCategoryInfo specialCategoryInfoById = Special.GetSpecialCategoryInfoById(specialInfoById.SpecialCategoryId); builder.Append("\n<span>"); builder.Append(DataSecurity.HtmlEncode(specialCategoryInfoById.SpecialCategoryName) + ">>" + DataSecurity.HtmlEncode(specialInfoById.SpecialName)); builder.Append("<br /></span>"); } } break; case FieldType.StatusType: literal.Text = this.GetStatusShow(status); return; case FieldType.ContentType: literal.BeginTag = "<iframe marginwidth='0' marginheight='0' frameborder='0' name='ContentPreview' width='650px' height='500px' src='ContentPreview.aspx?GeneralID=" + this.m_GeneralId.ToString() + "&fieldName=" + base.Server.UrlEncode(dataItem.FieldName) + "'></iframe>"; return; case FieldType.NodeType: literal.BeginTag = EasyOne.Contents.Nodes.ShowNodeNavigation(DataConverter.CLng(status)); return; case FieldType.InfoType: { Literal child = new Literal(); StringBuilder builder2 = new StringBuilder(); if (this.m_GeneralId > 0) { foreach (CommonModelInfo info4 in ContentManage.GetInfoList(this.m_GeneralId)) { builder2.Append("<span>"); builder2.Append(EasyOne.Contents.Nodes.ShowNodesAndRootNavigation(info4.NodeId)); builder2.Append("<br /></span>"); } } if (builder2.Length <= 0) { builder2.Append("<span>无其它节点<br /></span>"); } literal.BeginTag = "<div style=\"margin: 0; padding: 0; float: left;\">" + builder2.ToString() + "</div>"; panel.Controls.Add(child); return; } case FieldType.MultipleHtmlTextType: literal.BeginTag = status; return; default: literal.Text = status; return; } if (builder.Length <= 0) { builder.Append("<span id='SpecialSpanId0'>无专题<br /></span>"); } literal.BeginTag = "<div style=\"margin: 0; padding: 0; float: left;\">" + builder.ToString() + "</div>"; panel.Controls.Add(literal2); } }