<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login_lend.aspx.cs" Inherits="Web.sb.admin.login_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" defaultbutton ="btSelect" >
<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 ="padding-top :15px" >        
            <div>  <asp:TextBox ID="tbStaff" runat="server" Width="250px" placeholder="人员编号/电话/智能卡/邮箱"></asp:TextBox>
            <asp:Button ID="btSelect" runat="server" Text="提交" onclick="btSelect_Click" 
                ValidationGroup="cha" style="width: 40px" />
                            
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                            ControlToValidate="tbStaff" Display="Dynamic" ErrorMessage="请输入设备或人员信息" 
                            ValidationGroup="cha" ForeColor="Red"></asp:RequiredFieldValidator>
        
                            <asp:Label ID="lbMessage" runat="server" ForeColor="Red"></asp:Label>         
            
       
        
       </div>    
           <asp:Label ID="lbStaffnumber0" runat="server"></asp:Label>
            <asp:Label ID="lbStaffnumber" runat="server" Font-Bold="True"></asp:Label>
&nbsp;<asp:Label ID="lbStaffname" runat="server" Font-Bold="True"></asp:Label>
        
                           <asp:Label ID="lbDeviceNumber" runat="server" Visible ="false" ></asp:Label>
        
       
        
        </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" >
        <table class="tablebiaoti"  border="0" cellpadding="0" cellspacing="0" >
          <tr>
            <td><div class ="biaotileft ">  
                预借设备列表</div> </td>
          </tr>
        </table>
        </td>
      </tr>
      <tr>
        <td> 
            <asp:GridView ID="GridView1" runat="server" Width="100%" CssClass="gv" 
            cellspacing="1" BorderWidth="1px" onrowediting="GridView1_RowEditing" 
                AutoGenerateColumns="False" onrowupdating="GridView1_RowUpdating" 
                onrowcancelingedit="GridView1_RowCancelingEdit" 
                onrowdeleting="GridView1_RowDeleting" OnRowCreated="GridView1_RowCreated" >
            <RowStyle  CssClass="gvrow" BorderWidth="1px" />
                <Columns>
                    <asp:BoundField DataField="lenddate" HeaderText="预借时间" ReadOnly="True" />
                    <asp:BoundField DataField="devicenumber" HeaderText="设备编号" ReadOnly="True" />
                    <asp:BoundField DataField="devicename" HeaderText="设备名称" ReadOnly="True" />
                    <asp:BoundField DataField="type" HeaderText="型号" ReadOnly="True" />
                    <asp:BoundField DataField="configuration" HeaderText="详细配置" ReadOnly="True" />
                    <asp:BoundField DataField="unit" HeaderText="计量单位" ReadOnly="True" />
                    <asp:TemplateField HeaderText="借用数量">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("lendnumber") %>' 
                                Width="40px"></asp:TextBox>
                            库存:<asp:Label ID="Label2" runat="server" Text='<%#Bind("sumactualinventory") %>'></asp:Label>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                ControlToValidate="TextBox1" Display="Dynamic" ErrorMessage="数量不能为空。"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                ControlToValidate="TextBox1" Display="Dynamic" ErrorMessage="请输入大于0的整数。" 
                                ValidationExpression="^\+?[1-9][0-9]*$"></asp:RegularExpressionValidator>
                            <asp:RangeValidator ID="RangeValidator1" runat="server" 
                                ControlToValidate="TextBox1" ErrorMessage="请输入合适的数量" 
                                MaximumValue='<%# Bind("sumactualinventory") %>' MinimumValue="<%# 0 %>" 
                                Display="Dynamic" Type="Integer"></asp:RangeValidator>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("lendnumber") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="借用说明">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("lendnote") %>' 
                                Width="200px"></asp:TextBox>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" 
                                ControlToValidate="TextBox2" Display="Dynamic" ErrorMessage="不能超过100个字" 
                                Font-Size="Small" ValidationExpression="^[^%&gt;&lt;&amp;=]{0,100}$"></asp:RegularExpressionValidator>
                            &nbsp;
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("lendnote") %>'></asp:Label>
                            &nbsp;
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="计划归还时间">
                        <EditItemTemplate>
                          &nbsp;  <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("plansreturndate") %>' onclick="popUpCalendar(this,this,'yyyy-mm-dd')"></asp:TextBox>&nbsp;
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                ControlToValidate="TextBox3" Display="Dynamic" ErrorMessage="归还时间不能为空。"></asp:RequiredFieldValidator>
                        </EditItemTemplate>
                        <ItemTemplate>
                           &nbsp; <asp:Label ID="Label3" runat="server" Text='<%# Bind("plansreturndate") %>'></asp:Label>&nbsp;
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:CommandField EditText="修改" HeaderText="修改" ShowEditButton="True" />
                    <asp:CommandField HeaderText="删除" ShowDeleteButton="True" DeleteText ="删除" />
  <asp:BoundField DataField="id" HeaderText="id" ReadOnly="True" />
                    
                </Columns>
            <HeaderStyle  CssClass="gvhead"  />
        </asp:GridView>
        <div style="text-align :right; padding :8px ">
                            <asp:Button ID="btLend" runat="server" Text="借出" onclick="btLend_Click" />
        </div> 
                            </td>
      </tr>
    </table>
            </asp:Panel>   

        
<!-- 一组内容模块结束 -->

        
        <asp:Panel ID="Panel2" runat="server" Visible ="false" Style="background-color:white;" >
       <div style ="text-align :center; font-size :large ; padding-bottom :10px; padding-top :10px; font-weight :bold ">
   设备借出清单
    </div>
      <div style ="text-align :right ;padding-right :8px;">
          <asp:Button ID="btnPrint" runat="server" Text="打印" OnClick="btnPrint_Click" /></div>  
    <div>借用凭证号： <asp:Label ID="lbIouid" runat ="server" ></asp:Label>
        &nbsp;借用人：<asp:Label ID="lbLenderid" runat="server"></asp:Label> &nbsp;<asp:Label ID="lbLender" runat="server"></asp:Label>
                
            &nbsp;办理人：<asp:Label ID="lbManaer" runat="server" /></div>      


    <asp:GridView ID="GridView2" runat="server" BorderWidth="1px" CssClass="gv" 
            Width="100%" AutoGenerateColumns="False">
            <RowStyle BorderWidth="1px" CssClass="gvrow" />
            <Columns>
                 <asp:BoundField DataField="lenddate" HeaderText="借用时间" ReadOnly="True" />
                 <asp:BoundField DataField="devicenumber" HeaderText="设备编号" ReadOnly="True" />
                 <asp:BoundField DataField="devicename" HeaderText="设备名称" ReadOnly="True" />
                 <asp:BoundField DataField="type" HeaderText="型号" ReadOnly="True" />
                 <asp:TemplateField HeaderText="借用数量">
                     <ItemTemplate>
                         <asp:Label ID="Label1" runat="server" Text='<%# Bind("lendnumber") %>'></asp:Label>
                          <asp:Label ID="Label4" runat="server" Text='<%# Bind("unit") %>'></asp:Label>
                     </ItemTemplate>
                 </asp:TemplateField>
                 <asp:BoundField DataField="plansreturndate" HeaderText="计划归还时间" ReadOnly="True" />
                  <asp:BoundField DataField="lendnote" HeaderText="借用说明" ReadOnly="True" />
                 </Columns>
            <HeaderStyle BackColor="White" BorderWidth="1px" CssClass="gvhead" />
        </asp:GridView>

                    <div style="text-align :center ;  "> <asp:Button ID="btnBack" runat="server" Text="返回" OnClick="btnBack_Click" />        </div> 

                        </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>
