<%@ Page Title="工作日历" Language="C#" MasterPageFile="~/admin/Admin.Master" AutoEventWireup="true" CodeBehind="sDay.aspx.cs" Inherits="helpdesk.admin.sDay" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>


    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>





    
<div class="search-wrap">
            <div class="search-content">
              
                    <table class="search-tab">
                        <tbody> 
                            <tr>
                                <th width="150"><i class="require-red">*</i>特殊日期：</th>
                                <td>
                                   <asp:TextBox   onClick="javascript:ShowCalendar(this)"  class="common-text required" style="width:300px;"  runat="server" id="txt_sday"></asp:TextBox>
                                    
                                </td>
                            </tr>
                            <tr>
                                <th>是否是工作日：</th>
                                <td>
                                    <asp:DropDownList Width="120" runat="server" ID="ddl_isworkday">
                                        <asp:ListItem Text="非工作日" Value="0"></asp:ListItem>
                                          <asp:ListItem Text="工作日" Value="1"></asp:ListItem>
                                    </asp:DropDownList>
                             </td>
                            </tr>
                            
                            <tr>
                                <th></th>
                                <td>
                                    <asp:Button ID="btnAdd" CssClass="btn btn-primary btn6 " runat="server" Text="添加" OnClick="btnAdd_Click" />   
                                   
                                </td>
                            </tr>
                        </tbody></table>

  </div>
  </div>














    <asp:SqlDataSource 
         ConnectionString='<%$ ConnectionStrings:connectionstring %>' 
        ID="SqlDataSource1" runat="server" DeleteCommand="DELETE FROM [helpdesk_sday] WHERE [id] = @id" InsertCommand="INSERT INTO [helpdesk_sday] ([sdate], [isworkday]) VALUES (@sdate, @isworkday)" ProviderName="System.Data.SqlClient" SelectCommand="SELECT [sdate], [isworkday], [id] FROM [helpdesk_sday] ORDER BY [sdate] DESC" UpdateCommand="UPDATE [helpdesk_sday] SET [sdate] = @sdate, [isworkday] = @isworkday WHERE [id] = @id">
        <DeleteParameters>
            <asp:Parameter Name="id" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="sdate" Type="DateTime" />
            <asp:Parameter Name="isworkday" Type="Int32" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="sdate" Type="DateTime" />
            <asp:Parameter Name="isworkday" Type="Int32" />
            <asp:Parameter Name="id" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <br />


    <asp:GridView 
        ID="GridView1"
         GridLines="None" class="result-tab"  Width="500px"
         runat="server" AllowPaging="True" DataSourceID="SqlDataSource1" AutoGenerateColumns="False" DataKeyNames="id">
        <Columns>
            <asp:CommandField ShowDeleteButton="True"  DeleteText="删除"/>
                        <asp:BoundField DataField="id" HeaderStyle-Width="80px" HeaderText="id" InsertVisible="False" ReadOnly="True" SortExpression="id" />
            <asp:BoundField DataField="sdate"  DataFormatString="{0:yyyy-MM-dd}" HeaderStyle-Width="160px" HeaderText="特殊日期" SortExpression="sdate" />
             <asp:TemplateField>
                <ItemTemplate>
                    <%#Eval("isworkday").ToString()=="1"?"工作日":"非工作日" %>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>


        </ContentTemplate>

    </asp:UpdatePanel>



</asp:Content>
