<%@ page language="C#" masterpagefile="~/HL_Admin/AdminIndexMaster.master" autoeventwireup="true" inherits="HL_Admin_Admin_ShopCity, HoWaveVGO" title="Untitled Page" enableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
   
<table class="adminheading">
 <tr>
 <th valign="middle" class="templates"  align="left" style="width: 25%">
 地区管理</th>   
 <td align="right">
        <div style="float:left; font-weight:normal; color:Gray;">注意：地区跟商品所在地和店铺所在地相关联，非必要情况请不要编辑名称或删除。</div>
         <div style="float:right; padding:5px;">
             <asp:ImageButton ID="Button3" runat="server" OnClick="Button3_Click" CausesValidation="false" ImageUrl="../IMS_Img/Manage/addcity.png" />
         </div>
         <asp:Panel runat="server" ID ="Panelheand"  style="float:right;">
         快速查找省份：<asp:DropDownList ID="DropDownList1" runat="server" AppendDataBoundItems="True"
         AutoPostBack="True" DataSourceID="ObjectDataSource2" DataTextField="Province"
         DataValueField="Province">
         <asp:ListItem>所有</asp:ListItem>
 </asp:DropDownList>
 <asp:ScriptManager id="ScriptManager1" runat="server" />
 <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" SelectMethod="GetAllProvince"  TypeName="Shop_City"/>
 </asp:Panel>
　     
</td>
         </tr>
  </table>
  <asp:Panel runat="server" ID ="Pannel1">
 
    <asp:UpdatePanel id="updatepanel1" runat="server">
     <ContentTemplate>
        <asp:GridView id="GridView1" runat="server" DataSourceID="ObjectDataSource1" AutoGenerateColumns="False" DataKeyNames="ID" CssClass="adminlist" Width="100%" AllowPaging="True" PageSize="20" OnRowDataBound="GridView1_RowDataBound" OnDataBound="GridView1_DataBound"><Columns>
        <asp:BoundField DataField="Province" HeaderText="省份"></asp:BoundField>
        <asp:BoundField DataField="City" HeaderText="城市"></asp:BoundField>
        <asp:CheckBoxField DataField="Flag" HeaderText="<a href='#' title='只有标记了的城市才会在商品分类列表地区下拉框中显示。'><span style='color:yellow'>标记为重点城市</span></a>"></asp:CheckBoxField>
        <asp:TemplateField HeaderText="删除">
          <ItemTemplate>
            <asp:LinkButton ID="cl" runat="server" CommandName="Delete" OnClientClick="if(confirm('确定删除吗？'))return true; return false;" Text="删除" />
          </ItemTemplate>
        </asp:TemplateField>
        <asp:CommandField HeaderText="编辑" ShowEditButton="True"></asp:CommandField>
        </Columns>
        <EmptyDataTemplate>
            <tr>
            <th>省份</th><th>城市</th><th>标记</th><th>删除</th><th scope="col">编辑</th>
            </tr>
            <tr><td colspan="5">暂无信息！</td></tr> 
        </EmptyDataTemplate> 
        </asp:GridView> 
        </ContentTemplate> 
                   <Triggers>
        <asp:AsyncPostBackTrigger ControlID="DropDownList1" EventName="SelectedIndexChanged"></asp:AsyncPostBackTrigger>
        </Triggers> 
    </asp:UpdatePanel>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="DeleteCity"
        InsertMethod="AddCity" SelectMethod="GetCity" TypeName="Shop_City" UpdateMethod="UpdateCity">
        <DeleteParameters>
            <asp:Parameter Name="ID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="Province" Type="String" />
            <asp:Parameter Name="City" Type="String" />
            <asp:Parameter Name="Flag" Type="Boolean" />
            <asp:Parameter Name="ID" Type="Int32" />
        </UpdateParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="DropDownList1" Name="Province" PropertyName="SelectedValue"
                Type="String" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="Province" Type="String" />
            <asp:Parameter Name="City" Type="String" />
            <asp:Parameter Name="Flag" Type="Boolean" />
        </InsertParameters>
    </asp:ObjectDataSource>
   
</asp:Panel> 

  <asp:Panel runat="server" ID="panneladd" Visible="False">

   <table width="100%" class="nick" cellpadding="1" cellspacing="1" border="0">
        <tr>
             <td class="tit" colspan="2">
                        <strong>新添地区</strong>
             </td>
        </tr>
        <tr class="tdbg">
            <td class="ltd">
                省份：</td>
            <td class="rtd">
                <input id="TxtProvince" 　 maxlength="10" name="UserName" size="30" runat="server" />
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtProvince"
                    ErrorMessage="省份名称不能空"></asp:RequiredFieldValidator></td>
        </tr>
        <tr>
            <td class="ltd">
                城市：</td>
            <td class="rtd">
                <input id="TxtCity" 　 maxlength="10" name="Balance" size="30" runat="server" />
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TxtCity"
                    ErrorMessage="城市名称不能空"></asp:RequiredFieldValidator></td>
        </tr>
        <tr>
            <td class="ltd">
                标记：</td>
            <td class="rtd">
                <asp:CheckBox ID="chFlag" runat="server" /></td>
        </tr>
       
    </table>
    <div class="div_btm">
        <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="保存" />
        <asp:Button ID="Button1" runat="server" Text="返回" CausesValidation="False" OnClick="Button1_Click" />
    </div>
     
    </asp:Panel> 
    
</asp:Content>

