global_advsgrid.aspx
上传用户:wenllgg125
上传日期:2020-04-09
资源大小:7277k
文件大小:4k
源码类别:

SCSI/ASPI

开发平台:

Others

  1. <%@ Page Language="c#" Inherits="Discuz.Web.Admin.advsgrid" Codebehind="global_advsgrid.aspx.cs"%>
  2. <%@ Register TagPrefix="cc1" Namespace="Discuz.Control" Assembly="Discuz.Control" %>
  3. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
  4. <html>
  5. <head>
  6. <title>广告列表</title>
  7. <link href="../styles/datagrid.css" type="text/css" rel="stylesheet" />
  8. <link href="../styles/dntmanager.css" type="text/css" rel="stylesheet" />
  9. <script type="text/javascript" src="../js/common.js"></script>
  10. <script type="text/javascript">
  11. function Check(form)
  12. {
  13. CheckAll(form);
  14. checkedEnabledButton(form,'advid','DelAds','SetAvailable','SetUnAvailable')
  15. }
  16. </script>
  17. <meta http-equiv="X-UA-Compatible" content="IE=7" />
  18. </head>
  19. <body>
  20. <form id="Form1" method="post" runat="server">
  21. <cc1:DataGrid ID="DataGrid1" runat="server" OnPageIndexChanged="DataGrid_PageIndexChanged" OnSortCommand="Sort_Grid">
  22. <Columns>
  23. <asp:TemplateColumn HeaderText="<input title='选中/取消' onclick='Check(this.form)' type='checkbox' name='chkall' id='chkall' />">
  24. <HeaderStyle Width="20px" />
  25. <ItemTemplate>
  26. <input id="advid" onclick="checkedEnabledButton(this.form,'advid','DelAds','SetAvailable','SetUnAvailable')" type="checkbox" value="<%# DataBinder.Eval(Container, "DataItem.advid").ToString() %>" name="advid" /> </asp:Label>
  27. </ItemTemplate>
  28. </asp:TemplateColumn>
  29. <asp:TemplateColumn HeaderText="">
  30. <ItemTemplate>
  31. <a href="global_editadvs.aspx?advid=<%# DataBinder.Eval(Container, "DataItem.advid").ToString()%>">编辑</a>
  32. </ItemTemplate>
  33. </asp:TemplateColumn>
  34. <asp:BoundColumn DataField="advid" SortExpression="advid" HeaderText="广告id [递增]"
  35. Visible="false"></asp:BoundColumn>
  36. <asp:TemplateColumn HeaderText="是否有效" SortExpression="available">
  37. <ItemTemplate>
  38. <%# BoolStr(DataBinder.Eval(Container, "DataItem.available").ToString())%>
  39. </ItemTemplate>
  40. </asp:TemplateColumn>
  41. <asp:BoundColumn DataField="title" SortExpression="title" HeaderText="广告标题"></asp:BoundColumn>
  42. <asp:BoundColumn DataField="displayorder" SortExpression="displayorder" HeaderText="显示顺序">
  43. </asp:BoundColumn>
  44. <asp:TemplateColumn HeaderText="广告类型" SortExpression="type">
  45. <ItemTemplate>
  46. <%# GetAdType(DataBinder.Eval(Container, "DataItem.type").ToString())%>
  47. </ItemTemplate>
  48. </asp:TemplateColumn>
  49. <asp:TemplateColumn HeaderText="广告投放范围" SortExpression="targets">
  50. <ItemTemplate>
  51. <%# TargetsType(DataBinder.Eval(Container, "DataItem.targets").ToString())%>
  52. </ItemTemplate>
  53. </asp:TemplateColumn>
  54. <asp:TemplateColumn HeaderText="样式" SortExpression="parameters">
  55. <ItemTemplate>
  56. <%# ParameterType(DataBinder.Eval(Container, "DataItem.parameters").ToString())%>
  57. </ItemTemplate>
  58. </asp:TemplateColumn>
  59. <asp:TemplateColumn HeaderText="生效时间" SortExpression="starttime">
  60. <ItemTemplate>
  61. <%# DataBinder.Eval(Container, "DataItem.starttime").ToString()== "1900-1-1 0:00:00" ? "" : Convert.ToDateTime(DataBinder.Eval(Container, "DataItem.starttime").ToString()).ToShortDateString()%>
  62. </ItemTemplate>
  63. </asp:TemplateColumn>
  64. <asp:TemplateColumn HeaderText="结束时间" SortExpression="endtime">
  65. <ItemTemplate>
  66. <%# DataBinder.Eval(Container, "DataItem.endtime").ToString()== "2555-1-1 0:00:00" ? "" : Convert.ToDateTime(DataBinder.Eval(Container, "DataItem.endtime").ToString()).ToShortDateString()%>
  67. </ItemTemplate>
  68. </asp:TemplateColumn>
  69. </Columns>
  70. </cc1:DataGrid>
  71. <p style="text-align:right;">
  72. <cc1:Button ID="DelAds" runat="server" Text="删 除" ButtonImgUrl="../images/del.gif" Enabled="false" OnClientClick="if(!confirm('你确认要删除所选的广告吗?')) return false;"></cc1:Button>&nbsp;&nbsp;
  73. <cc1:Button ID="SetAvailable" runat="server" Text="置为有效" Enabled="false"></cc1:Button>&nbsp;&nbsp;
  74. <cc1:Button ID="SetUnAvailable" runat="server" Text="置为无效" ButtonImgUrl="../images/invalidation.gif" Enabled="false"></cc1:Button>&nbsp;&nbsp;
  75. <button type="button" class="ManagerButton" onclick="javascript:window.location.href='global_addadvs.aspx';">
  76. <img src="../images/add.gif" />添加广告
  77. </button>
  78. </p>
  79. </form>
  80. <%=footer%>
  81. </body>
  82. </html>