<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="HL_Admin_Admin_Shop, HoWaveVGO" title="店铺管理" debug="true" enableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"/>
<script src="Js/Function.js" type="text/javascript"></script>
<script src="../Shop/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:46%">
    <asp:DropDownList ID="QuickSearch" runat="server" CssClass="text_area" OnSelectedIndexChanged="QuickSearch_SelectedIndexChanged"  AutoPostBack="true">
         <asp:ListItem Text="请选择" Value="-1" />
         <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:ListItem Text="通过品牌认证的店铺" Value="identify" />
         <asp:ListItem Text="申请品牌认证的店铺" Value="aplay" />
         <asp:ListItem Text="未通过品牌认证的店铺" Value="no_identify" />
         <asp:ListItem Text="未申请品牌认证的店铺" Value="no_aplay" />        
      </asp:DropDownList></td>
      <td class="ltd">分类查找：</td><td class="rtd" style="width:35%">
      <asp:DropDownList ID="ShopSearchClass" runat="server" AppendDataBoundItems="True" AutoPostBack="True" DataSourceID="ObjectDataSource1" DataTextField="ClassName" DataValueField="ClassID" CssClass="text_area" OnSelectedIndexChanged="ShopSearchClass_SelectedIndexChanged">
          <asp:ListItem Value="-1">请选择</asp:ListItem>
      </asp:DropDownList></td></tr>
    <tr><td class="ltd">高级查找：</td><td class="rtd" colspan="3">
    <asp:DropDownList ID="DetailSearchType" runat="server" CssClass="text_area" Width="145px">
         <asp:ListItem Text="请选择" Value="-1" />
         <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="80"/>
      
      <asp:Button ID="SearchButton" runat="server" Text="查询" OnClick="SearchButton_Click" Width="40" />
      </td></tr>
    </table> <br />    
     <%-- <asp:UpdatePanel ID="UpdatePanel1" runat="server" >
         <ContentTemplate>
            --%>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Width="100%"  CssClass="adminlist" RowStyle-HorizontalAlign="Center"  DataKeyNames="ShopID" OnRowDataBound="GridView1_RowDataBound"  OnDataBound="GridView1_DataBound" 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>
                  <HeaderStyle Width="20px" />
                  <ItemStyle Width="20px" />
              </asp:TemplateField> 
              <asp:HyperLinkField HeaderText="店铺名称" DataTextField="ShopName" DataNavigateUrlFormatString="../Shop/Shop1/MyShop.aspx?ShopID={0}" DataNavigateUrlFields="ShopID" Target="_blank" HeaderStyle-Width="20%" />
              <asp:HyperLinkField HeaderText="用户名称" DataTextField="ShopOwnerName" DataNavigateUrlFormatString="Admin_UserDetail.aspx?UserID={0}" DataNavigateUrlFields="ShopOwnerID" Target="_blank" HeaderStyle-Width="8%" />
             
              <asp:BoundField HeaderText="店铺类别" DataField="ShopClassName" HeaderStyle-Width="10%"/>                 
              <asp:TemplateField  HeaderText="店铺状态">
                 <ItemTemplate>
                    <asp:Literal ID="ShopStatus" Text='<%# Eval("ShopStatus")%>' runat="server" />
                 </ItemTemplate>
                  <HeaderStyle Width="8%" />
              </asp:TemplateField>             
              <asp:TemplateField  HeaderText="店铺属性">
                 <ItemTemplate>
                  <asp:Literal ID="LSaleCrediet" runat="server" Text='<%# Eval("SaleCrediet") %>' />&nbsp;                  
                     <asp:Literal ID="ShopCrediet" runat="server" Text='<%# "<script>displayStar("+Eval("SaleCrediet")+",\"../Shop/\")</script>" %>' />&nbsp;                  
                      <br />                      
                    <asp:Literal ID="ShopRecommend" Text='<%# (Convert.ToInt32(Eval("RecommendShop"))==1)?"荐":"" %>' runat="server" />
                    <asp:Image ID="ShopIdentify" ImageUrl="../IMS_Img/Manage/shop_identify.gif" runat="server"  />                   
                 </ItemTemplate>
                  <HeaderStyle Width="15%" />
              </asp:TemplateField>
              <asp:BoundField DataField="ShopRegDate" HeaderText="开店时间">
                  <HeaderStyle Width="15%" />
              </asp:BoundField>
              <asp:BoundField DataField="ShopOperatorItem" HeaderText="店铺主营" >
                  <HeaderStyle Width="20%" />
              </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>
                     <th>店铺主营</th>
                     <th>详细信息</th>                    
                  </tr>
                  <tr><td colspan="9">暂无店铺！</td></tr>
            </EmptyDataTemplate>
            <RowStyle HorizontalAlign="Center" />
        </asp:GridView>
    <div style="padding:10px;" align="center">
        <asp:Literal ID="ItemCount" runat="server" />
        <asp:Literal ID="CurrentPage" runat="server" />
        <asp:HiddenField ID="H_CurrentPage" runat="server" Value="0"/>
        <asp:HiddenField ID="H_SearchType" runat="server" Value="0"/>
        <asp:LinkButton ID="First" runat="server" CommandArgument="first" OnClick="PagerButton_Click">首 页</asp:LinkButton>
        <asp:LinkButton ID="Prev" runat="server" CommandArgument="prev" OnClick="PagerButton_Click">上一页</asp:LinkButton>
        <asp:LinkButton ID="Next" runat="server" CommandArgument="next" OnClick="PagerButton_Click">下一页</asp:LinkButton>
        <asp:LinkButton ID="Last" runat="server" CommandArgument="last" OnClick="PagerButton_Click">尾 页</asp:LinkButton>
              到第<asp:TextBox ID="GoToPage" Width="20px" runat="server" />页<asp:Button ID="GoPageBtn" Text="确定" runat="server" OnClick="GoToPageBtn_Click" />
    </div>
         <%-- </ContentTemplate>           
            <Triggers>              
                 <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
                 <asp:AsyncPostBackTrigger ControlID="Button2" EventName="Click" />
                 <asp:AsyncPostBackTrigger ControlID="Button3" EventName="Click" />
                 <asp:AsyncPostBackTrigger ControlID="Button4" EventName="Click" />
                 <asp:AsyncPostBackTrigger ControlID="Button5" EventName="Click" />
                 <asp:AsyncPostBackTrigger ControlID="Button6" EventName="Click" />
                 <asp:AsyncPostBackTrigger ControlID="DeleteBtn" EventName="Click" />
                 <asp:AsyncPostBackTrigger ControlID="QuickSearch" EventName="SelectedIndexChanged" />
                 <asp:AsyncPostBackTrigger ControlID="ShopSearchClass" EventName="SelectedIndexChanged" />
                 <asp:AsyncPostBackTrigger ControlID="SearchButton" EventName="Click" />
             </Triggers>
         </asp:UpdatePanel>
--%>

     

    <div style="width:100%; padding:5px 0 5px 0;text-align:center;" >  
       <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>
   
    

     
     

<div class="helpStyle">
      <span style="font-weight:bold;">属性中的各项含义：</span><br />
      <span style="color:Blue">荐</span>---推荐店铺　<img src="../IMS_Img/Manage/shop_identify.gif" />---品牌店铺　√--店铺正常  ×---店铺关闭
</div>

 <asp:UpdateProgress ID="UpdateProgress1" runat="server">
          <ProgressTemplate>
               <div class="wait">
                 <img src="../IMS_Img/wait.gif" align="middle"/>请稍等...
                </div>
          </ProgressTemplate>
  </asp:UpdateProgress>
  <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetAllParentClass"  TypeName="Shop_Class"/>            
</asp:Content>

