<%@ page language="C#" enableeventvalidation="false" masterpagefile="MyShopMasterPage.master" autoeventwireup="true" inherits="Member_Shop_ReceiveAddress, mallz" title="收货地址设置" enableviewstate="true" validaterequest="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 <script  type="text/javascript">
    var ReceiveAddress = new Array();
   	function selectDeliver(obj){
   	    var url ="Shop_ReceiveAddress.aspx?Action=modify&aid="+obj;
		window.location.href=url;
	}
	
	function deleteDeliver(obj){
	  var url="Shop_ReceiveAddress.aspx?Action=delete&aid="+obj;
	  window.location.href=url;
	}
 </script>
 
 <div class="pageTitle"><span>收货地址设置</span></div>

 <div class="tips_onclick"><p>您好，在这里可以预设您的收货地址，最多<asp:Literal runat="server" ID="Addrnum" Text="3" />个。</p></div>
 
 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"   CssClass="tableHead" DataKeyNames="AddressID" OnRowDeleting="GridView1_RowDeleting" >
    <Columns>
        <asp:BoundField DataField="username" HeaderText="姓名" />
        <asp:TemplateField HeaderText="所在地">
            <ItemTemplate>
                <asp:Literal ID="Province" Text='<%#Eval("Province") %>' runat="server" />
                <asp:Literal ID="City" Text='<%#Eval("City") %>' runat="server" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="Address" HeaderText="详细地址" />
        <asp:BoundField DataField="ConectPhone" HeaderText="电话" />
        <asp:BoundField DataField="MobilePhone" HeaderText="手机" />
        <asp:TemplateField HeaderText="邮政编码">
            <ItemTemplate>
                <asp:Label ID="lbzipCode" runat="server" Text='<%# Eval("ZipCode") %>'></asp:Label>
                <asp:HiddenField ID="hdAddressID" runat="server" Value='<%# Eval("AddressID") %>' />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="Email" HeaderText="Email地址" />
        <asp:TemplateField HeaderText="操作">
            <ItemTemplate>
                <asp:HyperLink runat="server" ID="ed" Text="修改" NavigateUrl='<%# "?Action=modify&aid=" + Eval("AddressID") %>' />
                <asp:LinkButton runat="server" ID="del" Text="删除" CommandName="Delete" OnClientClick="return confirm('确定删除吗？')" CausesValidation="false" />
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>  
    <EmptyDataTemplate>
    <table class="tableHeader" style="width:98%"><th>姓名</th><th>所在地</th><th>详细地址</th><th>电话</th><th>手机</th><th>邮政编码</th><th>Email</th><th>操作</th>
    <tr><td colspan="8">暂无收货地址！</td></tr>
    </table>
    </EmptyDataTemplate> 
 </asp:GridView>
 
 <div class="clear" style="height:5px; overflow:hidden;"></div>
     <table class="ShopOrderStyle">
         <caption id="deliverName">收货详细地址信息</caption>
         <tr>
             <td class="OrderTitle">联 系 人：</td>
             <td>
               <asp:TextBox ID="TxtUserName" runat="server" CausesValidation="True"  Height="16px" MaxLength="50"  />
               <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="不能为空" ControlToValidate="TxtUserName"/>
                 <asp:HiddenField ID="editAddressID" runat="server" />
             </td>
         </tr>
          <tr>
             <td class="OrderTitle">所 在 地：</td>
             <td>
                <MZ:ProvinceCity ID="ProvinceCity1" runat="server" EnableViewState="true"/>
             </td>
         </tr>
           <tr class="div_row">
             <td class="OrderTitle">详细地址：</td>
             <td>
               <asp:TextBox ID="TxtAddress" runat="server" Width="350px" MaxLength="50" />
               <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TxtAddress" ErrorMessage="不能为空"/>      
             </td>
         </tr>  
             <tr class="div_row">
                 <td class="OrderTitle">邮箱地址：</td>
                 <td>
                     <asp:TextBox ID="TxtEmail" runat="server"  Height="16px" Width="150px" MaxLength="50" />
                     <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="TxtEmail"
                         ErrorMessage="Email地址不正确" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" Display="Dynamic"/></td>
             </tr>
          <tr class="div_row">
             <td class="OrderTitle">邮政编码：</td>
             <td>
               <asp:TextBox ID="TxtZipCode" runat="server" Width="50px" MaxLength="6" />
               <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="TxtZipCode"
                    ErrorMessage="不能为空" Display="Dynamic"/>
               <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="TxtZipCode"
                    ErrorMessage="邮政编码格式不对" ValidationExpression="\d{6}" Display="Dynamic"/>
             </td>
         </tr>
          <tr class="div_row">
             <td class="OrderTitle">电话号码：</td>
             <td><asp:TextBox ID="TxtPhone" runat="server" Height="16px"  />
                格式：(区号-电话-分机)如：020-38876850 
             </td>
         </tr>
          <tr class="div_row">
             <td class="OrderTitle" style="height: 26px">手机号码：</td>
             <td style="height: 26px">
               <asp:TextBox ID="TxtMoblephone" runat="server" Width="90px"  Height="16px"  MaxLength="11" />
               <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TxtMoblephone"
                    ErrorMessage="手机号码不对" ValidationExpression="\d{11}" Display="Dynamic"/>
             </td>
          </tr>
          <tr>
              <td colspan="2" style="text-align:center;">
                 <asp:Button ID="ButAddress" runat="server"  OnClick="ButAddress_Click" Text="新 增" />
                 <asp:Button ID="ButModify" runat="server"  OnClick="ButModifyAddress_Click" Text="修 改" Visible="false" />
              </td>
          </tr>   
       </table>
</asp:Content>

