Catalog.aspx
上传用户:cha0314
上传日期:2014-03-02
资源大小:12522k
文件大小:9k
源码类别:

C#编程

开发平台:

C#

  1. <%@ Page language="c#" Codebehind="Catalog.aspx.cs" AutoEventWireup="false" Inherits="UDS.SubModule.BBS.Catalog" %>
  2. <%@ Import namespace="System"%>
  3. <%@ Import namespace="System.Data"  %>
  4. <%@ Import namespace="System.Data.SqlClient"  %>
  5. <%@ Import namespace="UDS.Components"  %>
  6. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
  7. <HTML>
  8. <HEAD>
  9. <title>BBS</title>
  10. <meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
  11. <meta content="C#" name="CODE_LANGUAGE">
  12. <meta content="JavaScript" name="vs_defaultClientScript">
  13. <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
  14. <LINK href="../../../Css/BasicLayout.css" type="text/css" rel="stylesheet">
  15. <script language="C#" runat="server">
  16. private string GetImageAlt(string str)
  17. {
  18. if(Int32.Parse(str)>0 )
  19. return("有贴子"); 
  20. else
  21. return("没有贴子");
  22. }
  23. private string GetImagePath(string str)
  24. {
  25. if(Int32.Parse(str)>0 )
  26. return("../../../images/forum_isnews.gif");
  27. else
  28. return("../../../images/forum_nonews.gif");
  29. }
  30. private string GetTitle(string str)
  31. {
  32. int limitwordnumber = 50;
  33. if(str.Length>limitwordnumber)
  34. return(str.Substring(0,limitwordnumber-1));
  35. else
  36. return(str);
  37. }
  38. private bool AdminBoard(int board,string username)
  39. {
  40. BBSClass bbs = new BBSClass();
  41. return(bbs.IsBoardMaster(board,username));
  42. }
  43. private string GetBoardMasterRealName(int userid)
  44. {
  45. string result = "";
  46. UDS.Components.Staff staff = new UDS.Components.Staff();
  47. SqlDataReader dr = staff.GetStaffInfo(userid);
  48. while(dr.Read())
  49. {
  50. result = dr["RealName"].ToString();
  51. }
  52. return(result);
  53. }
  54. </script>
  55. </HEAD>
  56. <body topmargin=0 leftmargin=0>
  57. <form id="Catalog" method="post" runat="server"><p><br>
  58. <table width="100%" border="0" cellpadding="0" cellspacing="0">
  59. <tr>
  60. <td background="../../../Images/bbsback.jpg"><img src="../../../Images/bbs.jpg"></td><td background="../../../Images/bbsback.jpg"><br><font color=white>|</font> <a  style="color: #ffffff;" href='<%="search/index.aspx?classid="+classid%>'>搜索</a> <font color=white>|</font></td>
  61. </tr>
  62. </table><br>
  63. <table class="GbText" id="AutoNumber1" style="BORDER-COLLAPSE: collapse" borderColor="#93BEE2" height="80" cellSpacing="0" cellPadding="0" width="98%" border="1" align=center>
  64. <tr>
  65. <td class="GbText" style="WIDTH: 259px" align="middle" bgcolor="#e8f4ff" colSpan="2" height="24"><b><font color="#337FB2">论坛</font></b></td>
  66. <td class="GbText" align="middle" bgcolor="#e8f4ff" height="24"><font color="#337FB2"><b>帖子</b></font></td>
  67. <td class="GbText" style="WIDTH: 64px" align="middle" width="64" bgcolor="#e8f4ff" height="24"><font color="#337FB2"><b>回复</b></font></td>
  68. <td class="GbText" align="middle" bgcolor="#e8f4ff" height="24"><font color="#337FB2"><b>最新帖子</b></font></td>
  69. <td class="GbText" align="middle" bgcolor="#e8f4ff" height="24"><font color="#337FB2"><b>版主</b></font></td>
  70. </tr>
  71. <tr>
  72. <td class="GbText" align="left" width="924" colSpan="6" height="22"><A id="A1" runat=server >添加分类</A></td>
  73. </tr>
  74. <asp:repeater id="rpt_catalog" Runat="server">
  75. <ItemTemplate>
  76. <tr>
  77. <td align="middle" width="924" bgColor="#e8f4ff" colSpan="6" height="22"><FONT face="宋体">
  78. <asp:label id="LCatalog" runat="server" Width="100%" text='<%# DataBinder.Eval(Container.DataItem,"catalog_name") %>'>
  79. </asp:label>
  80. </FONT>
  81. </td>
  82. </tr>
  83. <tr>
  84. <td align="left" width="924" bgColor="white" colSpan="6" height="22"><FONT face="宋体">
  85. <asp:label id="LCatalog_Description" runat="server" Width="100%"  text='<%# DataBinder.Eval(Container.DataItem,"catalog_description") %>'>
  86. </asp:label>
  87. </FONT>
  88. </td>
  89. </tr>
  90. <tr>
  91. <td align="right" width="924" bgColor="#e8f4ff" colSpan="6" height="22"><asp:Panel ID="adminop" Runat=server Visible='<%# Admin%>'><A  href="ManageBoard.aspx?Action=AddBoard&CatalogID=<%# DataBinder.Eval(Container.DataItem,"catalog_id")%>&classID=<%=classid%>">添加板块</A>|<asp:LinkButton ID="btndelcatalog" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"catalog_id")%>' OnClick="btndelcatalog_Click" Runat=server>删除分类</asp:LinkButton>|<A  href="ManageCatalog.aspx?Action=ModifyCatalog&CatalogID=<%# DataBinder.Eval(Container.DataItem,"catalog_id")%>&classID=<%=classid%>">
  92. 编辑分类</A>|</asp:Panel></td>
  93. </tr>
  94. <asp:Repeater ID="rpt_board" OnItemDataBound="rpt_board_ItemDataBound" DataSource='<%# ((DataRowView)Container.DataItem).Row.GetChildRows("catolog_board") %>' Runat="server">
  95. <ItemTemplate>
  96. <tr>
  97. <td align="middle" width="60">&nbsp; <img  runat="server" alt='<%# GetImageAlt(DataBinder.Eval(Container.DataItem,"["formitems"]").ToString())%>' src='<%# GetImagePath(DataBinder.Eval(Container.DataItem,"["formitems"]").ToString())%>' />
  98. <td width="182" height="45" style="WIDTH: 182px"><FONT face="宋体"><P><a href="ListView.aspx?BoardID=<%# DataBinder.Eval(Container.DataItem,"["board_id"]")%>&ClassID=<%# Request["ClassID"]%>"><%# DataBinder.Eval(Container.DataItem,"["board_name"]")%></a></P>
  99. <P>
  100. <asp:Label id="LBoardDescription" runat="server">
  101. <%# DataBinder.Eval(Container.DataItem,"["board_description"]")%>
  102. </asp:Label></P>
  103. </FONT>
  104. </td>
  105. <td align="middle" width="55" height="45"><FONT face="宋体">
  106. <asp:label id="LForumTimes" runat="server">
  107. <%# DataBinder.Eval(Container.DataItem,"["formitems"]")%>
  108. </asp:label></FONT></td>
  109. <td align="middle" width="50" height="45">
  110. <asp:label id="LReplays" runat="server">
  111. <%# DataBinder.Eval(Container.DataItem,"["replays"]")%>
  112. </asp:label></td>
  113. <td vAlign="top" align="right" width="304" height="45"><FONT face="宋体"> <a href='<%# "Display.aspx?ItemID="+DataBinder.Eval(Container.DataItem,"["item_id"]").ToString()%>' target=_blank>
  114. <asp:label id="LForumItem" runat="server">
  115. <%# GetTitle(DataBinder.Eval(Container.DataItem,"["title"]").ToString())%>
  116. </asp:label></a>
  117. <br>
  118. <asp:Label id="LSender" runat="server">
  119. <%# DataBinder.Eval(Container.DataItem,"["sender"]")%>
  120. </asp:Label>
  121. <br>
  122. <asp:Label id="LSendTime" runat="server">
  123. <%# DataBinder.Eval(Container.DataItem,"["send_time"]")%>
  124. </asp:Label>
  125. </FONT>
  126. </td>
  127. <td align="middle" width="103" height="45">
  128. <asp:Repeater id="rpt_boardmaster" DataSource='<%# ((DataRow)Container.DataItem).GetChildRows("board_boardmaster")%>' Runat="server">
  129. <ItemTemplate>
  130. <a href="../Mail/Compose.aspx?Action=3&ClassID=0&Username=<%# DataBinder.Eval(Container.DataItem,"["staff_Name"]")%>&Name=<%# GetBoardMasterRealName(Int32.Parse(DataBinder.Eval(Container.DataItem,"["staff_id"]").ToString()))%>"><%# DataBinder.Eval(Container.DataItem,"["RealName"]")%></a><br>
  131. </ItemTemplate>
  132. </asp:Repeater>
  133. </td>
  134. </tr>
  135. <tr>
  136. <td width="924" colSpan="6" height="22"><asp:Panel ID="Adminop1" Runat=server Visible='<%# AdminBoard(Int32.Parse(DataBinder.Eval(Container.DataItem,"["board_id"]").ToString()),Username) || Admin %>'><A href="ManageBoardMaster.aspx?BoardID=<%# DataBinder.Eval(Container.DataItem,"["board_id"]")%>&classID=<%=classid%>" >设定斑竹</A>|<asp:LinkButton ID="lbtnDelBoard" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"["board_id"]")%>' OnClick="DeleteBoard"  Runat=server>删除板块</asp:LinkButton>|<A href="ManageBoard.aspx?Action=ModifyBoard&BoardID=<%# DataBinder.Eval(Container.DataItem,"["board_id"]")%>&classID=<%=classid%>">
  137. 编辑板块</A>|<asp:HyperLink id="SetBoardMember" NavigateUrl='<%# "ManageBoardMember.aspx?BoardID="+DataBinder.Eval(Container.DataItem,"["board_id"]")+"&classid="+classid%>' Visible='<%# !Convert.ToBoolean(DataBinder.Eval(Container.DataItem,"["board_type"]"))%>' runat=server>编辑成员</asp:HyperLink></asp:Panel></td>
  138. </tr>
  139. </ItemTemplate>
  140. </asp:Repeater>
  141. </ItemTemplate>
  142. </asp:repeater></table>
  143. <table id="AutoNumber2" style="BORDER-COLLAPSE: collapse" borderColor="#cccccc" height="17" cellSpacing="0" cellPadding="0" width="100%" border="0">
  144. <tr>
  145. <td align="middle" width="100%" height="30"> </td>
  146. </tr>
  147. </table>
  148. </form>
  149. </body>
  150. </HTML>