<%@ page language="C#" autoeventwireup="true" inherits="V5Shop.Member.User_UserScore_Manage, V5Shop.Member" enableviewstatemac="false" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register Assembly="V5Shop.Control" Namespace="V5Shop.Control" TagPrefix="cc1" %>
<!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">
    <title>威博单用户系统</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <link href="css/css.css" rel="stylesheet" type="text/css" />
    <link href="css/membercss.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript" src="Js/Common.js"></script>
    <script type="text/javascript" language="javascript">
    //积分对换值变更时
    function txtScore_OnChange(v, intLock)
    {
        var thisText = getobj(v + "_ctl01");
        var thisValue = getobj(v + "_hid01");
        var thisPrecent = getobj('lblUseSorcePrecent').innerText;
        var thisCanUseScore = getobj('lblCanUseScore').innerText;
        var thisPrice = getobj('txtPrice');

        var newPrice = 0.0;
        
        if(thisText.value * 1 > thisCanUseScore * 1)
        {
            thisPrice.value = "";
            alert("对不起， 您可用积分不足!");
            thisText.value = 0;
            thisValue.value = 0;
            thisPrice.value = "";

            return false;
        }
        else
        {
            newPrice = thisText.value / thisPrecent;
            newPrice = parseInt(newPrice * 100, 0)/100;
            thisPrice.value = newPrice;
        }
        return true;
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <table border="0" cellpadding="5" cellspacing="0" class="membertable">
                <tr>
                    <td height="20" colspan="2" background="../images/user/tbj10.gif" bgcolor="#65697A">
                        <font color="FFFFFF"><strong>
                            <asp:Label ID="Label15" runat="server">- 我的积分 -</asp:Label>
                        </strong></font>
                    </td>
                </tr>
                <tr>
                    <td height="20" colspan="2" align="center" bgcolor="#FFFFFF">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td width="20%" align="right" bgcolor="#FAFAFA" style="height: 30px">
                        <asp:Label ID="Label1" runat="server" Text="您的积分："></asp:Label></td>
                    <td width="80%" align="left" bgcolor="#FAFAFA" style="height: 30px">
                        &nbsp;
                        <asp:Label ID="lblScore" runat="server"></asp:Label></td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#FFFFFF" style="height: 30px">
                        <asp:Label ID="Label2" runat="server" Text="您的会员等级："></asp:Label></td>
                    <td align="left" bgcolor="#FFFFFF" style="height: 30px">
                        &nbsp;
                        <asp:Label ID="lblGroupName" runat="server"></asp:Label></td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#FAFAFA" style="height: 30px">
                        <asp:Label ID="Label3" runat="server" Text="您的等级折扣："></asp:Label></td>
                    <td align="left" bgcolor="#FAFAFA" style="height: 30px">
                        &nbsp;
                        <asp:Label ID="lblDiscount" runat="server">100</asp:Label><asp:Label ID="Label10" runat="server">%</asp:Label></td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#FFFFFF" style="height: 30px">
                        <asp:Label ID="Label4" runat="server" Text="积分转换比例："></asp:Label></td>
                    <td align="left" bgcolor="#FFFFFF" style="height: 30px">
                        &nbsp;
                        <asp:Label ID="lblUseSorcePrecent" runat="server" Text="0"></asp:Label>
                        <asp:Label ID="Label12" runat="server">点积分兑换1元人民币。</asp:Label></td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#fafafa" style="height: 30px">
                        <asp:Label ID="Label14" runat="server" Text="可冻结积分：" /></td>
                    <td align="left" bgcolor="#fafafa" style="height: 30px">
                        &nbsp;
                        <asp:Label ID="lblFrozenScore" runat="server">0</asp:Label></td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#FAFAFA" style="height: 30px">
                        <asp:Label ID="Label5" runat="server" Text="可使用积分："></asp:Label></td>
                    <td align="left" bgcolor="#FAFAFA" style="height: 30px">
                        &nbsp;
                        <asp:Label ID="lblCanUseScore" runat="server">0</asp:Label></td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#FFFFFF" style="height: 30px">
                        <asp:Label ID="Label6" runat="server" Text="已消费积分："></asp:Label></td>
                    <td align="left" bgcolor="#FFFFFF" style="vertical-align: middle; height: 30px; text-align: left">
                        &nbsp;
                        <asp:Label ID="lblScoreUsed" runat="server">0</asp:Label></td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#FAFAFA" style="height: 30px">
                    </td>
                    <td align="left" bgcolor="#FAFAFA" style="vertical-align: middle; height: 30px; text-align: left">
                        &nbsp;<asp:Label ID="Label13" runat="server" ForeColor="Green" Width="488px" Text="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;提示：如果您将积分转换为预存款，您的会员等级也将会随之降低，您也将失去原有的优惠折扣。" /></td>
                </tr>
                <tr>
                    <td height="20" colspan="2" background="../images/user/tbj10.gif" bgcolor="#65697A">
                        <font color="FFFFFF"><strong>
                            <asp:Label ID="Label11" runat="server">- 积分兑换 -</asp:Label>
                        </strong></font>
                    </td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#FAFAFA" style="height: 30px">
                        <asp:Label ID="Label7" runat="server">请输入要转换的积分数值：</asp:Label></td>
                    <td align="left" bgcolor="#FAFAFA" style="vertical-align: middle; height: 30px; text-align: left">
                        &nbsp;
                        <cc1:NumberBox ID="txtScore" runat="server" ClientScriptOnChange="txtScore_OnChange('txtScore', 0)" Width="60px" />
                    </td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#FFFFFF" style="height: 30px">
                        <asp:Label ID="Label8" runat="server">兑换后的预存款为：</asp:Label></td>
                    <td align="left" bgcolor="#FFFFFF" style="vertical-align: middle; height: 30px; text-align: left">
                        &nbsp;&nbsp;<input id="txtPrice" type="text" readonly="readOnly" class="input2" style="width: 60px" />
                        <asp:Button ID="btnChange" runat="server" Text="我要兑换" CssClass="input" OnClientClick="return txtScore_OnChange('txtScore', 1);" OnClick="btnChange_Click" /></td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#FAFAFA" colspan="2" style="height: 1px; text-align: center">
                        <strong></strong>
                    </td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#FAFAFA" style="height: 30px">
                        <asp:Label ID="Label9" runat="server" Text="积分操作记录"></asp:Label></td>
                    <td align="left" bgcolor="#FAFAFA" style="height: 30px">
                        &nbsp;
                        <cc1:V5ShopGridView ID="GridViewShow" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BorderWidth="0px" CacheName="TableCache_UserScoreBuyLog" CssClass="datalist" EmptyDataText="没有任何可用信息！" GridLines="None" HeaderStyle-ForeColor="#000000" PageSize="5" TableName="" Width="100%">
                            <PagerSettings Mode="NumericFirstLast" />
                            <Columns>
                                <asp:BoundField DataField="ID" HeaderText="编号" SortExpression="ID" />
                                <asp:BoundField DataField="Description" HeaderText="描述" SortExpression="Description" />
                                <asp:BoundField DataField="OperateType" HeaderText="类别" SortExpression="OperateType" />
                                <asp:BoundField DataField="Sum" HeaderText="积分" SortExpression="Sum" />
                                <asp:BoundField DataField="Date" HeaderText="操作日期" SortExpression="Date" />
                            </Columns>
                            <HeaderStyle CssClass="category" ForeColor="Black" />
                        </cc1:V5ShopGridView>
                    </td>
                </tr>
                <tr>
                    <td height="30" colspan="2" align="center" bgcolor="#FFFFFF">
                    </td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>
