<%@ page language="C#" validaterequest="false" masterpagefile="../ShopMasterPage/MyShopMasterPage.master" autoeventwireup="true" inherits="Shop_member_Shop_UserInfoList, HoWaveVGO" title="商城用户资料设置" enableEventValidation="false" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"/>
<script type="text/javascript">
function ShowProvinceCity()
{
 document.getElementById("display_province_city").style.display=""; 
}
</script>
 <div class="pageTitle">个人资料设置</div>
 <asp:FormView ID="FormView1" runat="server" DefaultMode="Edit" DataSourceID="ObjectDataSource1"  Width="100%"  OnDataBound="FormView1_DataBound">
   <EditItemTemplate>
     <asp:HiddenField ID="UserID" Value='<%# Bind("UserID") %>' runat="server" />
     <table class="ShopOrderStyle">
     <caption>用户信息</caption>
         <tr>
             <td class="OrderTitle">用户帐号：</td>
             <td><asp:Literal ID="UserName" runat="server"  Text='<%#Request.Cookies["Howave_UserName"].Value %>'/></td>
         </tr>        
         <tr>
             <td class="OrderTitle">所在地：</td>
             <td>
                 <asp:Literal ID="L_Province_City" runat="server"  Text='<%# Eval("Province")+"省"+Eval("City")+"市" %>' /><a id="ShowProvinceCity" runat="server"><span style="CURSOR: pointer; color:#ff0000">[更改]</span></a>
                 <div style="display:none;" id="display_province_city">
                     <div style="float:left;" >
                        <asp:DropDownList ID="Province" runat="server" AutoPostBack="True" DataSourceID="ObjectDataSource2" DataTextField="Province" DataValueField="Province" AppendDataBoundItems="True" Width="80px" >
                            <asp:ListItem Selected="True" Value="" Text="所在地"/>
                        </asp:DropDownList>省
                      </div>
                      <div style="float:left;">             
                        <asp:UpdatePanel    ID="UpdatePanel1" runat="server">
                            <ContentTemplate>
                            <asp:DropDownList id="City" runat="server" Width="80px" DataSourceID="ObjectDataSource3" DataValueField="City" DataTextField="City" __designer:wfdid="w6"></asp:DropDownList>市 
                            </ContentTemplate>
                                                         <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="Province" EventName="SelectedIndexChanged"></asp:AsyncPostBackTrigger>
                            </Triggers>
                        </asp:UpdatePanel>
                         <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" SelectMethod="GetAllProvince"   TypeName="Shop_City" />  
                         <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" SelectMethod="GetCity"   TypeName="Shop_City" >
                              <SelectParameters>
                                  <asp:ControlParameter ControlID="Province" DefaultValue=" " Name="Province"  PropertyName="SelectedValue" Type="String" />
                              </SelectParameters>
                         </asp:ObjectDataSource>  
                     </div>                   
                 </div>
              </td>
         </tr>
         <tr>
             <td class="OrderTitle">真实姓名：</td>
             <td><asp:TextBox ID="TxtU_TrueName" runat="server" Width="132px" Text='<%# Bind("TrueName") %>' MaxLength="50" /><asp:label ID="Identify_truename_tips" runat="server" Text='<% # Eval("TrueName")%>' Visible="false"/></td>
         </tr>
         <tr>
             <td class="OrderTitle">详细地址：</td>
             <td><asp:TextBox ID="TxtU_Address" runat="server" Width="300px" Height="16px" Text='<%# Bind("Address") %>' MaxLength="50"/></td>
         </tr>
         <tr>
             <td class="OrderTitle">邮政编码：</td>
             <td><asp:TextBox ID="ZipCode" runat="server" Width="100px" Height="16px" Text='<%# Bind("ZipCode") %>' MaxLength="6"/>
                 <asp:RegularExpressionValidator ID="Rev1" runat="server"  ErrorMessage="邮编格式不正确" ValidationExpression="\d{6}"
                  ControlToValidate="ZipCode" Display="Dynamic"/>
             </td>
         </tr>
         <tr>
             <td class="OrderTitle">交易联系方式：</td>
             <td>
                  <asp:RadioButtonList ID="RadioU_ContactType" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                        <asp:ListItem Selected="True" Value="0">固话</asp:ListItem>
                        <asp:ListItem Value="1">手机</asp:ListItem>                  
                    </asp:RadioButtonList>
             </td>
         </tr>
         <tr>
             <td class="OrderTitle">手机号码：</td>
             <td>
               <asp:TextBox ID="TxtU_MobilePhone" runat="server" Width="132px" Height="16px" Text='<%# Bind("MobilePhone") %>' MaxLength="11"/>
             &nbsp;&nbsp;
              (<asp:HyperLink ID="HyperLink2" runat="server">点击这里进行绑定</asp:HyperLink>)
              <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"  ErrorMessage="手机格式不正确" ValidationExpression="\d{11}"
                  ControlToValidate="TxtU_MobilePhone" Display="Dynamic"/>
             </td>
         </tr>
         <tr>
             <td class="OrderTitle">固定电话：</td>
             <td><asp:TextBox ID="TxtU_HomePhone" runat="server" Width="132px" Height="16px" Text='<%# Bind("HomePhone") %>' MaxLength="50"/>(区号-电话-分机)</td>
         </tr>
          <tr>
             <td class="OrderTitle">证件类型：</td>
             <td>
                <asp:DropDownList ID="RadioU_IdentifyType" runat="server" Enabled="False">
                   <asp:ListItem Selected="True" Value="0">居民身份证</asp:ListItem>                    
               </asp:DropDownList>
              </td>
         </tr>
         <tr>
             <td class="OrderTitle">证件号码：</td>
             <td><asp:TextBox ID="TxtU_IDCard" runat="server" Width="132px" Height="16px" Text='<%# Bind("IDCard") %>' MaxLength="50" /><asp:label ID="identify_IDcard_tips" runat="server" Text='<%# Eval("IDCard") %>' Visible="false"/></td>
         </tr>
          <tr runat="server" id="ShowQQ">
             <td class="OrderTitle">OICQ：</td>
             <td><asp:TextBox ID="OICQ" runat="server" Width="132px" Height="16px" Text='<%# Bind("OICQ") %>' MaxLength="50"/> <asp:RegularExpressionValidator ID="revQQ" runat="server"  ErrorMessage="OICQ格式不正确" ValidationExpression="\d+"
                  ControlToValidate="OICQ" Display="Dynamic"/><span style="color:Gray;"> 填写后将会在商品页面显示QQ联系</span></td>
         </tr>
         <tr runat="server" id="ShowWW">
             <td class="OrderTitle">淘宝旺旺：</td>
             <td><asp:TextBox ID="Taobaowangwang" runat="server" Width="132px" Height="16px" Text='<%# Bind("Taobaowangwang") %>' MaxLength="50"/><span style="color:Gray;"> 填写后将会在商品页面显示淘宝联系</span></td>
         </tr>
         <tr>
             <td class="OrderTitle">认证状态：</td>
             <td><asp:Image ID="IdentifyStatus" runat="server" />
           <asp:HyperLink ID="GoIdentify" runat="server"  Target="_blank"/></td>
         </tr>
         <tr>           
             <td  colspan="2" style="text-align:center;">
                <asp:Button ID="BtnSave" runat="server" CommandArgument="true" CommandName="Update"  Text="确定修改" />
                 &nbsp;&nbsp;<cc1:confirmbuttonextender id="ConfirmButtonExtender1" ConfirmText="你确定要修改吗? "  runat="server"
                     targetcontrolid="BtnSave"></cc1:confirmbuttonextender>&nbsp;
                 <asp:Button ID="BtnCancle" runat="server" CommandArgument="true" CommandName="Cancle" Text="取消" /></td>
         </tr>
     </table>
    
   </EditItemTemplate>
</asp:FormView>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetUserInfoByUserID"  TypeName="Howave_UserInfo"
     UpdateMethod="UpdateUserInfoByUserID" OnUpdating="ObjectDataSource1_Updating1" OnUpdated="ObjectDataSource1_OnUpdated1" >
        <UpdateParameters>
            <asp:Parameter Name="UserID" Type="Int32" />
            <asp:Parameter Name="TrueName" Type="String" />
            <asp:Parameter Name="Address" Type="String" />
            <asp:Parameter Name="ZipCode" Type="String" />
            <asp:Parameter Name="OICQ" Type="String" />
            <asp:Parameter Name="Taobaowangwang" Type="String" />
            <asp:Parameter Name="MobilePhone" Type="String" />
            <asp:Parameter Name="HomePhone" Type="String" />
            <asp:Parameter Name="IDCard" Type="String" />
            <asp:Parameter Name="Province" Type="String" />
            <asp:Parameter Name="City" Type="String" />
        </UpdateParameters>
        <SelectParameters>
            <asp:SessionParameter DefaultValue="0" Name="UserID" SessionField="Howave_UserID"  Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
    
   
</asp:Content>

