123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using CB.Entity;
- using CB.Data;
- using CB.Common;
- namespace CB.TVUCenter.Web
- {
- public partial class info : System.Web.UI.Page
- {
- protected string TopicType = "", TopicAuthor = "", TopicContent = ""
- , TopicTitle = "", CreateTime = "", FullImage="";
- protected StringBuilder ListString = new StringBuilder();
- protected StringBuilder ListImage = new StringBuilder();
-
- protected void Page_Load(object sender, EventArgs e)
- {
- int id = WRequest.GetQueryInt("id");
-
- if (!IsPostBack)
- {
- TopicInfo info = TopicService.Get(id);
- string topicTypeId = WRequest.GetQueryString("cid");
- if (info == null) return;
- TopicAuthor = info.UserName;
- TopicContent = info.Context;
- TopicTitle = info.Title;
- CreateTime = info.Addtime.ToString("yyyy-MM-dd HH:mm:ss");
- GetTopicType(topicTypeId);
- BindConsult(4, topicTypeId);
- BindConsult(2);
- if (topicTypeId == "208")
- {
- FullImage = "<img src='" + info.FileURL + @"' />";
- }
- }
- }
- private void GetTopicType(string topicTypeId)
- {
-
- switch (topicTypeId)
- {
- case "205":
- TopicType = "咨询";
- break;
- case "206":
- TopicType = "公告";
- break;
- case "208":
- TopicType = "实景展示";
- break;
- }
- }
- /// <summary>
- /// 绑定中间的咨询/公告
- /// </summary>
- /// <param name="list"></param>
- /// <param name="id"></param>
- private void BindConsult(int displayCount, string topicTypeId)
- {
- int Record = 0;
- List<TopicInfo> lists = TopicService.ToPaging(topicTypeId, 10, 1, out Record, "Tid DESC").ToList();
- displayCount = (displayCount > lists.Count) ? lists.Count : displayCount;
- for (int i = 0; i < displayCount; i++)
- {
- string img = "";
- string consult = "";
- if (lists[i].ListThumbsURL != null && lists[i].ListThumbsURL.Count > 0)
- img = "<img src='" + lists[i].ListThumbsURL[0] + "' />";
- consult = @"<li><a href='info_" + lists[i].Id + "_" + lists[i].Cid + @".html'>" + img
- + "<h4 title='" + lists[i].Title + "'>" + (lists[i].Title.Length > 20 ? lists[i].Title.Substring(0, 20) : lists[i].Title) + @"</h4>
- </a></li>";
- ListString.Append(consult);
- }
- }
- /// <summary>
- /// 绑定实景展示图片列表
- /// </summary>
- /// <param name="list"></param>
- /// <param name="id"></param>
- private void BindConsult(int displayCount)
- {
- int Record = 0;
- List<TopicInfo> lists = TopicService.ToPaging("208", 10, 1, out Record, "Tid DESC").ToList();
- displayCount = (displayCount > lists.Count) ? lists.Count : displayCount;
- for (int i = 0; i < displayCount; i++)
- {
- string img = "";
- if (lists[i].ListThumbsURL != null && lists[i].ListThumbsURL.Count > 0)
- img = "<img src='" + lists[i].ListThumbsURL[0] + @"' class='ListImage'/>";
- string image = @"<div class='show_img'><a href='info_" + lists[i].Id + "_" + lists[i].Cid + @".html'>" + img + "<p>" + lists[i].Title + "</a></p></div>";
- ListImage.Append(image);
- }
- }
- }
- }
|