<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="HL_Admin_Admin_Shop, WebApp_deploy" 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">高级查找：</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 HeaderStyle-Width="4%" >
                 <ItemTemplate>
                    <input type="checkbox" name="chk_select" value='<%# Eval("ShopID") %>' />                   
                 </ItemTemplate>
                 <HeaderTemplate>
                    <input id="chkAll" onclick="SelectAllCheckboxes(this);" runat="server" type="checkbox" />
                 </HeaderTemplate>
                  <HeaderStyle Width="20px" />
                  <ItemStyle Width="20px" />
              </asp:TemplateField> 
              <asp:HyperLinkField HeaderText="店铺名称" DataTextField="ShopName" DataNavigateUrlFormatString="../Shop/{0}/index.aspx?ShopID={0}" DataNavigateUrlFields="ShopID" Target="_blank" ItemStyle-Font-Bold="true" ItemStyle-HorizontalAlign="Left" />
              <asp:HyperLinkField HeaderText="用户名称" DataTextField="ShopOwnerName" ItemStyle-Width="12%" DataNavigateUrlFormatString="Admin_UserDetail.aspx?UserID={0}" DataNavigateUrlFields="ShopOwnerID" />
              <asp:TemplateField  HeaderStyle-Width="6%" HeaderText="状态">
                 <ItemTemplate>
                    <asp:Literal ID="ShopStatus" Text='<%# (Eval("ShopStatus").ToString()=="1")?"正常":((Eval("ShopStatus").ToString()=="0")?"暂停":"<font color=red>关闭</font>") %>' runat="server" />
                 </ItemTemplate>
              </asp:TemplateField>
              <asp:TemplateField  HeaderText="审核状态">
                 <ItemTemplate>
                    <asp:Literal ID="ShopIdentify" Text='<%# (Eval("ShopIdentify").ToString()=="1")?"通过审核":((Eval("ShopIdentify").ToString()=="0")?"<font color=red>等待审核</font>":"拒绝审核") %>' runat="server" />
                 </ItemTemplate>
                 <HeaderStyle Width="8%" />
              </asp:TemplateField>                
              <asp:TemplateField  HeaderText="属性" ItemStyle-HorizontalAlign="Left" >
                 <ItemTemplate>                
                     <asp:Literal ID="ShopCrediet" runat="server" Text='<%# "信用：<script>displayStar("+Eval("SaleCrediet")+")</script>" %>' /><br />                      
                     <asp:Literal ID="ShopRecommend" Text='<%# (Eval("RecommendShop").ToString()=="True")?"<font color=green>荐</font><br />":"" %>' runat="server" />       
                     <asp:Literal ID="ShopLevel" Text='<%# "等级：" + Eval("ShopGroudName") %>' runat="server" />      
                 </ItemTemplate>
                 <HeaderStyle Width="18%" />
              </asp:TemplateField>
              <asp:BoundField DataField="ShopRegDate" HeaderText="开店时间">
                  <HeaderStyle Width="15%" />
              </asp:BoundField>
              
              <asp:TemplateField HeaderText="操作">
                  <ItemTemplate>
                      <a href="Admin_UpdateShop.aspx?ShopID=<%#Eval("ShopID") %>">详细</a>
                  </ItemTemplate>
                  <HeaderStyle Width="5%" />
             </asp:TemplateField>
              
            </Columns>
            <EmptyDataTemplate>
                  <tr>
                     <th>选中</th>
                     <th>店铺名称</th>
                     <th>用户名称</th>
                     <th>店铺状态</th>
                     <th>店铺属性</th>
                     <th>开店时间</th>
                     <th>操作</th>                    
                  </tr>
                  <tr><td colspan="9">暂无店铺！</td></tr>
            </EmptyDataTemplate>
            <RowStyle HorizontalAlign="Center" />
        </asp:GridView>
        
    <div class="page">
        <asp:Label runat="server" ID="PagePanel" />
    </div>

    <div class="div_btm">  
       <asp:Button ID="UpdateShopProductNumBtn" runat="server" Text="更新店铺上架商品数" OnClick="UpdateShopProductNum_Click" />
       <asp:Button ID="UpdateShoTemplate" runat="server" Text="更新店铺模板页" OnClick="UpdateShoTemplate_Click" />
       <asp:Button ID="DeleteBtn" runat="server" Text="删除店铺" CommandName="Delete"  OnCommand="ShopButtonOnCommon" OnClientClick="return confirm('您确定要删除吗？此操作将删除所有跟删除店铺相关联的数据，并且删除后不能恢复?')"/>
       <asp:Button ID="Close_Button" runat="server" Text="关闭店铺" CommandName="Close" OnCommand="ShopButtonOnCommon" />
       <asp:Button ID="OpenShop_Button" runat="server" Text="取消关闭" CommandName="OpenShop" OnCommand="ShopButtonOnCommon"/>
       <asp:Button ID="IdentifyShop_Button" runat="server" Text="通过审核" CommandName="IdentifyShop" OnCommand="ShopButtonOnCommon"/>
       <asp:Button ID="NoIdentifyShop_Button" runat="server" Text="拒绝审核" CommandName="NoIdentifyShop" OnCommand="ShopButtonOnCommon"/>
       <asp:Button ID="IsElite_Button" runat="server" Text="推荐店铺" CommandName="IsElite" OnCommand="ShopButtonOnCommon"/>
       <asp:Button ID="NoIsElite_Button" runat="server" Text="取消推荐" CommandName="NoIsElite" OnCommand="ShopButtonOnCommon"/>
    </div>
         
</asp:Content>

