<%@ Page Language="C#"   AutoEventWireup="true" CodeBehind="Photo_Delete.aspx.cs" Inherits="Portal.Portal.Photo_Delete" %>

<!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>
    

    <script src="../Javascript/common.js"></script>
 


</head>
<body>
    <form id="form1" runat="server">
    <div class="div_sep"></div>
    <div>
    
      <br /><br /><b>警告</b>：删除封面照会导致该图片无法显示。<br /><br />
    
     <asp:Button ID="Button1" runat="server" onclick="Button2_Click" Text="删除选中图片"  style=" width:150px;"  class="btn"/>
     

         <asp:Button ID="Button3" runat="server" Text="更新顺序"  style=" width:150px;" class="btn" onclick="projorder_Click" />
    
    
          <asp:Button ID="Button2" runat="server" Text="重置为封面"  style=" width:150px;" class="btn" onclick="updatedefault_Click" />
           
           
              <asp:GridView  DataSourceID="SqlDataSource1"  DataKeyNames="itemid"  
            FooterStyle-HorizontalAlign="Center"     ID="GridView1" runat="server" 
            CssClass="table_1" Width="1000px"    AutoGenerateColumns="False" EmptyDataText="没有数据" 
            onrowdatabound="GridView1_RowDataBound"> 
                       <Columns> 
                        <asp:TemplateField> 
                            <HeaderTemplate> 
<asp:CheckBox ID="chk_SelectedHeader" runat="server" AutoPostBack="False" onclick="javascript:SelectAll(this);" 
                            Text="全选" /> 
                            </HeaderTemplate> 
                            <ItemTemplate> 
                                <asp:CheckBox ID="CheckBox1" runat="server"   Text='<%# Bind("itemid") %>' /> 
                                
                               <asp:Label runat="server" ID="lbl_group" Visible="false"   Text='<%# Bind("groupid") %>' ></asp:Label>
                              
                            </ItemTemplate> 
                             <ItemStyle Width="80px" />
                        </asp:TemplateField> 
                        
                   
                   <asp:CommandField ShowDeleteButton="true"  ButtonType="Button"  ControlStyle-CssClass="btn" ShowEditButton="true" ItemStyle-Width="170px" />
                   
                   
                   
                   
                   
                    <asp:TemplateField   > 
                            <HeaderTemplate> 
                          封面 
                            </HeaderTemplate> 
                            <ItemTemplate> 
                               <asp:Label runat="server" ID="lbl_istop"></asp:Label>
                        
                            </ItemTemplate> 
                             <ItemStyle Width="60px" HorizontalAlign="Center" />
                        </asp:TemplateField> 
                        
                        
                       
                       
                       
                       
                       
                 <asp:TemplateField>
                  
                  <HeaderTemplate>顺序</HeaderTemplate>
          <ItemTemplate >
              <asp:TextBox ID="projOrderId" runat="server"  Width="50px"  Text=<%#Bind("orderid") %> ></asp:TextBox>
              
             </ItemTemplate>
          <ItemStyle Width="60px" />
          </asp:TemplateField>
                       
                       
                       
                       
                        
                          <asp:TemplateField HeaderText="缩略图" > 
                          <ItemTemplate >
                             <img src=<%#Eval("thumpath") %>  width="110px"/>
                          </ItemTemplate>
                          <ItemStyle Width="200px" />
                        </asp:TemplateField>
                        
                        <asp:BoundField DataField="title" HeaderText="主题" /> 
                            <asp:BoundField DataField="url" HeaderText="链接" /> 
                       
                          <asp:HyperLinkField DataNavigateUrlFields="itemid" Target="_blank" Text="查看修改简介" DataNavigateUrlFormatString="photointro.aspx?itemid={0}" />
                        </Columns> 
                    </asp:GridView>

   
    


     
         <asp:SqlDataSource ID="SqlDataSource1" 
        ConnectionString="<%$ ConnectionStrings:connectionstring %>" runat="server" 
        DeleteCommand="DELETE FROM [portal_photoes] WHERE [itemid] = @itemid" 
        ProviderName="System.Data.SqlClient" 
        SelectCommand="select * from portal_photoes where ( (ispass=1) and (groupid in ( select groupid from portal_photoes where itemid=@itemid)))  order by istop desc, orderid asc  " 
        UpdateCommand="UPDATE [portal_photoes] SET [title] = @title, url=@url WHERE [itemid] = @itemid">
        <SelectParameters>
            <asp:QueryStringParameter  Name="itemid"   QueryStringField="itemid" Type="String" />
        </SelectParameters>
        <DeleteParameters>
            <asp:Parameter Name="itemid" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="title" Type="String" />
           <asp:Parameter Name="url" Type="String" />
            <asp:Parameter Name="itemid" Type="Int32" />
        </UpdateParameters>
        
    </asp:SqlDataSource>
     
     
     
    </div>
    </form>
</body>
</html>
