<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="search_lend.aspx.cs" Inherits="Web.sb.show.search_lend" %>

<!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 id="Head1" runat="server">
    <title>无标题页</title>
    <link href="../../css/css.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../css/popcalendar.js"></script>
    </head>
<body>
    <form id="fom" runat="server">
        <div id ="main-c-03-right" >
            <table cellpadding="0"; cellspacing ="0"; style =" width :100%;background-image: url('../../css/images/right_top.png'); background-repeat :repeat-x" >
                <tr>
                    <td style ="width :720px; height :34px;  background-image: url('../../css/images/atghtj.png');	background-repeat: no-repeat;
                	background-position: left top;"><div id="main-c-03-right02-top">
                	   <!--这里添加页面标题 -->
                      	设备借用查询
                      	
                	</div></td>
                </tr>
            </table>
            <div id="main-c-03-right02-main">
            
<!--栏目开始 -->
            <table style ="width :100%; " border="0"  cellpadding="0" cellspacing="0" class="ziti04">

                <tr>
                    <td colspan="4" style=" text-align :right ">          <div>
              <asp:LinkButton ID="lbtViewlenddatechange" runat="server" 
                  onclick="lbtViewlenddatechange_Click">显示延期记录</asp:LinkButton></div> </td>
                </tr>
            </table>
            <!--这里添加内容 -->
              <table border = "1" class ="table" cellpadding ="0" cellspacing ="0" style ="width :100%">
            <tr>
                <td class ="tabletd_right " style ="width :60px">
                                        查询内容</td>
                <td class ="tabletd_left ">
                                            <asp:DropDownList ID="ddlNeirong" runat="server">
                                                <asp:ListItem>已借</asp:ListItem>
                                                <asp:ListItem>已还</asp:ListItem>
                                                <asp:ListItem>所有</asp:ListItem>
                                            </asp:DropDownList>
                                            </td>
                <td class ="tabletd_right " style ="width :60px">
                                        设备类别</td>
                <td class ="tabletd_left ">
                                            <asp:DropDownList ID="ddlCategories" runat="server">
                                            </asp:DropDownList>
                                            </td>
                <td class ="tabletd_right " style ="width :60px">
                    借出时间</td>
                <td class ="tabletd_left ">
                    从 
                    <asp:TextBox ID="tbLendtime_Star" runat="server" Width="60px" onclick="popUpCalendar(this,this,'yyyy-mm-dd')"></asp:TextBox>
                    到 
                    <asp:TextBox ID="tbLendtime_End" runat="server" Width="60px" onclick="popUpCalendar(this,this,'yyyy-mm-dd')"></asp:TextBox> 
                                            </td>
            </tr>
            <tr>
                <td class ="tabletd_right">
                    设备编号</td>
                <td class ="tabletd_left">
                    <asp:TextBox ID="tbDevicenumber" runat="server" Width="110px"></asp:TextBox>
                                            </td>
                <td class ="tabletd_right">
                    型号</td>
                <td class ="tabletd_left">
                    <asp:TextBox ID="tbType" runat="server" Width="110px"></asp:TextBox>
                                            </td>
                <td class ="tabletd_right">
                    借用数量</td>
                <td class ="tabletd_left">
                   从
                    <asp:TextBox ID="tbLend_Star" runat="server" Width="70px"></asp:TextBox>到
                    <asp:TextBox ID="tbLend_End" runat="server" Width="70px"></asp:TextBox>
                                            <asp:RegularExpressionValidator ID="RegularExpressionValidator13" runat="server" 
                                                ControlToValidate="tbLend_Star" 
                        Display="Dynamic" ErrorMessage="请输入大于0的整数。" 
                                                ValidationExpression="^\+?[1-9][0-9]*$" ToolTip="借用数量" 
                                                ValidationGroup="sub" ForeColor="Red"></asp:RegularExpressionValidator>
                                            <asp:RegularExpressionValidator ID="RegularExpressionValidator14" runat="server" 
                                                ControlToValidate="tbLend_End" 
                        Display="Dynamic" ErrorMessage="请输入大于0的整数。" 
                                                ValidationExpression="^\+?[1-9][0-9]*$" ToolTip="借用数量" 
                                                ValidationGroup="sub" ForeColor="Red"></asp:RegularExpressionValidator>
                                            </td>
            </tr>
            <tr>
                <td class ="tabletd_right " style ="width :60px">
                    设备名称</td>
                <td class ="tabletd_left ">
                    <asp:TextBox ID="tbDevicename" runat="server" Width="110px"></asp:TextBox>
                                            </td>
                <td class ="tabletd_right " style ="width :60px">
                    借出凭证</td>
                <td class ="tabletd_left ">
                    <asp:TextBox ID="tbIouid" runat="server" Width="110px"></asp:TextBox>
                                            </td>
                <td class ="tabletd_right " style ="width :60px">
                    已还数量</td>
                <td class ="tabletd_left ">
                    从
                    <asp:TextBox ID="tbReturn_Star" runat="server" Width="70px"></asp:TextBox> 到
                    <asp:TextBox ID="tbReturn_End" runat="server" Width="70px"></asp:TextBox>
                    <asp:RegularExpressionValidator 
                        ID="RegularExpressionValidator15" runat="server" 
                                                ControlToValidate="tbReturn_Star" 
                        Display="Dynamic" ErrorMessage="请输入整数。" 
                                                ValidationExpression="^\+?[0-9]*$" ToolTip="已还数量" 
                                                ValidationGroup="sub" ForeColor="Red"></asp:RegularExpressionValidator>
                                            <asp:RegularExpressionValidator ID="RegularExpressionValidator16" runat="server" 
                                                ControlToValidate="tbReturn_End" 
                        Display="Dynamic" ErrorMessage="请输入整数。" 
                                                ValidationExpression="^\+?[0-9]*$" ToolTip="已还数量" 
                                                ValidationGroup="sub" ForeColor="Red"></asp:RegularExpressionValidator>
                                            </td>
            </tr>
            <tr>
                <td class ="tabletd_center " colspan="6">
                    <asp:Button ID="tbSub" runat="server" Text="提交查询" onclick="tbSub_Click" 
                        ValidationGroup="sub" />
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:Button ID="btReset" runat="server" onclick="btReset_Click" Text="重置" />
                </td>
            </tr>
            </table>
				        

