<%@ Page Language="C#" MasterPageFile="~/home/main.Master" AutoEventWireup="true" CodeBehind="myResult.aspx.cs" Inherits="ZYDN.Web.home.myResult" Title="我要充值" %>
<%@ MasterType VirtualPath="~/home/main.Master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="rTop_1">
    </div>
    <div class="rTop_2">
        <div class="topOptionList" style="width: 100%;">
            <div style="width: 5px; float: left;">
            </div>
            <div class="optionCar">
                  <a href="myResult.aspx">我要充值</a>
            </div>
            <div class="optionCar_1">
                <a href="Int2money.aspx">积分兑换虚拟币</a>
            </div>
             <div class="optionCar_1">
                <a href="money2Int.aspx">虚拟币兑换积分</a>
            </div>
        </div>
        <div class="topOptionListBody">
        
        
        

<div>
<script language="javascript" type="text/javascript">

<%wjs(); %>
    function show()
    {
        var obj = document.getElementById(r1ID);
        if(obj.checked)
        {
            document.getElementById("uidShow1").style.display = "none";
            document.getElementById("uidShow2").style.display = "none";
        }
        else
        {
            document.getElementById("uidShow1").style.display = "block";
            document.getElementById("uidShow2").style.display = "block";
        }
       
    }
    function checkValue()
    {
        var money = document.getElementById(vMoneyID).value;
        if(money==null||money=="")
        {
            document.getElementById(megTxtID).innerHTML = "充值金额不能为空！";
            return false;
        }
        if(isNaN(money))
            {
                document.getElementById(megTxtID).innerHTML = "充值金额只能是数字！";
                return false;
            }
        if(parseInt(money)<1)
                {
                    document.getElementById(megTxtID).innerHTML = "充值金额不能小于1";
                    return false;
                }    
        var isChecked = document.getElementById(r2ID).checked;
        if(isChecked)
        {
            var uidObj = document.getElementById(rUidID).value;
            var uid2Obj = document.getElementById(rUid2ID).value;
            if(uidObj==null||uidObj=="")
            {
                document.getElementById(megTxtID).innerHTML = "请填写充入的帐号";
                    return false;
            }
            if(uidObj!=uid2Obj)
            {
                document.getElementById(megTxtID).innerHTML = "两次输入的帐号不一致";
                    return false;
            }
            var objAjax = new JAjax();
            var objResponse=new JHttpResponse();
            objResponse.write("uname",uidObj);  
            var out = objAjax.getText("post","?type=checkUname",objResponse,null);
            if(out!=""&&out!=null)
            {
                if(parseInt(out)>0)
                {
                    return true;
                }
                else
                {
                    document.getElementById(megTxtID).innerHTML = "该帐号不存在";
                    return false;
                }
            }
            else
            {
                document.getElementById(megTxtID).innerHTML = "该帐号不存在";
                return false;
            }
        }
    }
    
</script>
<form id="form1" runat="server">
    <table>
        <tr>
            
            <td colspan="2" style="text-align:center">
                <asp:Label ID="megTxt" runat="server" Text=""></asp:Label>
            </td>
        </tr>
        <tr>
            <td colspan="2" style="text-align:center">
                1元人民币兑换虚拟货币<asp:Label ID="toMoney" runat="server" Text=""></asp:Label>
            </td>
        </tr>
        <tr>
            <td>充入人民币：</td>
            <td>
                <asp:TextBox ID="vMoney" runat="server"></asp:TextBox></td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:RadioButton ID="Radio1" runat="server" Text="为自己充值" Checked="true" GroupName="radBtn" onclick="show()" />
                <asp:RadioButton ID="Radio2" runat="server" Text="充入其他帐号" GroupName="radBtn" onclick="show()" />
            </td>
        </tr>
        
        <tr id="uidShow1" style="display:none">
            <td>充入帐号：</td>
            <td>
                <asp:TextBox ID="rUid" runat="server"></asp:TextBox></td>
        </tr>
        <tr id="uidShow2" style="display:none">
            <td>确认帐号：</td>
            <td>
                <asp:TextBox ID="rUid2" runat="server"></asp:TextBox></td>
        </tr>
        <tr>
            <td colspan="2" style="text-align:center;">
                <asp:Button ID="ok" runat="server" Text="确定" OnClick="ok_Click" OnClientClick="return checkValue()" />
                <input id="Reset1" type="reset" value="取消" />
                </td>
        </tr>
    </table>
    </form>
</div>
 </div>
    </div>
    <div class="rTop_3">
    </div>
</asp:Content>
