<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="HL_Admin_Admin_Skin, HoWaveVGO" title="风格管理" enableeventvalidation="false" validaterequest="false" viewstateencryptionmode="Never" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<script type="text/javascript">
    function AddSkin(id,action){
     var recdata=false;
      switch (action)
      {
          case "Add":
            var skinType=RequestQuerry('SkinType');
            recdata=window.open("Admin_AddSkin.aspx?Action=Add&SkinType="+skinType,"_blank","height=600px,width=700px,menubar=0,toolbar=0,status=0");
          break;
          case "Modify":
            recdata=window.open("Admin_AddSkin.aspx?Action=Modify&SkinID="+id,"_blank","height=600px,width=700px,menubar=0,toolbar=0,status=0");      
          break;    
      }   
       //判断对应的返回值
      if(recdata==true)
      {
         // 刷新当前窗口
         window.location.reload();
         
      } 
    }
    function RequestQuerry(val)
    {
       var uri = window.location.search;
       var re = new RegExp("" +val+ "\=([^\&\?]*)", "ig");
       return ((uri.match(re))?(uri.match(re)[0].substr(val.length+1)):null);
    }
    function PageReload()
    {
      window.location.reload();
    }

</script>
<script type="text/javascript" src="JS/mouse.js" ></script> 
  <table class="adminheading">
         <tr>
            <th>风格管理</th>                  
            <td align="right"><div style="width:630px">
            导航：
                <a href="Admin_Skin.aspx?SkinType=Index">首页风格</a>&nbsp;|   
                <a href="Admin_Skin.aspx?SkinType=Shop">店铺风格</a>&nbsp;|  
                <a href="Admin_Skin.aspx?SkinType=Special">专题风格</a>&nbsp;|  
                <a href="Admin_Skin.aspx?SkinType=Product">商品风格</a>&nbsp;|  
                <a href="Admin_Skin.aspx?SkinType=Class">分类风格</a>&nbsp;|  
                <a href="Admin_Skin.aspx?SkinType=ShopBase">基本风格</a>&nbsp;|  
                <a href="Admin_Skin.aspx?SkinType=Member">会员中心风格</a>&nbsp;|
                <a href="Admin_Skin.aspx?SkinType=Customer">自定义风格</a>&nbsp;|  
                <a href="javascript:void(0)" onclick="AddSkin('','Add')">新增风格</a>
             </div>               
             </td>
             <td class="rtdw"></td>  
         </tr>
  </table> 
    
         <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="SkinID" EnableViewState="false"
            DataSourceID="ObjectDataSource1" OnRowDataBound="GridView1_RowDataBound" CssClass="adminlist" Width="100%" AllowPaging="True" PageSize="20" OnDataBound="GridView1_DataBound">
            <Columns>               
                <asp:BoundField DataField="Skinid" HeaderText="编号" >
                    <HeaderStyle Width="5%" />
                </asp:BoundField>
                <asp:BoundField DataField="SkinType" HeaderText="类型">
                    <HeaderStyle Width="10%" />
                </asp:BoundField>
                <asp:BoundField DataField="ProjectName" HeaderText="样式名称">
                    <HeaderStyle Width="20%" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="风格名称">
                   <ItemTemplate>
                     <asp:HyperLink ID="SkinName" Text='<%# Eval("SkinName") %>' ToolTip='<%#Eval("SkinPreviewImg")%>' NavigateUrl="#" runat="server" />                   
                   </ItemTemplate>
                   <HeaderStyle Width="20%" />
                </asp:TemplateField>   
              
                 <asp:BoundField DataField="IsDefault" HeaderText="默认">
                    <HeaderStyle Width="5%" />
                </asp:BoundField>
               
                <asp:TemplateField HeaderText="操作选项">
                   <ItemTemplate>
                      <asp:HyperLink ID="SetIsDefault" runat="server" NavigateUrl='<%#"Admin_Skin.aspx?Action=IsDefault&SkinID="+Eval("SkinID") %>' Text="设为默认" /> |                         
                      <asp:HyperLink ID="UpdateSkin" runat="server" NavigateUrl='<%# "javascript:AddSkin(\""+Eval("Skinid")+"\",\"Modify\")" %>' Text="修改" /> |                       
                      <a href="javascript:void(0)" onclick="AddSkin('','Add')">新增</a>|   
                      <asp:LinkButton id="btnDelete" runat="server" OnClientClick ="return confirm('确定要彻底删除此风格吗?')"   CommandName="Delete" Text="删除"/> | 
                      <asp:LinkButton ID="HyperLink1" runat="server"  CommandName='<%#Eval("SkinID") %>' Text="刷新" OnCommand="SaveCssFile" />   
                   </ItemTemplate>                 
                    <HeaderStyle Width="30%" />
                </asp:TemplateField>             
            </Columns>
            <EmptyDataTemplate>
               <tr><th scope="col" style="width:5%;">编号</th><th scope="col" style="width:10%;">类型</th><th scope="col" style="width:20%;">样式名称</th><th scope="col" style="width:20%;">风格名称</th><th scope="col" style="width:5%;">默认</th><th scope="col" style="width:30%;">操作选项</th></tr>
               <tr><td colspan="6">暂无风格！</td></tr>
            </EmptyDataTemplate>
         </asp:GridView>
 
  
    <asp:ObjectDataSource ID="ObjectDataSource1" 
    runat="server" DeleteMethod="DeleteSkin" SelectMethod="GetSkinBySkinType"
     TypeName="SkinBll" >
        <DeleteParameters>
            <asp:Parameter Name="SkinID" Type="Int32" />
            <asp:Parameter Name="SkinType" Type="String" />
        </DeleteParameters>
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="Index" Name="SkinType" QueryStringField="SkinType"
                Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
   
</asp:Content>