<!--栏目结束 -->
               
<!--栏目开始 -->
  <asp:Panel ID="Panel1" runat="server" Visible="False">
                <table style =" width :100%; " border="0" cellpadding="0" cellspacing="0" class="ziti04">
                     <tr>
                         <td style ="font-weight:bolder;background-image: url('../../css/images/asdfrsg.png'); width :497px; height :33px; padding-left :20px">
                             <!--这里添加栏目标题 -->
                             借用设备列表 
                             &gt;&gt;</td>
                         <td style ="background-image: url('../../css/images/asdfrsg.png'); width :103px"></td>
                         <td style ="background-image: url('../../css/images/asdfrsg.png'); width :64px"></td>
                         <td  style ="background-image: url('../../css/images/asdfrsg.png'); width :76px" ></td>
                    </tr>
                    <tr>
                         <td  colspan="4" style="font-weight:bolder; height :10px;"></td>
                    </tr>
                </table>
                        <!--这里添加内容 -->
                        <asp:GridView ID="GridView1" runat="server" 
                    onrowdatabound="GridView1_RowDataBound" Width="100%" 
                BorderWidth="1px" CssClass="gv" AutoGenerateColumns="False" 
                    onrowcancelingedit="GridView1_RowCancelingEdit" 
                    onrowediting="GridView1_RowEditing" onrowupdating="GridView1_RowUpdating" 
                    onrowcreated="GridView1_RowCreated" >
            <RowStyle BorderWidth="1px" CssClass="gvrow" />
            <Columns>
                    <asp:BoundField DataField="devicenumber" HeaderText="设备编号" ReadOnly="True" />
                    <asp:BoundField DataField="categories" HeaderText="类别" ReadOnly="True" />
                    <asp:BoundField DataField="devicename" HeaderText="设备名称" ReadOnly="True" />
                    <asp:BoundField DataField="type" HeaderText="型号" ReadOnly="True" />
                    <asp:TemplateField HeaderText="配置">
                        <EditItemTemplate>
                            <asp:Label ID="configuration_e" runat="server" Text='<%# Eval("configuration") %>'></asp:Label>&nbsp;
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="configuration_v" runat="server"></asp:Label>
                            <asp:Label ID="configuration_notv" runat="server" Text='<%# Bind("configuration") %>'  Visible ="false" ></asp:Label>&nbsp;
                        </ItemTemplate>
                    </asp:TemplateField>

                    <asp:TemplateField HeaderText="借用数量">
                        <EditItemTemplate>
                            <asp:Label ID="lendnumber_e" runat="server" Text='<%# Eval("lendnumber") %>'></asp:Label>
                            <asp:Label ID="lendnumberunit_e" runat="server" Text='<%# Bind("unit") %>'></asp:Label>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lendnumber_v" runat="server" Text='<%# Bind("lendnumber") %>'></asp:Label>
                            <asp:Label ID="lendnumberunit_v" runat="server" Text='<%# Bind("unit") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>

                    <asp:TemplateField HeaderText="已还数量">
                        <EditItemTemplate>
                            <asp:Label ID="returnnumber_e" runat="server" 
                                Text='<%# Eval("returnnumber") %>'></asp:Label>
                            <asp:Label ID="returnnumberunit_e" runat="server" Text='<%# Bind("unit") %>'></asp:Label>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="returnnumber_v" runat="server" 
                                Text='<%# Bind("returnnumber") %>'></asp:Label>
                            <asp:Label ID="returnnumberunit_v" runat="server" Text='<%# Bind("unit") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>

                    <asp:BoundField DataField="lenddate" HeaderText="借用时间" ReadOnly="True" />
                   
                     <asp:TemplateField HeaderText="借用说明">
                         <EditItemTemplate>
                             <asp:Label ID="lendnote_e" runat="server" Text='<%# Eval("lendnote") %>'></asp:Label>&nbsp;
                         </EditItemTemplate>
                         <ItemTemplate>
                             <asp:Label ID="lendnote_v" runat="server"></asp:Label>
                             <asp:Label ID="lendnote_notv" runat="server" Text='<%# Eval("lendnote") %>' Visible ="false" ></asp:Label>&nbsp;
                         </ItemTemplate>
                    </asp:TemplateField>


                    <asp:TemplateField HeaderText="计划归还时间">
                        <EditItemTemplate>
                            &nbsp;
                            <asp:TextBox ID="tb_plansreturndate_e" runat="server" 
                                onclick="popUpCalendar(this,this,'yyyy-mm-dd')" 
                                ></asp:TextBox>
                            &nbsp;
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                ControlToValidate="tb_plansreturndate_e" Display="Dynamic" ErrorMessage="归还时间不能为空。"></asp:RequiredFieldValidator>
                                <asp:Label ID="plansreturndate_note" runat="server" Text='<%# Eval("plansreturndate") %>'  Visible ="false" ></asp:Label>
                        </EditItemTemplate>
                        <ItemTemplate>
                            &nbsp;
                            <asp:Label ID="plansreturndate_v" runat="server" Text='<%# Eval("plansreturndate") %>'></asp:Label>
                            &nbsp;
                        </ItemTemplate>
                    </asp:TemplateField>

                     <asp:BoundField DataField="iouid" HeaderText="借用凭证" ReadOnly="True" />
                    
                    <asp:CommandField EditText="延期" HeaderText="操作" ShowEditButton="True" />
                     <asp:BoundField DataField="id" HeaderText="序号" ReadOnly="True" />
                </Columns>
            <HeaderStyle BorderWidth="1px" CssClass="gvhead" />
        </asp:GridView>
         <table border="0" cellpadding="4" cellspacing="1"  style ="width :100% ; text-align :right ">
        <tr><td  id ="allowpage" runat ="server" style ="text-align :right ;  padding-right  :5px"></td></tr>
        </table> 
          </asp:Panel>    

                  
                        
