<%@ Page Language="C#" MasterPageFile="~/Admin/MainPage.Master" AutoEventWireup="true"
    Codebehind="MemberDegreeAdd.aspx.cs" Inherits="PPFOR.Admin.UserInfo.MemberDegreeAdd"
    Title="会员等级添加" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PPFOR_mainContent" runat="server">
<script src="../JS/gridview.js" type="text/javascript"></script>  
<script type="text/javascript">
     function show(needPoints){
        var targetTR = document.getElementById("displayNeedNumber");
        if(targetTR!=null){
            targetTR.style.display = needPoints.toLowerCase()=='true' ?  '' : 'none';
        }
    }  
</script>
<form action="MemberDegreeAdd.aspx" method="post" id="form1" runat="server">     
   <table width="100%" border="0" cellpadding="0" cellspacing="0" class="fortable">
    <thead>        
        <tr>
          <td colspan="2" align="center">添加会员等级</td>
        </tr>
    </thead>        
    <tr>
        <td style="width: 15%" align="right">会员等级名称：</td>
        <td>
            <asp:TextBox ID="PPFOR_memberDegreeName" runat="server" MaxLength="32"></asp:TextBox>  
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" SetFocusOnError="true" ValidationExpression="^[^<>\x22]{2,32}$" Display="Dynamic" ControlToValidate="PPFOR_memberDegreeName"><br />会员等级名称长度必须在2至32个字符之间，且不能包含以下字符之一：<，>，"</asp:RegularExpressionValidator>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" SetFocusOnError="true" Display="Dynamic" ControlToValidate="PPFOR_memberDegreeName"><br />会员等级名称不能为空</asp:RequiredFieldValidator>         
        </td>
    </tr>
    <tr>
        <td align="right">优惠折扣率：</td>
        <td>
            <asp:TextBox ID="PPFOR_memberDegreePercentage" runat="server" Text="100" MaxLength="3"></asp:TextBox>%&nbsp;如果输入80，表示该会员等级以销售价80%的价格购买
            <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="PPFOR_memberDegreePercentage" MinimumValue="1" MaximumValue="100" Display="Dynamic" Type="Integer" SetFocusOnError="true"><br />优惠折扣率值必须在1至100之间，为空值则默认为100</asp:RangeValidator>
        </td>
    </tr>
    <tr>
        <td align="right">是否默认会员等级：</td>
        <td>
            <asp:CheckBox runat="server" ID="PPFOR_memberDegreeIsDefault" Checked="false" />设为默认会员等级
        </td>
    </tr>
    <tr>
        <td align="right">等级类型：</td>
        <td>
            <asp:RadioButtonList runat="server" CssClass="innertable" ID="PPFOR_memberDegreeTypeList" RepeatDirection="Horizontal">
            </asp:RadioButtonList>
        </td>
    </tr>
    <tr id="displayNeedNumber">
        <td align="right">所需积分：</td>
        <td>
            <asp:TextBox ID="PPFOR_memberDegreeNeedPoints" runat="server" MaxLength="10"></asp:TextBox>会员积分达到此标准后会自动升级为当前等级
            <asp:RangeValidator ID="RangeValidator2" runat="server" ControlToValidate="PPFOR_memberDegreeNeedPoints" MinimumValue="0" MaximumValue="2147483647" Type="Integer" Display="Dynamic" SetFocusOnError="true"><br />所需积分值必须是大于或等于0的整数，为空值默认为0</asp:RangeValidator>     
        </td>
    </tr>
    <tr id="memberFieldsArea">
        <td align="right">选择自定义注册项：</td>
        <td style="width:99%">
            <asp:GridView ID="PPFOR_showMemberFieldList" runat="server" CssClass="forgridview" OnRowDataBound="PPFOR_gridViewRowDataBound" AllowPaging="false" AutoGenerateColumns="False"  DataKeyNames="Id"  Width="100%" CellPadding="0" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="0px" EmptyDataText="还没有添加注册项">
           <Columns>                
             <asp:TemplateField ShowHeader="False" HeaderText="" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="15px">
                 <ItemStyle Wrap="False" HorizontalAlign="Center" />
                 <HeaderTemplate>
                     <asp:CheckBox ID="PPFOR_selectMemberField" runat="server"></asp:CheckBox>
                 </HeaderTemplate>
                 <ItemTemplate>
                     <asp:CheckBox ID="PPFOR_selectMemberField" runat="server"></asp:CheckBox>
                 </ItemTemplate>
             </asp:TemplateField>
             <asp:BoundField HeaderText="ID" DataField="Id" HeaderStyle-Font-Bold="false"/>
             <asp:BoundField HeaderText="注册项名" DataField="FieldName" HeaderStyle-Font-Bold="false"/>
             <asp:TemplateField HeaderText="注册项类型" HeaderStyle-Font-Bold="false">
                <ItemTemplate><%# PPFOR_getMemberFieldTypeName(Eval("FieldType"))%></ItemTemplate>
             </asp:TemplateField>    
            </Columns>
             <FooterStyle BackColor="#990000" ForeColor="White" /> 
             <RowStyle Wrap="False" HorizontalAlign="Center" Font-Bold="false" BackColor="#ffffff"/> 
             <HeaderStyle HorizontalAlign="Center" BackColor="#F5F5F5" Font-Bold="false" ForeColor="#000000" />
             <AlternatingRowStyle BackColor="#F5F5F5" />
        </asp:GridView>
        </td>
    </tr>
    <tr>
        <td align="center" colspan="2" style="display:none">
            <asp:Button ID="PPFOR_addMemberDegree" CssClass="inputbutton" runat="server" Text="添加" Width="100px" OnClick="PPFOR_addMemberDegreeClick" />
            <input name="reset" id="reset1" type="reset" class="inputbutton" onmouseover="this.className='inputbutton_hover'" onmouseout="this.className='inputbutton'" value="重置" />
            <script type="text/javascript">                    
                addButtonArray("<%= PPFOR_addMemberDegree.ClientID %>","reset1");                    
            </script> 
        </td>
    </tr>
   </table>
</form>
</asp:Content>
