<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="HL_Admin_Admin_ShopCity, WebApp_deploy" title="地区管理" enableviewstate="false" enableEventValidation="false" %>
<%@ Import Namespace="HoWave.Web" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript">
    var c;
    function cc(obj)
    {
        c=obj.style.backgroundColor;
        obj.style.backgroundColor='#E7EDFE';
    }
    function cc1(obj)
    {
        obj.style.backgroundColor=c;
    }  
</script>

<table class="" width="98%">
   <tr>
     <th align="left">地区管理</th>   
     <td align="right">
     <div style="float:right; margin:5px 0 0 5px">
	<asp:ImageButton ID="Button3" runat="server" OnClick="Button3_Click" CausesValidation="false" ImageUrl="Images/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:ObjectDataSource ID="ObjectDataSource2" runat="server" SelectMethod="GetAllProvince"  TypeName="HoWave.Web.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" AllowPaging="True" PageSize="20"  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='只有标记了的城市才会在商品分类列表地区下拉框中显示。'><font style='color:#ffc'>标记为重点城市</font></a>"></asp:CheckBoxField>
        <asp:TemplateField HeaderText="删除">
          <ItemTemplate>
            <asp:LinkButton ID="mod" runat="server" CommandName="edit" Text="编辑" />
            <asp:LinkButton ID="cl" runat="server" CommandName="Delete" OnClientClick="if(confirm('确定删除吗？'))return true; return false;" Text="删除" />
          </ItemTemplate>
          <EditItemTemplate>
            <asp:LinkButton ID="modi" runat="server" CommandName="Update" Text="提交" />
            <asp:LinkButton ID="cl" runat="server" CommandName="Cancel" Text="取消" />
          </EditItemTemplate>
        </asp:TemplateField>
        </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="HoWave.Web.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>

    <div class="help_intro" >
	<h1>帮助说明：</h1>
        <ul>
          <li>注意：地区跟商品所在地和店铺所在地相关联，非必要情况请不要编辑名称或删除。</li></ul>                       
    </div>
    
</asp:Panel> 

  <asp:Panel runat="server" ID="panneladd" Visible="False">
   <table class="nick" cellpadding="1" cellspacing="1" border="0">
        <tr>
             <td class="tit" colspan="2">新添地区</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>
        <tr>
            <td class="btm" colspan="2">
        	<asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="保存" />
        	<asp:Button ID="Button1" runat="server" Text="返回" CausesValidation="False" OnClick="Button1_Click" />
	    </td>
        </tr>
    </table>     
  </asp:Panel> 
    
</asp:Content>