<!--栏目结束 -->





<!--栏目开始 -->
<asp:Panel ID="Panel2" runat="server" Visible ="false" >
                <table style =" width :100% ; text-align:center " border="0"  cellpadding="0" cellspacing="0" class="ziti04">
                     <tr>
                         <td style ="font-weight:bolder;background-image: url('../../css/images/asdfrsg.png');  height :33px; padding-left :20px; text-align :left ">
                             <!--这里添加栏目标题 -->
                             延期申请记录 
                             &gt;&gt;</td>
                         <td style ="background-image: url('../../css/images/asdfrsg.png'); width :103px"></td>
                         <td style ="background-image: url('../../css/images/asdfrsg.png'); width :64px"></td>
                         <td style ="background-image: url('../../css/images/asdfrsg.png'); width :76px"></td>
                    </tr>
                    <tr>
                         <td colspan="4" style="font-weight:bolder; text-align :left; height :10px; ">

                         </td>
                    </tr>
                </table>
                        <!--这里添加内容 -->
                        <div  style =" text-align :left ">                             
                            <asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True" 
                                 RepeatDirection="Horizontal" 
                                onselectedindexchanged="lbtViewlenddatechange_Click">
                                 <asp:ListItem>未审核</asp:ListItem>
                                 <asp:ListItem>同意</asp:ListItem>
                                 <asp:ListItem>未批准</asp:ListItem>
                                 <asp:ListItem Selected="True">所有</asp:ListItem>
                             </asp:RadioButtonList></div>

                             <div >                       
                                 按申请时间查询：起始日期&nbsp;&nbsp; <asp:textbox id="date1" runat="server" Width="100px"  
              ToolTip="点击输入框右侧的日期图标选择日期" onclick="popUpCalendar(this,this,'yyyy-mm-dd')"></asp:textbox>
                                 
        终止日期&nbsp;&nbsp; <asp:textbox id="date2" runat="server" Width="100px"    
              ToolTip="点击输入框右侧的日期图标选择日期" onclick="popUpCalendar(this,this,'yyyy-mm-dd')"></asp:textbox>
                                                          
       <asp:Button ID="tijiao" runat="server" onclick="lbtViewlenddatechange_Click" Text="提交查询" 
                                     ValidationGroup="cha"/>
       &nbsp;&nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator1" 
                  runat="server" ControlToValidate="date1" Display="Dynamic" 
                  ErrorMessage="起始日期必填！" ValidationGroup="cha" ForeColor="Red"></asp:RequiredFieldValidator>
              <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                  ControlToValidate="date2" Display="Dynamic" ErrorMessage="终止日期必填！" 
                          ValidationGroup="cha" ForeColor="Red"></asp:RequiredFieldValidator>
              <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                  ControlToValidate="date1" Display="Dynamic" ErrorMessage="请填正确日期格式：如2001-01-01" 
                  ValidationExpression="\d{4}-\d{2}-\d{2}" ValidationGroup="cha" ForeColor="Red"></asp:RegularExpressionValidator>
              <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                  ControlToValidate="date2" Display="Dynamic" ErrorMessage="请填正确日期格式：如2001-01-01" 
                  ValidationExpression="\d{4}-\d{2}-\d{2}" ValidationGroup="cha" ForeColor="Red"></asp:RegularExpressionValidator>
                      </div>

                        <asp:GridView ID="GridView2" runat="server" Width="100%" 
                BorderWidth="1px" CssClass="gv" AutoGenerateColumns="False" 
                    onrowcreated="GridView2_RowCreated" 
                    onrowdatabound="GridView2_RowDataBound" onrowdeleting="GridView2_RowDeleting" >
            <RowStyle BorderWidth="1px" CssClass="gvrow" />
            <Columns>
            <asp:BoundField DataField="claimdate" HeaderText="申请时间" ReadOnly="True" />
                   
                    <asp:BoundField DataField="devicename" HeaderText="设备名称" ReadOnly="True" />
                    <asp:BoundField DataField="type" HeaderText="型号" ReadOnly="True" />
                    <asp:TemplateField HeaderText="配置">
                        <EditItemTemplate>
                            <asp:Label ID="configuration_e0" runat="server" 
                                Text='<%# Eval("configuration") %>'></asp:Label>&nbsp;
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="configuration_v0" runat="server"></asp:Label>
                            <asp:Label ID="configuration_notv0" runat="server" 
                                Text='<%# Bind("configuration") %>'  Visible ="false" ></asp:Label>&nbsp;
                        </ItemTemplate>
                    </asp:TemplateField>

                    <asp:TemplateField HeaderText="借用数量">
                        <EditItemTemplate>
                            <asp:Label ID="lendnumber_e0" runat="server" Text='<%# Eval("lendnumber") %>'></asp:Label>
                            <asp:Label ID="lendnumberunit_e0" runat="server" Text='<%# Bind("unit") %>'></asp:Label>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lendnumber_v0" runat="server" Text='<%# Bind("lendnumber") %>'></asp:Label>
                            <asp:Label ID="lendnumberunit_v0" runat="server" Text='<%# Bind("unit") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>

                    <asp:TemplateField HeaderText="已还数量">
                        <EditItemTemplate>
                            <asp:Label ID="returnnumber_e0" runat="server" 
                                Text='<%# Eval("returnnumber") %>'></asp:Label>
                            <asp:Label ID="returnnumberunit_e0" runat="server" Text='<%# Bind("unit") %>'></asp:Label>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="returnnumber_v0" runat="server" 
                                Text='<%# Bind("returnnumber") %>'></asp:Label>
                            <asp:Label ID="returnnumberunit_v0" runat="server" Text='<%# Bind("unit") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>

                  
                   
                     <asp:TemplateField HeaderText="借用说明">
                         <EditItemTemplate>
                             <asp:Label ID="lendnote_e0" runat="server" Text='<%# Eval("lendnote") %>'></asp:Label>&nbsp;
                         </EditItemTemplate>
                         <ItemTemplate>
                             <asp:Label ID="lendnote_v0" runat="server"></asp:Label>
                             <asp:Label ID="lendnote_notv0" runat="server" Text='<%# Eval("lendnote") %>' 
                                 Visible ="false" ></asp:Label>&nbsp;
                         </ItemTemplate>
                    </asp:TemplateField>

                    <asp:BoundField DataField="lenddate" HeaderText="借用时间" ReadOnly="True" />
                    <asp:BoundField DataField="plansreturndate" HeaderText="原计划归还时间" ReadOnly="True" />
                    <asp:BoundField DataField="plansreturndate_new" HeaderText="新计划归还时间" ReadOnly="True" />

                    <asp:BoundField DataField="ratify" HeaderText="审批状态" ReadOnly="True" />
                    <asp:BoundField DataField="manager" HeaderText="审批人" ReadOnly="True" />
                    <asp:TemplateField HeaderText="审批日期">
                        <EditItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("ratifydate").ToString()=="1900-1-1 0:00:00"?"":Eval("ratifydate") %>'></asp:Label>&nbsp;
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("ratifydate").ToString()=="1900-1-1 0:00:00"?"":Eval("ratifydate") %>'></asp:Label>&nbsp;
                        </ItemTemplate>
                    </asp:TemplateField>
                   
                     <asp:TemplateField HeaderText="操作" ShowHeader="False">
                         <ItemTemplate>
                             <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                                 CommandName="Delete" Text="取消"></asp:LinkButton>
                         </ItemTemplate>
                    </asp:TemplateField>
                   
                    <asp:BoundField DataField="id" HeaderText="序号" ReadOnly="True" />
                   
                </Columns>
            <HeaderStyle BorderWidth="1px" CssClass="gvhead" />
        </asp:GridView>
                 </asp:Panel>        
<!--栏目结束 -->
                </div>
            </div>
        </form>
    </body>
</html>