<%@ Page Title="" Language="C#" MasterPageFile="Admin.Master" AutoEventWireup="true" CodeBehind="EditPhoto.aspx.cs" Inherits="Portal.Admin.EditPhoto" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">



     
<script type="text/javascript" src="../highslide/highslide.js"></script> 
<link rel="stylesheet" type="text/css" href="../highslide/highslide.css" />
     

<script type="text/javascript">
    hs.graphicsDir = '../highslide/graphics/';
    hs.wrapperClassName = 'wide-border';
</script>




 <div class="result-wrap">

      <div class="result-title">
                <h1>上传活动图片 </h1> 
            </div>

 
 <div>
   
 

 
  <table class="table">
   <tr>
   <th width=150px>活动名称：
   </th>
    <td>
         <asp:TextBox id="txt_title"  CssClass="form-control"  width="390"  runat="server" />
    </td>
    </tr>


       <tr>
       <th width=150px>活动简介：
         </th>
       <td>
    <asp:TextBox ID="txt_description" TextMode="MultiLine" Width="390px"  Height="60px" runat="server"></asp:TextBox>  
      </td>
    </tr>       
              
 <tr>
       <th width=150px>站外URL：
         </th>
       <td>
    <asp:TextBox ID="txt_url" runat="server"   CssClass="form-control" s Width="300px"></asp:TextBox>
      </td>
    </tr>       
           
 
   <tr>
  <td colspan="2">
   <div class="btnc">
    <asp:Button ID="Add" runat="server" Text="添加图片"  CssClass="btn btn-primary" 
        onclick="Add_Click"/>



         <asp:Button id="cancelButton" Text="取消" CausesValidation="False" runat="server" OnClick="CancelBtn_Click" CssClass="btn"  />
    
       
        <a href="shenhephoto.aspx" class="btn">审核图片</a>


      </div>
      </td>
      </tr>
      </table>
      </div>


    




  

   
<br />
<br />
<asp:GridView ID="GridView1" runat="server"   AutoGenerateColumns="False" 
    DataKeyNames="itemid"  DataSourceID="SqlDataSource1" 
    GridLines="None"
     CssClass="table" 
    >
   
    <Columns>
     <asp:BoundField DataField="title" ItemStyle-Width="150px" HeaderText="标题" />
    
 
      <asp:TemplateField>
      <HeaderTemplate>封面照片</HeaderTemplate>
      <ItemStyle Width="120px" />
            <ItemTemplate>  
            <a  onclick="window.open('../UploadImgWithThum.aspx?groupid=<%#Eval("groupid") %>&catid=<%#Eval("catid") %>&istop=1&id=<%#Eval("itemid") %>'); return false; ">	
            	      <img src='<%#Eval("thumpath").ToString()==""?"img/add.gif":Eval("thumpath") %>'    style="max-width:65px"  />
                <%#Eval("thumpath").ToString()==""?"添加封面":""%>
                 
                     </a>
               </ItemTemplate>
          </asp:TemplateField>




 <asp:TemplateField>
 <ItemStyle Width="185px" />
      <HeaderTemplate>操作图片</HeaderTemplate>
            <ItemTemplate> 
 
 
  <a href="javascript:void(0);" onclick="window.open('addphoto.aspx?groupid=<%#Eval("groupid") %>&catid=<%#Eval("catid") %>'); return false; ">批量上传</a> 

<a href="javascript:void(0);" onclick="window.open('../UploadImgWithThum.aspx?groupid=<%#Eval("groupid") %>&catid=<%#Eval("catid") %>&id=<%#Eval("itemid") %>'); return false; ">单张图片</a> 
 
   </ItemTemplate>
            
   </asp:TemplateField>
            

<asp:TemplateField>
<HeaderTemplate>活动图片</HeaderTemplate>
<ItemTemplate>
 
