<%--<%@ Page Language="C#" %>--%>
<%@ Import Namespace="VA.Modules.JDingMember.Core.Business" %>
<%@ Import Namespace="VA.Modules.JDingMember.Core.Model" %>
<script type="text/javascript" src="/scripts/page/include_memberinfo.js"></script>

<%
    //搞不明白，为什么这段代码放到 html 代码的后面就不能正确赋值？
        
    MemberBasicInfo memberInfo = null;
    string memberID = Request.QueryString["memberid"];
    if (!String.IsNullOrEmpty(memberID))
    {                   
        Member member = new Member();        
        memberInfo = member.GetEntity(memberID);
        if (!String.IsNullOrEmpty(memberInfo.MemberID))
        {        

            ddlKeyType.SelectedIndex = 0; //卡号；
            txtKey.Text = memberInfo.CardNo;

            hfMemberName.Value = memberInfo.MemberName;
            hfMemberID.Value = memberInfo.MemberID;
            hfCardNo.Value = memberInfo.CardNo;
            hfMobileNo.Value = memberInfo.MobileNo;

            lblMemberName.Text = memberInfo.MemberName;
            lblCardNo.Text = memberInfo.CardNo;
            lblMobileNo.Text = memberInfo.MobileNo;
            lblAccountBalance.Text = memberInfo.Account_Balance.ToString("F2");
            
            if (!new VA.Modules.JDingMember.Core.Business.MemberAccountGuard().CheckAccountBalance(memberID, memberInfo.Account_Balance, memberInfo.AccountBalance_Verification_Code, base.SystemConfig))
            {
                lblAccountBalance.Text += "<font color='red'>(异常)</font>";
            }                
            
            try
            {
                lblLevelName.Text = new VA.Modules.JDingMember.Core.Business.Basic.MemberLevelDict().GetEntity(memberInfo.Level_Code).Level_Name;
            }
            catch
            {
                lblLevelName.Text = "读取失败……";
            }
            lblCreateDate.Text = memberInfo.Create_Date.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture);
            lblAccountPoints.Text = memberInfo.Account_Points.ToString();
            if (!new VA.Modules.JDingMember.Core.Business.MemberAccountGuard().CheckAccountPoints(memberID, memberInfo.Account_Points, memberInfo.AccountPoints_Verification_Code, base.SystemConfig))
            {
                lblAccountPoints.Text += "<font color='red'>(异常)</font>";
            }

            lblStatus.Text = VA.Modules.JDingMember.Core.Enums.MemberStatusConverter.Convert_Value_ToText(memberInfo.Status);                         
        }                                   
    }      
   
%>
    
<table id="tbKeyEnter" cellspacing="0" cellpadding="3" class="editTable">
<tr>
<td>        
    
    <asp:DropDownList ID="ddlKeyType" Runat="server" Width="104px" >
    <asp:ListItem Value="cardno" Selected="True">会员卡号</asp:ListItem>
    <asp:ListItem Value="mobileno">手机号</asp:ListItem>    
    </asp:DropDownList>
    <VACTL:TextBox ID="txtKey" Runat="server"
            EnableViewState="False"
            CssClass="input"
            Width="100px"
            />
    <asp:HiddenField runat="server" id="hfMemberName" />
    <asp:HiddenField runat="server" id="hfMemberID" />
    <asp:HiddenField runat="server" id="hfCardNo" />
    <asp:HiddenField runat="server" id="hfMobileNo" />
    <asp:HiddenField runat="server" id="hfLevelCode" />
    <%--<input type="button" id="btnQueryMemberInfo" class="simpleBtn" onclick="tryLoadMemberInfo()" value="确定" />     --%>
    <input type="button" id="btnBrowseMembers" class="simpleBtn" onclick="browseMembers('', '')" value="浏览" />    
    姓名：<asp:Label ID="lblMemberName" runat="server"></asp:Label>
    余额：<asp:Label ID="lblAccountBalance" runat="server"></asp:Label>
    积分：<asp:Label ID="lblAccountPoints" runat="server"></asp:Label>

    <!--如果是连锁会员，则不显示详情连接-->
    <span id="spanMemberDetail"><a href="javascript:viewMemberDetail()">[会员详情]</a></span>

</td>
</tr>
</table>

<table id="tbMemberInfo" cellspacing="0" cellpadding="3" class="editTable" style="margin-top:-1px;">
<tr style="display:none;">
<td class="th">会员信息：</td>
<td colspan="5">
  
   手机号：<asp:Label ID="lblMobileNo" runat="server"></asp:Label>
</td>
</tr>
<tr style="display:none;">
<td class="th">会员卡号：</td>
<td style="width:120px;">
    <asp:Label ID="lblCardNo" runat="server"></asp:Label>
</td>
<td class="th">会员级别：</td>
<td>
    <asp:Label ID="lblLevelName" runat="server"></asp:Label>
</td>
<td class="th">办卡日期：</td>
<td>
    <asp:Label ID="lblCreateDate" runat="server"></asp:Label>
</td>
</tr>
<tr style="display:none;">
<td class="th">会员积分：</td>
<td>
    
</td>
<td class="th">会员状态：</td>
<td>
    <asp:Label ID="lblStatus" runat="server"></asp:Label>
<td class="th">会员详情：</td>
<td>
    
</td>
</tr>
</table>

<!--会员列表窗口-->
<div id="winMemberList" style="display:none;"></div> 
<asp:HiddenField runat="server" id="hfGetMemberInfoPageURL" value="/modules/cyt/datasrc/get_memberinfo_json.aspx" />
<asp:HiddenField runat="server" id="hfGetMemberListPageURL" value="/modules/cyt/datasrc/get_memberlist.aspx" />

