<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login_search_lend.aspx.cs" Inherits="Web.sb.admin.login_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>OA标题页</title>
<link href="../../css/admincss/skin.css" rel="stylesheet" type="text/css" />
            <script type="text/javascript" src="../../css/popcalendar.js"></script>
</head>
<body>
    <form id="form1" runat="server" defaultfocus ="tbDevicenumber" >
<div>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
        <td   class ="top_bg_left "></td>
    <td  class ="top_bg_center " >
    <table style ="width :100%; height :31px"  border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
      
<!--这里写页标题 -->
        <td style ="height :31px"><div class="titlebt">借用管理</div></td>
      </tr>
    </table>
    </td> 
    <td class ="top_bg_right "></td>
  </tr>
  <tr>
    <td style ="background :url(../../css/admincss/images/mail_leftbg.gif); vertical-align :middle " >&nbsp;</td>
    <td style ="background-color :#F7F8F9; vertical-align :top " >
    
  <!--  一组内容模块开始   --> 
    <table class ="tablezong"   border="0"  cellpadding="0" cellspacing="0">
      <tr>
        <td style ="height :30px; text-align :right " >
         <div>
              <asp:LinkButton ID="lbtViewlenddatechange" runat="server" 
                  onclick="lbtViewlenddatechange_Click">显示延期记录</asp:LinkButton></div> 
        </td>
      </tr>
      <tr>
        <td>        
      <div>
            <div style ="text-align :left "> <asp:Label ID="lbMessage" runat="server" ForeColor="Red"></asp:Label></div>
<table border = "1" class ="table" cellpadding ="0" cellspacing ="0" style ="width :100%">
            <tr>
                <td class ="tabletd_right " style ="width :80px">
                    借用人姓名</td>
                <td class ="tabletd_left ">
                    <asp:TextBox ID="tbStaffname" runat="server" Width="70px"></asp:TextBox>
                                            </td>
                <td class ="tabletd_right " style ="width :80px">
                    借用人编号</td>
                <td class ="tabletd_left ">
                    <asp:TextBox ID="tbStaffnumber" runat="server" Width="160px"></asp:TextBox>
                                            </td>
                <td class ="tabletd_right " style ="width :80px">
                                        查询内容</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>
            </tr>
            <tr>
                <td class ="tabletd_right " style ="width :80px">
                    设备名称</td>
                <td class ="tabletd_left ">
                    <asp:TextBox ID="tbDevicename" runat="server" Width="160px"></asp:TextBox>
                                            </td>
                <td class ="tabletd_right " style ="width :80px">
                    设备编号</td>
                <td class ="tabletd_left ">
                    <asp:TextBox ID="tbDevicenumber" runat="server" Width="160px"></asp:TextBox>
                                            </td>
                <td class ="tabletd_right " style ="width :80px">
                                        设备类别</td>
                <td class ="tabletd_left ">
                                            <asp:DropDownList ID="ddlCategories" runat="server">
                                            </asp:DropDownList>
                                            </td>
            </tr>
            <tr>
                <td class ="tabletd_right " style ="width :80px">
                    型号</td>
                <td class ="tabletd_left ">
                    <asp:TextBox ID="tbType" runat="server" Width="160px"></asp:TextBox>
                                            </td>
                <td class ="tabletd_right " style ="width :80px">
                    借出凭证号</td>
                <td class ="tabletd_left ">
                    <asp:TextBox ID="tbIouid" runat="server" Width="160px"></asp:TextBox>
                                            </td>
                <td class ="tabletd_right " style ="width :80px">
                    借用数量</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 :80px">
                    借出时间</td>
                <td class ="tabletd_left " colspan="3">
                    从 
                    <asp:TextBox ID="tbLendtime_Star" runat="server" Width="80px" onclick="popUpCalendar(this,this,'yyyy-mm-dd')"></asp:TextBox> 
                    到 
                    <asp:TextBox ID="tbLendtime_End" runat="server" Width="80px" onclick="popUpCalendar(this,this,'yyyy-mm-dd')"></asp:TextBox> </td>
                <td class ="tabletd_right " style ="width :80px">
                    已还数量</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="请输入大于0的整数。" 
                                                ValidationExpression="^\+?[1-9][0-9]*$" ToolTip="已还数量" 
                                                ValidationGroup="sub" ForeColor="Red"></asp:RegularExpressionValidator>
                                            <asp:RegularExpressionValidator ID="RegularExpressionValidator16" runat="server" 
                                                ControlToValidate="tbReturn_End" 
                        Display="Dynamic" ErrorMessage="请输入大于0的整数。" 
                                                ValidationExpression="^\+?[1-9][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" />
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:Button ID="btReset" runat="server" onclick="btReset_Click" Text="重置" />
                </td>
            </tr>
            </table>
                    </div>
        
        
        </td>
      </tr>
    </table>
