<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="Admin_Admin_SecUrl, mallz" title="域名管理" debug="true" enableEventValidation="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script src="Js/Function.js" type="text/javascript"></script>
<script src="../Js/f_function.js" type="text/javascript"></script>

<table class="adminheading" width="100%">
    <tr>
       <th valign="middle" class="shoppage" align="left">
           域名管理</th>
       <td align="right"></td>
       <td class="rtdw"></td>
     </tr>
 </table>
     

    <table class="nick"><tr><td colspan="4" class="tit">域名查找</td></tr>
    <tr>
      <td class="ltd">快速查找：</td><td class="rtd" style="width:30%;">
         <asp:DropDownList ID="QuickSearch" runat="server" CssClass="text_area" OnSelectedIndexChanged="QuickSearch_SelectedIndexChanged"  AutoPostBack="true">
           <asp:ListItem Text="所有店铺" Value="all" />        
           <asp:ListItem Text="所有已经关闭的店铺" Value="close" />
           <asp:ListItem Text="所有正常的店铺" Value="normal" />         
           <asp:ListItem Text="所有暂停营业的店铺" Value="pause" />
           <asp:ListItem Text="三天内的新开的店铺" Value="three_day_open" />
           <asp:ListItem Text="商品数量大于10的店铺" Value="more_then_ten" />
         </asp:DropDownList>
         <asp:DropDownList ID="ShopSearchClass" runat="server" AppendDataBoundItems="True" AutoPostBack="True" DataTextField="ClassName" DataValueField="ClassID" CssClass="text_area" OnSelectedIndexChanged="ShopSearchClass_SelectedIndexChanged">
          <asp:ListItem Value="-1">请选择</asp:ListItem>
      </asp:DropDownList>
      </td>
      <td class="ltd" style="width:12%">高级查找：</td>
      <td class="rtd">
      <asp:DropDownList ID="DetailSearchType" runat="server" CssClass="text_area">
         <asp:ListItem Text="店铺名称" Value="shop_name" />
         <asp:ListItem Text="店长名称" Value="saler_name" />
         <asp:ListItem Text="主营项目" Value="operate_item" />                
      </asp:DropDownList>
      <asp:TextBox ID="DetailSearchName" runat="server" Width="150"/>
      <asp:Button ID="SearchButton" runat="server" Text=" 查 询 " OnClick="SearchButton_Click" />
      </td>
    </tr>
    </table>
     
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"  CssClass="adminlist" RowStyle-HorizontalAlign="Center"  DataKeyNames="ShopID" OnRowDataBound="GridView1_RowDataBound"  style="word-break:break-all;">
            <Columns>
              <asp:TemplateField >
                 <ItemTemplate>
                    <input type="checkbox" name="chk_select" value='<%# Eval("ShopID") %>' />
                 </ItemTemplate>
                 <HeaderTemplate>
                    <input id="chkAll" onclick="SelectAllCheckboxes(this);" runat="server" type="checkbox" />
                 </HeaderTemplate>
                  <ItemStyle Width="4%" />
              </asp:TemplateField> 
              <asp:HyperLinkField HeaderText="店铺名称" DataTextField="ShopName" DataNavigateUrlFormatString="../Shop/index.aspx?ShopID={0}" DataNavigateUrlFields="ShopID" ItemStyle-HorizontalAlign="Left" ItemStyle-Font-Bold="true" />
              <asp:HyperLinkField HeaderText="域名" DataTextField="SecUrl" DataNavigateUrlFormatString="http://{0}" DataNavigateUrlFields="SecUrl" HeaderStyle-Width="25%" Target="_blank" />
              <asp:HyperLinkField HeaderText="用户名称" DataTextField="ShopOwnerName" DataNavigateUrlFields="ShopOwnerID" DataNavigateUrlFormatString="Admin_UserDetail.aspx?UserID={0}" HeaderStyle-Width="15%" />
              <asp:TemplateField  HeaderText="状态" HeaderStyle-Width="10%">
                 <ItemTemplate>
                    <asp:Literal ID="ShopStatus" Text='<%# (Eval("IsUseSecUrl").ToString()=="1")?"正常":"关闭"%>' runat="server" />
                 </ItemTemplate>
              </asp:TemplateField>
              <asp:TemplateField  HeaderText="操作" HeaderStyle-Width="10%">
                 <ItemTemplate>
                    <asp:LinkButton runat="server" ID="en" Text='<%# (Eval("IsUseSecUrl").ToString()=="1")?"禁用":"开启"%>' OnCommand="SetCloseOpen" CommandArgument='<%#Eval("ShopID") %>' CommandName='<%# Eval("IsUseSecUrl") %>' />
                    <asp:LinkButton runat="server" ID="del" Text="删除" CommandArgument='<%#Eval("ShopID") %>' OnCommand="Delete_OnCommand" />
                 </ItemTemplate>
              </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                  <tr>
                     <th>选中</th>
                     <th>域名名称</th>
                     <th>店铺名称</th>
                     <th>用户名称</th>
                     <th>状态</th>
                  </tr>
                  <tr><td colspan="5">暂无数据！</td></tr>
            </EmptyDataTemplate>
            <RowStyle HorizontalAlign="Center" />
        </asp:GridView>
        
    <div class="page">
        <asp:Label runat="server" ID="PagePanel" />&nbsp;</div>


    <div style="width:100%; padding:5px 0 5px 0;text-align:center;" >  
       <asp:Button ID="DeleteBtn" runat="server" Text="删除域名" CommandName="DeleteUrl"  OnCommand="btnOpeCommand" OnClientClick="return confirm('您确定要删除吗？此操作将删除所有跟删除店铺相关联的数据，并且删除后不能恢复?')"/>
       <asp:Button ID="Close_Button" runat="server" Text="禁用域名" CommandName="CloseUrl" OnCommand="btnOpeCommand" />
        <asp:Button ID="btn_openSecUrl" runat="server" OnCommand="btnOpeCommand"
            Text="开启域名" CommandName="OpenUrl" /></div>
         
</asp:Content>

