<%@ Page Language="c#" Codebehind="Storage.aspx.cs" AutoEventWireup="true" Inherits="XpShop.Manage.Storage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <!--#include file="inc/head.inc"-->
    <title>Storage</title>
</head>
<body>
    <div class="container">
		<div class="sub_container">
		<div class="sub_container_title"><a href="<%=AdminDefault%>" target="_top">桌面</a><img src="images/admin_title.jpg" height=9px width=8px align="absmiddle" />入库记录</div>
		<div class="sub_container_content">
        <form id="Form1" method="post" runat="server">
		    <div class="frame">
		        <div class="frame_title"><asp:Label ID="lbTitle" Runat="server">管理库存</asp:Label></div>
		        <div class="frame_content">
                    <table class="tableBorder" cellspacing="1" cellpadding="1" width="98%" align="center" border="0" id="Table4">
                        <tr>
				            <td width="240">
					            <asp:Button ID="btnDelete" OnClick="btnDelete_Click" onselectedindexchanged="ddlSearchType_SelectedIndexChanged" Runat="server" Text="删除记录" CssClass="inputbtn"></asp:Button>
				            </td>
				            <td align="right">搜索：
				                <asp:DropDownList ID="ddlSearchType" onselectedindexchanged="ddlSearchType_SelectedIndexChanged" runat="server" AutoPostBack="true">
				                    <asp:ListItem Value="1">全部</asp:ListItem>
				                    <asp:ListItem Value="2">按库存警告</asp:ListItem>
				                    <asp:ListItem Value="3">按商品编码</asp:ListItem>
				                    <%--<asp:ListItem Value="4">按库存量范围</asp:ListItem>--%>
				                </asp:DropDownList>
				            </td>
				            <td align="left">
					            <asp:TextBox ID="txtKeyword" runat="server" Width="80px"></asp:TextBox>
					            <asp:TextBox ID="txtStorageFrom" runat="server" Width="30" onkeyup="value=value.replace(/[^\d]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"></asp:TextBox>&nbsp;
					            <asp:Label ID="lblTo" runat="server" Text="～"></asp:Label>&nbsp;
					            <asp:TextBox ID="txtStorageTo" runat="server" Width="30" onkeyup="value=value.replace(/[^\d]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"></asp:TextBox>
					            <asp:Button ID="btnSearch" OnClick="btnSearch_Click" runat="server" Text="GO" CssClass="inputbtn"></asp:Button>
			                </td>
			            </tr>
                        <tr>
                            <td class="forumRowHighlight" colspan="3">
                                <asp:datagrid id="dgStorageList" runat="server" AllowPaging="false" PageSize="20" PagerStyle-Mode="NumericPages"
							            AutoGenerateColumns="False" DataKeyField="StorageID" Width="100%" HorizontalAlign="Center"
							            HeaderStyle-CssClass="summary-title">
							            <HeaderStyle Font-Bold="True"></HeaderStyle>
							            <Columns>
								            <asp:TemplateColumn>
									            <ItemStyle HorizontalAlign="Left" ></ItemStyle>
									            <HeaderTemplate>
										            <asp:CheckBox id="chkAll" runat="server"></asp:CheckBox>
									            </HeaderTemplate>
									            <ItemTemplate>
										            <asp:CheckBox id="chkItem" runat="server"></asp:CheckBox>
									            </ItemTemplate>
								            </asp:TemplateColumn>
								            <asp:TemplateColumn HeaderText="商品编号">
									            <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
									            <ItemStyle HorizontalAlign="Left" Width="150px"></ItemStyle>
									            <ItemTemplate>
										            <%# DataBinder.Eval(Container.DataItem, "ProductNo") %>
									            </ItemTemplate>
								            </asp:TemplateColumn>
								            <asp:TemplateColumn HeaderText="商品名称">
									            <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
									            <ItemStyle HorizontalAlign="Left"></ItemStyle>
									            <ItemTemplate>
										            <%# GetGoodsName(DataBinder.Eval(Container.DataItem, "GoodsID").ToString())%>
									            </ItemTemplate>
								            </asp:TemplateColumn>
								            <asp:TemplateColumn HeaderText="出(入)库">
									            <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
									            <ItemStyle HorizontalAlign="Center" Width="50px"></ItemStyle>
									            <ItemTemplate>
										            <%# DataBinder.Eval(Container.DataItem, "Warehousing").ToString() == "1" ? "入库" : "出库"%>
									            </ItemTemplate>
								            </asp:TemplateColumn>
								            <asp:TemplateColumn HeaderText="数量">
									            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									            <ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle>
									            <ItemTemplate>
										            <%# DataBinder.Eval(Container.DataItem, "Amount")%>
									            </ItemTemplate>
								            </asp:TemplateColumn>
								            <asp:TemplateColumn HeaderText="库存量">
									            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									            <ItemStyle HorizontalAlign="Center" Width="40px"></ItemStyle>
									            <ItemTemplate>
										            <%# DataBinder.Eval(Container.DataItem, "Leave")%>
									            </ItemTemplate>
								            </asp:TemplateColumn>
								            <asp:TemplateColumn HeaderText="操作者">
									            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									            <ItemStyle HorizontalAlign="Center" Width="40px"></ItemStyle>
									            <ItemTemplate>
										            <%# GetAdminName(DataBinder.Eval(Container.DataItem, "MemberID").ToString())%>
									            </ItemTemplate>
								            </asp:TemplateColumn>
								            <asp:TemplateColumn HeaderText="操作时间">
									            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									            <ItemStyle HorizontalAlign="Center" Width="110px"></ItemStyle>
									            <ItemTemplate>
										            <%# DataBinder.Eval(Container.DataItem, "Times")%>
									            </ItemTemplate>
								            </asp:TemplateColumn>
								            <asp:TemplateColumn HeaderText="已警告">
									            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									            <ItemStyle HorizontalAlign="Center" Width="40px"></ItemStyle>
									            <ItemTemplate>
										            <%# IsStorageAlert(DataBinder.Eval(Container.DataItem, "ProductNo").ToString())%>
									            </ItemTemplate>
								            </asp:TemplateColumn>
								            <asp:TemplateColumn HeaderText="备注">
									            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									            <ItemStyle HorizontalAlign="Center"></ItemStyle>
									            <ItemTemplate>
										            <%# DataBinder.Eval(Container.DataItem, "Remark")%>
									            </ItemTemplate>
								            </asp:TemplateColumn>
								            <asp:ButtonColumn Text="&lt;div id=&quot;de&quot; onclick=&quot;javascript:return confirm('确认删除吗？')&quot;&gt;删除&lt;/div&gt;"
									            CommandName="Delete">
									            <ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle>
								            </asp:ButtonColumn>
							            </Columns>
							            <PagerStyle Mode="NumericPages"></PagerStyle>
						            </asp:datagrid>
						            <!-- 翻页-->
					            <table width="100%">
						            <tr>
							            <td><asp:hyperlink id="hplPrev" runat="server">上一页</asp:hyperlink>[&nbsp;
								            <asp:label id="lbPage" Runat="server"></asp:label>&nbsp;]
								            <asp:hyperlink id="hplNext" runat="server">下一页</asp:hyperlink></td>
							            <td align="right">共<asp:label id="lblTotalPage" runat="server"></asp:label>
								            当前纪录为<b><asp:label id="lblCurrentPage" runat="server"></asp:label></b> &nbsp;跳转第
								            <asp:textbox class="inputbg" id="txtGOPage" Runat="server" size="1" onkeyup="value=value.replace(/[^\d]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"></asp:textbox>页
								            <asp:button id="btnGo" onclick="btnGo_Click" Runat="server" Text="Go" CssClass="inputbtn"></asp:button></td>
						            </tr>
					            </table>
                            </td>
                        </tr>
                    </table>
		        </div>
	        </div>
        </form>
		</div>
		</div>
		</div>
</body>
</html>