<asp:Repeater runat="server" ID="rpt_list" DataSource='<%#GetPics(Eval("groupid")) %>' > 
<ItemTemplate> 
    <img src='<%#Eval("thumpath").ToString()==""?"img/s.png":Eval("thumpath") %>'   style="max-width:65px"   />
 </ItemTemplate>
</asp:Repeater> 
</ItemTemplate>
</asp:TemplateField>


            
        <asp:BoundField DataField="itemid" HeaderText="ID" InsertVisible="False" 
            ReadOnly="True" Visible="false" />
       
         <asp:BoundField DataField="createdate" HeaderText="建立日期" 
          DataFormatString="{0:yyyy-MM-hh}" ItemStyle-Width="95px"
            />
      
      
        <asp:BoundField DataField="ispass" HeaderText="审核通过" Visible="false"  
              />
        <asp:BoundField DataField="groupid" HeaderText="组标识" 
            SortExpression="groupid"  Visible="false" />
        
          <asp:CommandField HeaderText="操作"  DeleteText="<span onclick=&quot;JavaScript:return confirm('确定删除吗？')&quot;>删除</span> "   ShowDeleteButton="True" ShowEditButton="False" />


    </Columns>
   
</asp:GridView>







<asp:SqlDataSource ID="SqlDataSource1" runat="server"   onselecting="SqlDataSource1_Selecting"
    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
    DeleteCommand="DELETE FROM [portal_photoes] WHERE [itemid] = @itemid" 
    InsertCommand="INSERT INTO [portal_photoes] ([title], [createdate], [username], [uid], [moduleid], [catid], [ispass], [groupid], [istop], [url]) VALUES (@title,  @createdate, @username, @uid, @moduleid, @catid, @ispass, @groupid, @istop, @url)" 
    SelectCommand="SELECT * FROM [portal_photoes] WHERE ([uid] = @uid and istop=1 and ispass=0 ) ORDER BY [itemid] DESC" 
    UpdateCommand="UPDATE [portal_photoes] SET [title] = @title,  [createdate] = @createdate, [username] = @username, [uid] = @uid, [moduleid] = @moduleid, [catid] = @catid, [ispass] = @ispass, [groupid] = @groupid, [istop] = @istop, [url] = @url WHERE [itemid] = @itemid">
   
   <SelectParameters>
    <asp:Parameter Name="uid" Type="Int32" />
   </SelectParameters>
    <DeleteParameters>
        <asp:Parameter Name="itemid" Type="Int32" />
    </DeleteParameters>
    <UpdateParameters>
        <asp:Parameter Name="title" Type="String" />

        <asp:Parameter Name="createdate" Type="DateTime" />
        <asp:Parameter Name="username" Type="String" />
        <asp:Parameter Name="uid" Type="Int32" />
        <asp:Parameter Name="moduleid" Type="Int32" />
        <asp:Parameter Name="catid" Type="Int32" />
        <asp:Parameter Name="ispass" Type="Int32" />
        <asp:Parameter Name="groupid" Type="Int32" />
        <asp:Parameter Name="istop" Type="Int32" />
        <asp:Parameter Name="url" Type="String" />
        <asp:Parameter Name="itemid" Type="Int32" />
    </UpdateParameters>
    <InsertParameters>
        <asp:Parameter Name="title" Type="String" />
         <asp:Parameter Name="createdate" Type="DateTime" />
        <asp:Parameter Name="username" Type="String" />
        <asp:Parameter Name="uid" Type="Int32" />
        <asp:Parameter Name="moduleid" Type="Int32" />
        <asp:Parameter Name="catid" Type="Int32" />
        <asp:Parameter Name="ispass" Type="Int32" />
        <asp:Parameter Name="groupid" Type="Int32" />
        <asp:Parameter Name="istop" Type="Int32" />
        <asp:Parameter Name="url" Type="String" />
    </InsertParameters>
</asp:SqlDataSource>

   


  
  </asp:Content>
