PageRenderTime 4242ms CodeModel.GetById 25ms RepoModel.GetById 7ms app.codeStats 0ms

/www.emoney.cn/WebSite/topic/topic_d.aspx.cs

#
C# | 303 lines | 276 code | 21 blank | 6 comment | 30 complexity | 6767647a8c934d05553ca4cc40853cec MD5 | raw file
Possible License(s): LGPL-3.0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using System.Net;
  8. using System.Text;
  9. public partial class topic_topic_d : Basic
  10. {
  11. protected void Page_Load(object sender, EventArgs e)
  12. {
  13. }
  14. private Topics2 tt;
  15. public Topics2 TT
  16. {
  17. get
  18. {
  19. if (tt != null)
  20. {
  21. return tt;
  22. }
  23. string str = Pub.LoadData(jsonUrl + "/topic/Topic.ashx?id=" + Request["id"]);
  24. tt = Newtonsoft.Json.JsonConvert.DeserializeObject<Topics2>(str);
  25. return tt;
  26. }
  27. }
  28. /// <summary>
  29. /// 第一排内容
  30. /// </summary>
  31. public string C1
  32. {
  33. get
  34. {
  35. System.Text.StringBuilder s = new System.Text.StringBuilder();
  36. for (int i = 0; i < TT.H1.Count; i++)
  37. {
  38. var c = TT.H1[i];
  39. s.AppendLine("<li>");
  40. s.AppendLine(" <div class=\"rdzt_img\"><a href=\"" + GetNewsUrl("05", "0", c.Id) + "\" class=\"b\"><img style=\"border:0px\" width=\"79\" height=\"71\" src=\"images" + c.ImgUrl + "\" alt=\"标题图片\" /></a></div>");
  41. s.AppendLine(" <div class=\"rdzt_intro\"><span class=\"h3\"><a href=\"" + GetNewsUrl("05","0",c.Id) + "\" class=\"b\">" + c.Title + "</a></span><br />");
  42. s.AppendLine(c.Summary + "<a href=\"" + GetNewsUrl("05","0" , c.Id) + "\" class=\"b\">[详情]</a></div>");
  43. s.AppendLine("</li>");
  44. }
  45. return s.ToString();
  46. }
  47. }
  48. public string C21
  49. {
  50. get
  51. {
  52. System.Text.StringBuilder s = new System.Text.StringBuilder();
  53. for (int i = 0; i < TT.H21.Count; i++)
  54. {
  55. var c = TT.H21[i];
  56. s.AppendLine("<li>");
  57. s.AppendLine(" <div class=\"rdzt_img\"><a href=\"" + GetNewsUrl("05", "0", c.Id) + "\" class=\"b\"><img style=\"border:0px\" width=\"79\" height=\"71\" src=\"images" + c.ImgUrl + "\" alt=\"标题图片\" /></a></div>");
  58. s.AppendLine(" <div class=\"rdzt_intro1\"><span class=\"h3\"><a href=\"" + GetNewsUrl("05","0", c.Id) + "\" class=\"b\">" + c.Title + "</a></span><br />");
  59. s.AppendLine(c.Summary+ "<a href=\""+GetNewsUrl("05","0", c.Id)+"\" class=\"b\">[详情]</a></div>");
  60. s.AppendLine("</li>");
  61. s.AppendLine("<div class=\"clearok\"></div>");
  62. s.AppendLine("<li class=\"line\"></li>");
  63. }
  64. return s.ToString();
  65. }
  66. }
  67. public string C22
  68. {
  69. get
  70. {
  71. StringBuilder s = new StringBuilder();
  72. for (int i = 0; i < TT.H22.Count; i++)
  73. {
  74. s.AppendLine("<li>·<a href=\"" +GetNewsUrl("05","0", tt.H22[i].Id)+"\">" + tt.H22[i].Title + "</a></li>");
  75. }
  76. return s.ToString();
  77. }
  78. }
  79. public string C23
  80. {
  81. get
  82. {
  83. StringBuilder s = new StringBuilder();
  84. for (int i = 0; i < TT.H23.Count; i++)
  85. {
  86. s.AppendLine("<li> <span class=\"font-weight\"><a href=\"" + GetNewsUrl("05","0", TT.H23[i].Id) + "\" class=\"b\">" + tt.H23[i].Title + "</a></span><br />");
  87. s.AppendLine(tt.H23[i].Summary + "<a href=\""+ GetNewsUrl("05","0", TT.H23[i].Id) + "\" class=\"b\">[详情]</a> </li>");
  88. s.AppendLine(" <div class=\"clearok\"></div>");
  89. s.AppendLine("<li class=\"line\"></li>");
  90. }
  91. return s.ToString();
  92. }
  93. }
  94. public string C31
  95. {
  96. get
  97. {
  98. StringBuilder s = new StringBuilder();
  99. for (int i = 0; i < TT.H31.Count; i++)
  100. {
  101. s.AppendLine("<li>");
  102. s.AppendLine(" <div class=\"rdzt_img\"><a href=\"" + GetNewsUrl("05", "0", TT.H31[i].Id) + "\" class=\"b\"><img style=\"border:0px\" width=\"79\" height=\"71\" src=\"images" + TT.H31[i].ImgUrl + "\" alt=\"标题图片\" /></a></div>");
  103. s.AppendLine(" <div class=\"rdzt_intro1\"><span class=\"h3\"><a href=\"" + GetNewsUrl("05", "0", TT.H31[i].Id) + "\" class=\"b\">" + tt.H31[i].Title + "</a></span><br />");
  104. s.AppendLine(tt.H31[i].Summary + "<a href=\"" + GetNewsUrl("05", "0", TT.H31[i].Id) + "\" class=\"b\">[详情]</a></div>");
  105. s.AppendLine("</li>");
  106. s.AppendLine("<div class=\"clearok\"></div>");
  107. s.AppendLine("<li class=\"line\"></li>");
  108. }
  109. return s.ToString();
  110. }
  111. }
  112. public string C32
  113. {
  114. get
  115. {
  116. StringBuilder s = new StringBuilder();
  117. for (int i = 0; i < TT.H32.Count; i++)
  118. {
  119. s.AppendLine("<li> <span class=\"h3\">"+TT.H32[i].Title+"</span><br />");
  120. s.AppendLine(TT.H32[i].Summary+ "</li>");
  121. s.AppendLine(" <div class=\"clearok\"></div>");
  122. s.AppendLine(" <li class=\"line\"></li>");
  123. }
  124. return s.ToString();
  125. }
  126. }
  127. public string C41
  128. {
  129. get
  130. {
  131. StringBuilder s = new StringBuilder();
  132. for (int i = 0; i < TT.H4.Count; i++)
  133. {
  134. string summary = TT.H4[i].Summary;
  135. if (summary.Length > 64)
  136. {
  137. summary = summary.Substring(0, 64) + "…";
  138. }
  139. string cl = "h3";
  140. if (i % 3 == 2)
  141. {
  142. cl = "right";
  143. }
  144. s.AppendLine("<li class=\"right\"><span class=\"h3\"><a href=\"" + GetNewsUrl("05", "0", TT.H4[i].Id) + "\" class=\"b\">" + TT.H4[i].Title + "</a></span><br />");
  145. s.AppendLine("<div class=\"rdzt_img\"><a href=\"" + GetNewsUrl("05", "0", TT.H4[i].Id) + "\" class=\"b\"><img style=\"border:0px\" width=\"79\" height=\"71\" src=\"images" + TT.H4[i].ImgUrl + "\" alt=\"标题图片\" /></a></div>");
  146. s.AppendLine("<div class=\"rdzt_intro2\">"+summary+"</div>");
  147. s.AppendLine("</li>");
  148. }
  149. return s.ToString();
  150. }
  151. }
  152. public string C71
  153. {
  154. get
  155. {
  156. StringBuilder s = new StringBuilder();
  157. for (int i = 0; i < TT.H71.Count; i++)
  158. {
  159. s.AppendLine("<li>·<a href=\"" + GetNewsUrl( "05","0", TT.H71[i].Id) + "\">" + TT.H71[i].Title + "</a></li>");
  160. }
  161. return s.ToString();
  162. }
  163. }
  164. public string C72
  165. {
  166. get
  167. {
  168. StringBuilder s = new StringBuilder();
  169. for (int i = 0; i < TT.H72.Count; i++)
  170. {
  171. s.AppendLine(" <li>·<a href=\"" +GetNewsUrl("05","0", TT.H72[i].Id) + "\">" + TT.H72[i].Title + "</a></li>");
  172. }
  173. return s.ToString();
  174. }
  175. }
  176. /// <summary>
  177. /// 大图
  178. /// </summary>
  179. public string C5_Big
  180. {
  181. get
  182. {
  183. StringBuilder s = new StringBuilder();
  184. if (TT.H5.Where(x => x.IsBigImg == true).Count() == 0)
  185. {
  186. return string.Empty;
  187. }
  188. s.AppendLine("<div class=\"banner_li\">");
  189. for (int i = 0; i < TT.H5.Count; i++)
  190. {
  191. if (TT.H5[i].IsBigImg == true)
  192. {
  193. s.AppendLine("<img style=\"border:0px\" width=\"958\" heigth=\"176\" src=\"images" + TT.H5[i].Path + "\" />");
  194. }
  195. }
  196. s.AppendLine("</div>");
  197. return s.ToString();
  198. }
  199. }
  200. public string C5_Small
  201. {
  202. get
  203. {
  204. StringBuilder s = new StringBuilder();
  205. for (int i = 0; i < TT.H5.Count; i++)
  206. {
  207. if (TT.H5[i].IsBigImg != true)
  208. {
  209. s.AppendLine("<li class=\"right\"><img style=\"border:0px\" src=\"images/ico_arrow3.jpg\" />&nbsp;<span class=\"font14 font-weight\">" + TT.H5[i].Title + "</span><br />");
  210. s.AppendLine("<img style=\"border:0px\" width=\"413\" heigth=\"216\" src=\"images" + TT.H5[i].Path + "\" alt=\"图表\" /></li>");
  211. }
  212. }
  213. return s.ToString();
  214. }
  215. }
  216. public string FirstTitle
  217. {
  218. get
  219. {
  220. if (TT.FirstNews == null)
  221. {
  222. return string.Empty;
  223. }
  224. else
  225. {
  226. return TT.FirstNews.Title;
  227. }
  228. }
  229. }
  230. public string FirstSummary
  231. {
  232. get
  233. {
  234. if (TT.FirstNews == null)
  235. {
  236. return string.Empty;
  237. }
  238. else
  239. {
  240. return TT.FirstNews.Summary;
  241. }
  242. }
  243. }
  244. public string FirstUrl
  245. {
  246. get
  247. {
  248. if (TT.FirstNews == null)
  249. {
  250. return string.Empty;
  251. }
  252. else
  253. {
  254. return GetNewsUrl("05","0", TT.FirstNews.Id);
  255. }
  256. }
  257. }
  258. public string Str_Vote
  259. {
  260. get
  261. {
  262. StringBuilder s = new StringBuilder();
  263. string str = Pub.LoadData(jsonUrl + "topic/TopicVoteList.ashx?typeid=" + TT.VoteTypeId);
  264. var c = Newtonsoft.Json.JsonConvert.DeserializeObject<Topic2Vote>(str);
  265. s.AppendLine("<div class=\"rdzt_title\"><img style=\"border:0px\" src=\"images/ico_arrow2.jpg\" hspace=\"10\" />" + c.Title + "</div>");
  266. s.AppendLine("<div class=\"clearok\"></div>");
  267. s.AppendLine(" <div class=\"invest_c\">");
  268. s.AppendLine(" <ul>");
  269. s.AppendLine(" <li>" + c.Question + "</li>");
  270. for (int i = 0; i < c.lst.Count; i++)
  271. {
  272. s.AppendLine(" <li>");
  273. s.AppendLine(" <input type=\"radio\" name=\"radio\" id=\"radio\" value=\""+c.lst[i].id+"\" />");
  274. s.AppendLine(c.lst[i].Title+ " </li>");
  275. }
  276. s.AppendLine("<li class=\"marginTop5\"><img style=\"border:0px\" src=\"images/btn_vote.jpg\" id='imgVote' />&nbsp;<img style=\"border:0px\" src=\"images/btn_check.jpg\" id=\"btnRedirectToupiao\" tid=\"" + TT.VoteTypeId + "\" /></li>");
  277. s.AppendLine(" </ul>");
  278. s.AppendLine(" </div>");
  279. return s.ToString();
  280. }
  281. }
  282. }