Asp.net源码专业站
首页->尚未分类->勤网爱问v2008学习版项目源码>>Rungoo.Builder/Article.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:勤网爱问v2008学习版项目源码
当前文件:文件类型 GoAsk/Rungoo.Builder/Article.cs[9K,2009-6-12 11:43:17]打开代码结构图
普通视图
		            
1namespace Rungoo.Builder 2{ 3 using Rungoo.BusFacade; 4 using Rungoo.Entity; 5 using System; 6 using System.Data; 7 using System.Text; 8 using System.Web; 9 10 public class Article : baselink 11 { 12 public string bindSubTopic(DataRow r) 13 { 14 StringBuilder builder = new StringBuilder(); 15 builder.Append("<div class=\"tit_1\"> " + r["SubTopicTitle"] + "</div>\r\n"); 16 builder.Append("<div class=\"sub_1\">" + r["SubTopicSummary"] + "</div>"); 17 builder.Append("<div class=\"box_1\" style='overflow:visible;'>"); 18 builder.Append("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"); 19 builder.Append("<tr>\r\n"); 20 builder.Append("<td rowspan=\"2\" valign=\"top\" class=\"pad_1\"><img src=\"" + r["SubTopicImg"] + "\" width=\"125\" height=\"125\"/></td>\r\n"); 21 builder.Append("<td valign=\"top\" class=\"pad_1 f14\">"); 22 foreach (DataRow row in IAsk_SubTopicItemFac.GetList("", r["SubTopicID"].ToString()).Rows) 23 { 24 builder.Append(string.Concat(new object[] { "<a href=\"", row["SubTopicAskLink"], "\" target=\"_blank\">", row["SubTopicAskTitle"], "</a><br/>" })); 25 } 26 builder.Append("</td>\r\n"); 27 builder.Append("</tr>\r\n"); 28 builder.Append("<tr>\r\n"); 29 builder.Append("<td height=\"30\" valign=\"bottom\" class=\"pad_1 f14\"><strong>相关知识:</strong>\r\n"); 30 foreach (string str in r["SubTopicKeyWord"].ToString().Split(new char[] { ',' })) 31 { 32 if (str.Trim() != "") 33 { 34 builder.Append("<a href=\"/" + base.setuppath + "iasksearch.aspx?word=" + HttpUtility.UrlEncode(str) + "\" target=\"_blank\">" + str + "</a>&nbsp;\r\n"); 35 } 36 } 37 builder.Append("</td></tr></table></div>"); 38 return builder.ToString(); 39 } 40 41 public string bindSubTopic(string topicid) 42 { 43 IAsk_SubTopic entity = IAsk_SubTopicFac.GetEntity(topicid); 44 StringBuilder builder = new StringBuilder(); 45 builder.Append("<div class=\"tit_1\"> " + entity.SubTopicTitle + "</div>\r\n"); 46 builder.Append("<div class=\"sub_1\">" + entity.SubTopicSummary + "</div>"); 47 builder.Append("<div class=\"box_1\">"); 48 builder.Append("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"); 49 builder.Append("<tr>\r\n"); 50 builder.Append("<td rowspan=\"2\" valign=\"top\" class=\"pad_1\"><img src=\"img/3.jpg\" width=\"125\" height=\"125\"/></td>\r\n"); 51 builder.Append("<td valign=\"top\" class=\"pad_1 f14\">"); 52 foreach (DataRow row in IAsk_SubTopicItemFac.GetList("", topicid).Rows) 53 { 54 builder.Append(string.Concat(new object[] { "<a href=\"", row["SubTopicAskLink"], "\" target=\"_blank\">", row["SubTopicAskTitle"], "</a><br/>" })); 55 } 56 builder.Append("</td>\r\n"); 57 builder.Append("</tr>\r\n"); 58 builder.Append("<tr>\r\n"); 59 builder.Append("<td height=\"30\" valign=\"bottom\" class=\"pad_1 f14\"><strong>相关知识:</strong>\r\n"); 60 foreach (string str in entity.SubTopicKeyWord.Split(new char[] { ',' })) 61 { 62 if (str.Trim() != "") 63 { 64 builder.Append("<a href=\"/" + base.setuppath + "iasksearch.aspx?word=" + HttpUtility.UrlEncode(str) + "\" target=\"_blank\">" + str + "</a>&nbsp;\r\n"); 65 } 66 } 67 builder.Append("</td></tr></table></div>"); 68 return builder.ToString(); 69 } 70 71 public string getArtcleList(int num, int titlelength, bool haspic, string catid, int style) 72 { 73 int recordcount = 0; 74 DataTable table = Article_MstFac.GetList(num, 1, catid, "", "0", out recordcount); 75 if (table.Rows.Count <= 0) 76 { 77 return "no data"; 78 } 79 StringBuilder builder = new StringBuilder(); 80 builder.Append("<ul class='artlist_ul'>\n"); 81 foreach (DataRow row in table.Rows) 82 { 83 builder.Append("<li class='artlist_li'>"); 84 builder.Append("<span class='artlist_title'>" + base.getArticleLink(int.Parse(row["ArtID"].ToString()), row["Title"].ToString(), titlelength, "") + "</span>"); 85 builder.Append("</li>"); 86 } 87 builder.Append("</ul>\n"); 88 return builder.ToString(); 89 } 90 91 public string getFullTopic(string topicid) 92 { 93 return ""; 94 } 95 96 public string getFullTopicList(int num, int titlelength, int style) 97 { 98 int recordcount = 0; 99 DataTable table = IAsk_TopicFac.GetList(num, 1, "", out recordcount); 100 if (table.Rows.Count <= 0) 101 { 102 return "no data"; 103 } 104 StringBuilder builder = new StringBuilder(); 105 if (style == 1) 106 { 107 builder.Append("<div class='artlist_ul'>\n"); 108 foreach (DataRow row in table.Rows) 109 { 110 if ((row["TopicPic"] != null) && (row["TopicPic"].ToString().Trim() != "")) 111 { 112 builder.Append("<div class='artlist_img'>" + base.getTopicLinkpic(row["TopicID"].ToString(), row["TopicTitle"].ToString(), row["TopicPic"].ToString()) + "</div>"); 113 } 114 builder.Append("<div class='artlist_title'>" + base.getTopicLink(row["TopicID"].ToString(), row["TopicTitle"].ToString(), titlelength) + "</div>"); 115 builder.Append("<div class='artlist_sumery'>" + row["TopicSummary"].ToString() + "</div>"); 116 builder.Append("<div class='artlist_go'>" + base.getTopicLink(row["TopicID"].ToString(), "<b>进入本期主题</b>", 30) + "</div>"); 117 } 118 builder.Append("</div>\n"); 119 } 120 else 121 { 122 builder.Append("<ul class='artlist_ul'>\n"); 123 foreach (DataRow row in table.Rows) 124 { 125 builder.Append("<li class='artlist_li'>"); 126 builder.Append("<span class='artlist_title'>" + base.getTopicLink(row["TopicID"].ToString(), row["TopicTitle"].ToString(), titlelength) + "</span>"); 127 builder.Append("</li>"); 128 } 129 builder.Append("</ul>\n"); 130 } 131 return builder.ToString(); 132 } 133 134 public string getTopicList(int num, int titlelength, bool haspic, string catid, int style) 135 { 136 int recordcount = 0; 137 DataTable table = Article_MstFac.GetList(num, 1, catid, "", "0", out recordcount); 138 if (table.Rows.Count <= 0) 139 { 140 return "no data"; 141 } 142 StringBuilder builder = new StringBuilder(); 143 if (style == 1) 144 { 145 builder.Append("<div class='artlist_ul'>\n"); 146 foreach (DataRow row in table.Rows) 147 { 148 if ((row["ArtTitleImg"] != null) && (row["ArtTitleImg"].ToString().Trim() != "")) 149 { 150 builder.Append("<div class='artlist_img'>" + base.getArticleLinkpic(int.Parse(row["ArtID"].ToString()), row["Title"].ToString(), row["ArtTitleImg"].ToString(), "topic.aspx") + "</div>"); 151 } 152 builder.Append("<div class='artlist_title'>" + base.getArticleLink(int.Parse(row["ArtID"].ToString()), row["Title"].ToString(), titlelength, "topic.aspx") + "</div>"); 153 builder.Append("<div class='artlist_sumery'>" + row["ArtSummery"].ToString() + "</div>"); 154 builder.Append("<div class='artlist_go'>" + base.getArticleLink(int.Parse(row["ArtID"].ToString()), "<b>进入本期主题</b>", 30, "topic.aspx") + "</div>"); 155 } 156 builder.Append("</div>\n"); 157 } 158 else 159 { 160 builder.Append("<ul class='artlist_ul'>\n"); 161 foreach (DataRow row in table.Rows) 162 { 163 builder.Append("<li class='artlist_li'>"); 164 builder.Append("<span class='artlist_title'>" + base.getArticleLink(int.Parse(row["ArtID"].ToString()), row["Title"].ToString(), titlelength, "topic.aspx") + "</span>"); 165 builder.Append("</li>"); 166 } 167 builder.Append("</ul>\n"); 168 } 169 return builder.ToString(); 170 } 171 172 public string getTopicManager(IAsk_Topic topic) 173 { 174 StringBuilder builder = new StringBuilder(); 175 builder.Append(" <div class=\"box_2 flh22\" style='overflow:visible;'>"); 176 builder.Append("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"); 177 builder.Append("<tr><td width=\"81\"><img src=\"" + topic.TopicManagerPic + "\" width=\"71\"></td>"); 178 builder.Append("<td valign=\"top\"><a href=\"/" + base.setuppath + "userinfo.aspx?u=" + HttpUtility.UrlEncode(topic.TopicManager) + " \" target=\"_blank\">" + topic.TopicManager + "</a><br/>"); 179 builder.Append("</td>"); 180 builder.Append("</tr></table>"); 181 builder.Append("<br/>" + topic.TopicManagerIntro + "</div>"); 182 return builder.ToString(); 183 } 184 } 185} 186 187
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:勤网爱问v2008学习版项目源码
51Aspx.com 版权所有 CopyRight © 2006-2010. 京ICP备06046876号 本站法律顾问:ITlaw-庄毅雄律师
返回顶部
客户服务:点击这里进行客户咨询 业务合作:点击这里洽谈业务合作 合作热线:010-68880146