<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OutBatchDetails.aspx.cs"
    Inherits="SWTraining.Commodity.OutBatchDetails" Title="仓库管理-商品退货查询" %>

<%@ Import Namespace="SWTraining" %>
<!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 runat="server">
    <link id="linkStyle" runat="server" href="../Themes/Orange/css.css" rel="stylesheet"
        type="text/css" />

    <script language="javascript" type="text/javascript">
// <!CDATA[

        function CreateSubMenu(rowindex, colspan) {

            cell = document.createElement("td");
            cell.attributes.getNamedItem("colspan").nodeValue = colspan;
            text = CreateHtmlNode("<div>", divItems.innerHTML);
            cell.appendChild(text);
            GridView1.insertRow(rowindex + 1);
            GridView1.rows.item(rowindex + 1).appendChild(cell);
        }


        function CreateHtmlNode(tag, text) {
            var n = document.createElement(tag);
            if (text) n.innerHTML = text;
            return n;
        } 

// ]]>
    </script>

    <script type="text/javascript"> 
<!--

        function Focus() {
            if (!document.getElementById("tbxBarcode").disabled) {
                document.getElementById("tbxBarcode").focus();
            }
        }

//--> 
    </script>

</head>
<body onload="Focus();">
    <form id="form1" runat="server">
    <div id="sw_content">
        <div class="divpanel">
            条形码：<asp:TextBox ID="tbxBarcode" runat="server" Width="110px"></asp:TextBox>
            &nbsp;分类：<asp:DropDownList ID="ddlCommodityType" runat="server" DataTextField="CommodityTypeName"
                DataValueField="CommodityTypeID" AutoPostBack="True" OnSelectedIndexChanged="ddlCommodityType_SelectedIndexChanged">
            </asp:DropDownList>
            产品：<asp:DropDownList ID="ddlCommodity" runat="server" DataTextField="CommodityName"
                DataValueField="CommodityID">
            </asp:DropDownList>
            日期：<asp:TextBox ID="tbxStartDate" runat="server" Width="79px"></asp:TextBox>
            -<asp:TextBox ID="tbxEndDate" runat="server" Width="79px"></asp:TextBox>
            <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="查询" />
            <input id="btnBatchID" type="button" value="按单号管理" onclick="location='OutBatch.aspx'" /></div>
        <div class="divpanel">
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="BatchItemID"
                CssClass="gridview" Width="100%" OnRowDataBound="GridView1_RowDataBound">
                <Columns>
                    <asp:BoundField DataField="BatchID" HeaderText="单号" ReadOnly="True" />
                    <asp:BoundField DataField="CommodityName" HeaderText="商品" ReadOnly="True" />
                    <asp:TemplateField HeaderText="进价">
                        <ItemTemplate>
                            <asp:Label ID="labPurchasePrice" runat="server" Text='<%# Bind("PurchasePrice","{0:c2}") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="数量">
                        <ItemTemplate>
                            <asp:Label ID="labAmount" runat="server" Text='<%# Bind("Amount") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="合计">
                        <ItemTemplate>
                            <asp:Label ID="labTotalPrice" runat="server" Text='<%# Bind("TotalPrice","{0:c2}") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="仓库">
                        <ItemTemplate>
                            <asp:Label ID="labStoreroomName" runat="server" Text='<%# Bind("StoreroomName") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="DateAndTime" HeaderText="时间" SortExpression="DateAndTime"
                        HtmlEncode="False" />
                    <asp:BoundField DataField="ProviderName" HeaderText="供应商" SortExpression="ProviderName" />
                    <asp:BoundField DataField="Remark" HeaderText="备注" SortExpression="Remark" />
                    <asp:TemplateField HeaderText="编辑">
                        <ItemTemplate>
                            <asp:HyperLink ID="hlkEdit" runat="server" Text="编辑" NavigateUrl='<%# string.Format("PostInBatch.aspx?BatchID={0}&GetURL={1}",Eval("BatchID"),swq.Web.PathAndQuery()) %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
        <div class="divpanel">
            <asp:Literal ID="litPagerButton" runat="server"></asp:Literal>
        </div>
    </div>
    </form>
</body>
</html>