<!-- 一组内容模块结束 -->

    <!--  一组内容模块开始   --> 
    <asp:Panel ID="Panel1" runat="server" Visible ="false" >
    <table class ="tablezong"   border="0"  cellpadding="0" cellspacing="0">
      <tr>
        <td style ="height :40px" colspan="2" >
        <table class="tablebiaoti"  border="0" cellpadding="0" cellspacing="0" >
          <tr>
            <td><div class ="biaotileft ">  
                设备列表</div> </td>
          </tr>
        </table>
        </td>
      </tr>
      <tr>
        <td colspan="2">        
        
            <asp:GridView ID="GridView1" runat="server" Width="100%" CssClass="gv" 
            cellspacing="1" BorderWidth="1px" 
                AutoGenerateColumns="False" onrowcreated="GridView1_RowCreated" 
                onrowdatabound="GridView1_RowDataBound" >
            <RowStyle  CssClass="gvrow" BorderWidth="1px" />
                <Columns>
                                <asp:TemplateField> 
               <HeaderTemplate>  <asp:CheckBox ID="CheckBox2" Text ="全选" runat="server" AutoPostBack="True" 
                OnCheckedChanged="CheckBox2_CheckedChanged"  />    </HeaderTemplate>        
               <ItemTemplate><asp:CheckBox ID="CheckBox1" runat="server" /></ItemTemplate>               
               </asp:TemplateField>
                    <asp:BoundField DataField="id" HeaderText="序号" ReadOnly="True" />
                    <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="lenderid" HeaderText="借用人编号" ReadOnly="True" />
                    <asp:BoundField DataField="lender" HeaderText="借用人" ReadOnly="True" />
                    <asp:BoundField DataField="电话" HeaderText="电话" ReadOnly="True" />
                    <asp:BoundField DataField="邮箱" HeaderText="邮箱" ReadOnly="True" />
                     <asp:BoundField DataField="iouid" HeaderText="借用凭证" ReadOnly="True" />
                </Columns>
            <HeaderStyle  CssClass="gvhead"  />
        </asp:GridView>
        
        
        </td>
      </tr>
            <tr>         <td 
                            style="text-align :left ;  padding-right  :5px">
                          延期至： <asp:TextBox ID="tb_plansreturndate_e" runat="server" 
                                onclick="popUpCalendar(this,this,'yyyy-MM-dd')" 
                                ></asp:TextBox> <asp:Button ID="btCheck" runat="server" onclick="btChecked_Click" Text="批量延期" ValidationGroup="check" />
                          <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="tb_plansreturndate_e" Display="Dynamic" ErrorMessage="请填入计划归还日期！" ForeColor="Red" ValidationGroup="check"></asp:RequiredFieldValidator>
                </td>
                        <td  id ="allowpage" runat ="server" style ="text-align :right ;  padding-right  :5px">
                      &nbsp;
                    </td>
               
      </tr>
      <tr><td colspan="2">  
            <div class =" td_rightnoborder  ">      
                <asp:Button ID="btPrintView" runat="server" Text="打印预览" 
                  onclick="btPrintView_Click"  />
                <asp:Button ID="btExcel" runat="server" onclick="btExcel_Click" 
                    Text="导出到EXCEL" />
            </div>
      </td></tr>
    </table>
     </asp:Panel>
<!-- 一组内容模块结束 -->

    <!--  一组内容模块开始   --> 
    <asp:Panel ID="Panel2" runat="server" Visible ="false" >
    <table class ="tablezong"   border="0"  cellpadding="0" cellspacing="0">
      <tr>
        <td style ="height :40px" >
        <table class="tablebiaoti"  border="0" cellpadding="0" cellspacing="0" >
          <tr>
            <td><div class ="biaotileft ">  
                最近10条延期记录</div> </td>
          </tr>
        </table>
        </td>
      </tr>
      <tr>
        <td>        
        
            <asp:GridView ID="GridView2" runat="server" Width="100%" CssClass="gv" 
            cellspacing="1" BorderWidth="1px" 
                AutoGenerateColumns="False" onrowdatabound="GridView2_RowDataBound" >
            <RowStyle  CssClass="gvrow" BorderWidth="1px" />
                <Columns>

                  <asp:BoundField DataField="claimdate" HeaderText="申请时间" ReadOnly="True" />
                  <asp:BoundField DataField="claimerid" HeaderText="申请编号" ReadOnly="True" />
                   <asp:BoundField DataField="claimer" HeaderText="申请人" ReadOnly="True" />
                    <asp:BoundField DataField="devicename" HeaderText="设备名称" ReadOnly="True" />
                    <asp:BoundField DataField="devicenumber" HeaderText="设备编号" ReadOnly="True" />
                    <asp:BoundField DataField="categories" 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_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>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("ratifydate").ToString()=="1900-1-1 0:00:00"?"":Eval("ratifydate") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            <HeaderStyle  CssClass="gvhead"  />
        </asp:GridView>
        
        
        </td>
      </tr>


    </table>
     </asp:Panel>
<!-- 一组内容模块结束 -->
   
    </td>
    <td  style =" background-image:url(../../css/admincss/images/mail_rightbg.gif )" >
    </td>
  </tr>
  <tr>
<td  class ="buttom_bg_left "></td>
  <td   class ="buttom_bg_center " ></td>
    <td  class ="buttom_bg_right " ></td>
  </tr>
</table>
    </div>
    </form>
</body>
</html>
