<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PointsExchange.aspx.cs"
    Inherits="SWTraining.Finance.PointsExchange" Title="财务管理-积分兑换" %>

<!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 id="linkStyle" runat="server" href="../Themes/Blue/css.css" rel="stylesheet"
        type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div class="divpanel" runat="server">
        <table class="table" cellspacing="0">
            <tr>
                <th>
                    提示信息
                </th>
            </tr>
            <tr>
                <td>
                    学员：<asp:Label ID="labStudentName" runat="server"></asp:Label>
                    &nbsp;拥有积分：<asp:Label ID="labPoints" runat="server" ForeColor="Red"></asp:Label>
                    </span>
                </td>
            </tr>
        </table>
    </div>
    <div class="tool_Search">
        商品：<asp:DropDownList ID="ddlCommodity" runat="server" DataTextField="CommodityName"
            DataValueField="CommodityID" AutoPostBack="True" OnSelectedIndexChanged="ddlCommodity_SelectedIndexChanged">
        </asp:DropDownList>
        数量：<asp:TextBox ID="tbxAmount" runat="server" Width="44px"></asp:TextBox>
        <asp:Label ID="labUnitName" runat="server"></asp:Label>
        仓库：<asp:DropDownList ID="ddlStoreroom" runat="server" DataTextField="StoreroomName"
            DataValueField="StoreroomID">
        </asp:DropDownList>
        <label class="lab_buttom">
<asp:Button ID="btnPost" runat="server" Text="兑换" OnClick="btnPost_Click" />
</label>
    </div>
    <div class="both">
    </div>
    <div class="divpanel">
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" CssClass="gridview"
            OnRowDeleting="GridView1_RowDeleting" DataKeyNames="PointsExchangeID" OnRowCancelingEdit="GridView1_RowCancelingEdit"
            OnRowDataBound="GridView1_RowDataBound" OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating">
            <Columns>
                <asp:BoundField DataField="CommodityID" HeaderText="编号" ReadOnly="True" />
                <asp:BoundField DataField="CommodityName" HeaderText="商品" ReadOnly="True" />
                <asp:TemplateField HeaderText="积分">
                    <ItemTemplate>
                        <asp:Label ID="labPoints" runat="server" Text='<%# Bind("Points") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="数量">
                    <ItemTemplate>
                        <asp:Label ID="labAmount" runat="server" Text='<%# Bind("Amount") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="tbxAmount" runat="server" Width="40px" Text='<%# Bind("Amount") %>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="合计(积分)">
                    <ItemTemplate>
                        <asp:Label ID="labTotalPoints" runat="server" Text='<%# (int)Eval("Points") * (int)Eval("Amount") %>'></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="日期" ReadOnly="True" />
                <asp:BoundField DataField="TrueName" HeaderText="经办人" ReadOnly="True" />
                <asp:CommandField HeaderText="编辑" EditText="编辑" CancelText="取消" UpdateText="更新" ShowEditButton="true" />
                <asp:TemplateField HeaderText="删除">
                    <ItemTemplate>
                        <asp:LinkButton ID="lbnDelete" runat="server" Text="删除" CommandName="Delete" OnClientClick="return confirm('你是否确定删除这条记录？');"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
    <div class="divpanel">
        <asp:Literal ID="litPagerButton" runat="server"></asp:Literal>
    </div>
    <div class="backpanel">
        <label class="lab_buttom">
<input id="Button1" causesvalidation="false" type="button" runat="server" onclick="back()"
            value="返回" />
</label>
    </div>
    </form>
</body>
</html>
