<%@ Page Language="C#" AutoEventWireup="true" CodeFile="pic.aspx.cs" Inherits="wormadmin_pic" validateRequest="false"%>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>图片管理</title>
    <link rel="stylesheet" href="css/content.css" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
     <table width="90%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="25"><strong>图片管理列表:<asp:TextBox ID="tsql" runat="server" Style="display: none"></asp:TextBox></strong></td>
        </tr>
      </table>
      <table width="90%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td colspan="3">
              <asp:GridView ID="myGrid" runat="server" SkinId="blueGrid"
                   DataKeyNames="id" Width="800px"  AutoGenerateColumns="False" OnRowEditing="myedit" OnRowUpdating="myupdate" OnRowCancelingEdit="mycancel" ShowFooter="True">
                 
                  <Columns>
                      <asp:BoundField DataField="id" HeaderText="id" ReadOnly="True" SortExpression="id" />  
                       
                      <asp:TemplateField HeaderText="图片分类">
                      <ItemTemplate>
                          <%# Eval("pclass")%>
                      </ItemTemplate>
                      <EditItemTemplate>
                         <asp:TextBox ID="tempclass" Text='<%# Eval("pclass") %>' Width="80px" Height="13px" runat="server" Visible="false"></asp:TextBox>
                          <asp:DropDownList ID="dlclass" runat="server" Width="80px">
                          </asp:DropDownList>
                      </EditItemTemplate>
                      <FooterTemplate>
                          <asp:DropDownList ID="add_class" runat="server" Width="80px">
                          </asp:DropDownList>
                      </FooterTemplate>
                      </asp:TemplateField>   

                      <asp:TemplateField HeaderText="图片名称">
                      <ItemTemplate>
                          <%# Eval("pname")%>
                      </ItemTemplate>
                      <EditItemTemplate>
                          <asp:TextBox ID="pname" Text='<%# Eval("pname") %>' Width="100px" Height="13px" runat="server"></asp:TextBox>
                      </EditItemTemplate>
                      <FooterTemplate>
                          <asp:TextBox ID="add_pname" Text='<%# Eval("pname") %>' Width="100px" Height="13px" runat="server"></asp:TextBox>
                      </FooterTemplate>
                      </asp:TemplateField>
                      
                      <asp:TemplateField HeaderText="图片浏览">
                      <ItemTemplate>
                          <img src="images/tou.gif" width="18" height="18" onMouseOver="document.getElementById('<%# Eval("id")%>').style.display='block';" onMouseOut="document.getElementById('<%# Eval("id")%>').style.display='none';" style="cursor:pointer;">
                          <div id="<%# Eval("id")%>" style="position:absolute;z-index:1;display:none"> <img src="<%# Eval("tpath") %>" border="0" style="border:1px solid #000000;" /> </div>
                      </ItemTemplate>
                      <EditItemTemplate>
                          <img src="images/tou.gif" width="18" height="18" onMouseOver="document.getElementById('<%# Eval("id")%>').style.display='block';" onMouseOut="document.getElementById('<%# Eval("id")%>').style.display='none';" style="cursor:pointer;">
                          <div id="<%# Eval("id")%>" style="position:absolute;z-index:1;display:none"> <img src="<%# Eval("tpath") %>" border="0" style="border:1px solid #000000;" /> </div>
                      </EditItemTemplate>
                      <FooterTemplate>
                         <table>
                         <tr>
                           <td>
                             <asp:FileUpload ID="fileup" runat="server" Height="18px" SkinID="blue" Width="150px"/><asp:Button ID="up" runat="server" Height="20px" Text="上传" OnClick="up_Click" CausesValidation="False" SkinID="blue"/>
                           <td>
                         </tr>
                         <tr>
                           <td>
                             <asp:Image ID="upimg" runat="server" Visible="false"/>
                             <asp:Image ID="upimg2" runat="server" Visible="false"/>
                           </td>
                         </tr>
                         </table>
                      </FooterTemplate>
                      </asp:TemplateField>
                      
                      <asp:TemplateField HeaderText="点击数">
                      <ItemTemplate>
                          <%# Eval("pbit")%>
                      </ItemTemplate>
                      <EditItemTemplate>
                          <asp:TextBox ID="pbit" Text='<%# Eval("pbit") %>' Width="50px" Height="13px" runat="server"></asp:TextBox>
                      </EditItemTemplate>
                      <FooterTemplate>
                          <asp:TextBox ID="add_pbit" Text='<%# Eval("pbit") %>' Width="50px" Height="13px" runat="server"></asp:TextBox>
                      </FooterTemplate>
                      </asp:TemplateField>
                      
                      <asp:TemplateField HeaderText="发布日期">
                      <ItemTemplate>
                          <%# short_time(Eval("pdate"))%>
                      </ItemTemplate>
                      <EditItemTemplate>
                          <asp:TextBox ID="pdate" Text='<%# short_time(Eval("pdate")) %>' Width="80px" Height="13px" runat="server"></asp:TextBox>
                      </EditItemTemplate>
                      <FooterTemplate>
                          <asp:TextBox ID="add_pdate" Text='<%# short_time(Eval("pdate")) %>' Width="80px" Height="13px" runat="server"></asp:TextBox>
                      </FooterTemplate>
                      </asp:TemplateField>
                      
                      <asp:TemplateField HeaderText="图片置顶">
                      <ItemTemplate>
                          <asp:CheckBox ID="top" runat="server" Text="置顶" Enabled="false" Checked=<%#  Convert.ToBoolean(Eval("ptop"))%>/>
                      </ItemTemplate>
                      <EditItemTemplate>
                          <asp:CheckBox ID="top" runat="server" Text="置顶" Checked=<%#  Convert.ToBoolean(Eval("ptop"))%>/>                      
                      </EditItemTemplate>
                      <FooterTemplate>
                          <asp:CheckBox ID="add_top" runat="server" Text="置顶" Checked="false"/>    
                      </FooterTemplate>
                      </asp:TemplateField>
                      
                      <asp:CommandField HeaderText="快速编辑" ShowEditButton="True" CausesValidation="False"/>

                      
                      <asp:TemplateField HeaderText="删除">
                      <HeaderTemplate>
                          <asp:CheckBox ID="delall" runat="server" OnCheckedChanged="delall_CheckedChanged" Text="删除" AutoPostBack="True" />  
                      </HeaderTemplate>
                      <ItemTemplate>
                          <asp:CheckBox ID="del" runat="server" Text=""/>
                      </ItemTemplate>
                      <EditItemTemplate>
                          <asp:CheckBox ID="del" runat="server" />                      
                      </EditItemTemplate>
                      <FooterTemplate>
                          <asp:Button ID="add_do" runat="server" OnClick="add_do_Click" SkinID="blue" Text="添加" CausesValidation="False" />
                      </FooterTemplate>
                      </asp:TemplateField>
                  </Columns>
              </asp:GridView>          </td>
        </tr>
        <%if(myGrid.Rows.Count==0){ %>
        <tr>
          <td colspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>
                 <asp:DropDownList ID="add_class" runat="server" Width="80px">
                 </asp:DropDownList>
              </td>
              <td>
                 <asp:TextBox ID="add_pname" Text='<%# Eval("pname") %>' Width="100px" Height="13px" runat="server">
                 </asp:TextBox>
              </td>
              <td>
                 <table>
                         <tr>
                           <td>
                             <asp:FileUpload ID="fileup" runat="server" Height="18px" SkinID="blue" Width="150px"/><asp:Button ID="up" runat="server" Height="20px" Text="上传" OnClick="up_Click" CausesValidation="False" SkinID="blue"/>
                           <td>
                         </tr>
                         <tr>
                           <td>
                             <asp:Image ID="upimg" runat="server" Visible="false"/>
                             <asp:Image ID="upimg2" runat="server" Visible="false"/>
                           </td>
                         </tr>
                 </table>
              </td>
              <td>
                 <asp:TextBox ID="add_pbit" Text='<%# Eval("pbit") %>' Width="50px" Height="13px" runat="server">
                 </asp:TextBox>
              </td>
              <td>
                 <asp:TextBox ID="add_pdate" Text='<%# Eval("pdate") %>' Width="80px" Height="13px" runat="server">
                 </asp:TextBox>
              </td>
              <td>
                 <asp:CheckBox ID="add_top" runat="server" Text="置顶" Checked="false"/>
              </td>
              <td>
                 <asp:Button ID="add_do" runat="server" OnClick="add_do_Click" SkinID="blue" Text="添加" CausesValidation="False" />
              </td>
            </tr>
          </table></td>
		</tr>
		<%} %>
        <tr>
          <td width="190" style="padding-top:10px;">
          <webdiyer:aspnetpager id="AspNetPager1" runat="server" custominfohtml="当前  <font color='red'><b>%CurrentPageIndex%</b></font>/%PageCount%页&nbsp;&nbsp;记录位置:%StartRecordIndex%-%EndRecordIndex%"
            custominfotextalign="Center" firstpagetext="首页" horizontalalign="Center" inputboxstyle="width:19px"
            lastpagetext="尾页" meta:resourcekey="AspNetPager1" nextpagetext="下页" onpagechanged="pagego"
            pagesize="12" prevpagetext="前页" showcustominfosection="Left" showinputbox="Always"
            shownavigationtooltip="True" style="font-size: 14px" width="400px" AlwaysShow="True"></webdiyer:aspnetpager></td>
          <td style="padding-left:10px; padding-top:10px; width: 34px;"><asp:Button ID="Button1" SkinID="blue" runat="server" OnClick="Button1_Click" Text="全选" CausesValidation="False" />          </td>
          <td width="422" style="padding-left:10px; padding-top:10px"><asp:Button ID="btdel" SkinID="blue" runat="server" Text="选中删除" OnClick="btdel_Click" OnClientClick="javascript:{if(confirm('将会把日记名为此分类的项目全部删除,是否确认删除此分类?')){return true;}return false;}" CausesValidation="False" /></td>
        </tr>
      </table>
    </form>
</body>
</html>
