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

    <table style="margin:10px;">
        <tr>
            <td>
                <asp:Label runat="server" ID="lbl_dt"></asp:Label> &nbsp;&nbsp;
            </td>
            <td>
                <asp:TextBox runat="server" ID="txt_new" CssClass="form-control" Width="550px" TextMode="MultiLine" Height="40"></asp:TextBox>
            </td>
            <td>
              &nbsp;&nbsp;  <asp:Button ID="Button1" runat="server" Text="添加" CssClass="btn btn-primary" OnClick="Button1_Click" />
            </td>
            <td>
                
            </td>
        </tr>

    </table>
    <asp:ListView runat="server" ID="lv_logs" DataKeyNames="id" DataSourceID="SqlDataSource1" 
         >
            
           <ItemTemplate>
               <tr  > 
                  <td> <%#Eval("name")%></td>
                   <td>
                      <%#DateTime.Parse(Eval("logdate").ToString()).ToString("MM-dd")%>
                   </td>
                   <td>
  <asp:ImageButton ID="ib_edit" runat="server" ImageUrl="images/delete.gif"  
         CommandName="Delete"  />      
                   </td>
                   
               </tr>
           </ItemTemplate>
           <LayoutTemplate>
              
                   <table  class="table table-hover" id="itemPlaceholderContainer" runat="server" border="0" style="">
                              
<tr>        
               <th>内容</th>
              <th runat="server" style="width:180px">日期</th>
              <th runat="server" style="width:80px">操作</th>
                                 
                               </tr>
                               <tr id="itemPlaceholder" runat="server">
                               </tr>
                           </table>
                    
           </LayoutTemplate>
         

       </asp:ListView>

     
   
   
   
   
   
   
   
   
   
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
     ConnectionString='<%$ ConnectionStrings:connectionstring %>'
     DeleteCommand=" delete from portal_worklog where id=@id "
     SelectCommand=" select *  from portal_worklog  where  (uid=@uid) and (datediff(d,logdate,@basedate)=0)   order by logdate  asc   "  
     onselecting="SqlDataSource1_Selecting"
     
     > 
    
        <DeleteParameters>
            <asp:Parameter Name="id" />
        </DeleteParameters>
    
    <SelectParameters> 
       <asp:Parameter Name="uid"  Type="Int32" /> 
       <asp:Parameter Name="basedate"  Type="DateTime" />  
    </SelectParameters>
    
       
    
   </asp:SqlDataSource>

</asp:Content>
