<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="HL_Admin_Admin_ShopGroup, WebApp_deploy" title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script type="text/javascript" language="javascript">
        function OpenFileList(boj) {
            window.open("Admin_PageFileList.aspx?obj=ctl00_ContentPlaceHolder1_FormView1_" + boj, "", "width=500px; height=350px; help=no; scroll=no; status=no; edge=sunken;");
        }
    </script>
    <table class="adminheading">
        <tr>
            <th valign="middle" class="menus" align="left">
                店铺等级设置
            </th>
            <td align="right">
                <div style="width: 78px; text-align: center">
                    <a href="?Action=add">
                        <img src="Images/edit.png" title="新增店铺等级" align="middle" style="cursor: pointer;
                            border-width: 0px" />
                    </a>
                    <br />
                    新增店铺等级
                </div>
            </td>
            <td class="rtdw">
            </td>
        </tr>
    </table>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetAllGroups"
        TypeName="HoWave.Web.ShopGroupBll"></asp:ObjectDataSource>
    <asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1" AutoGenerateColumns="False"
        DataKeyNames="ID" CssClass="adminlist">
        <Columns>
            <asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True">
                <HeaderStyle Width="40px" />
            </asp:BoundField>
            <asp:BoundField DataField="GroupName" HeaderText="等级名称">
                <HeaderStyle Width="200px" />
            </asp:BoundField>
            <asp:BoundField DataField="GroupIntro" HeaderText="等级简介" />
            <asp:BoundField DataField="ShopNum" HeaderText="店铺数">
                <HeaderStyle Width="100px" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="操作">
                <ItemTemplate>
                    <asp:HyperLink ID="md" NavigateUrl='<%# "?ID=" + Eval("ID") %>' runat="server" Text="修改" />
                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" OnCommand="DeleteGroup"
                        CommandArgument='<%#Eval("ID") %>' OnClientClick="return confirm('确定要删除吗?');"
                        Text="删除" />
                </ItemTemplate>
                <HeaderStyle Width="80px" />
            </asp:TemplateField>
        </Columns>
        <RowStyle HorizontalAlign="Center" />
        <EmptyDataTemplate>
            <div>
                暂无数据！</div>
        </EmptyDataTemplate>
    </asp:GridView>
    <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" InsertMethod="AddGroup"
        SelectMethod="GetGroupByID" TypeName="HoWave.Web.ShopGroupBll" UpdateMethod="ModifyGroup"
        OnUpdating="OnSubMit" OnInserting="OnSubMit" OnUpdated="ObjectDataSource2_OnUpdated"
        OnInserted="ObjectDataSource2_OnInserted">
        <UpdateParameters>
            <asp:Parameter Name="GroupName" Type="String" />
            <asp:Parameter Name="GroupIntro" Type="String" />
            <asp:Parameter Name="Power" Type="String" />
            <asp:Parameter Name="MaxClass" Type="int32" DefaultValue="0" />
            <asp:Parameter Name="MaxElite" Type="int32" DefaultValue="5" />
            <asp:Parameter Name="TemplatePath" Type="string" DefaultValue="" />
            <asp:Parameter Name="IsUseSecUrl" Type="int32" DefaultValue="0" />
        </UpdateParameters>
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="GroupName" Type="String" />
            <asp:Parameter Name="GroupIntro" Type="String" />
            <asp:Parameter Name="Power" Type="String" />
            <asp:Parameter Name="MaxClass" Type="int32" DefaultValue="0" />
            <asp:Parameter Name="MaxElite" Type="int32" DefaultValue="5" />
            <asp:Parameter Name="TemplatePath" Type="string" DefaultValue="" />
            <asp:Parameter Name="IsUseSecUrl" Type="int32" DefaultValue="0" />
        </InsertParameters>
    </asp:ObjectDataSource>
    <asp:FormView ID="FormView1" DefaultMode="Edit" DataKeyNames="ID" Visible="false"
        runat="server" Width="100%" OnDataBound="FormView1_OnDataBound">
        <EditItemTemplate>
            <table class="nick">
                <tr>
                    <td colspan="2" class="tit">
                        编辑店铺等级
                    </td>
                </tr>
                <tr>
                    <td class="ltd">
                        等级名称：
                    </td>
                    <td class="rtd">
                        <asp:TextBox ID="GroupName1" Text='<%# Bind("GroupName") %>' Width="300px" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="ltd">
                        说 明：
                    </td>
                    <td class="rtd">
                        <asp:TextBox ID="GroupIntros" TextMode="MultiLine" Height="80px" Width="500px" Text='<%# Bind("GroupIntro") %>'
                            runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="ltd">
                        推荐商品数量：
                    </td>
                    <td class="rtd">
                        <asp:TextBox ID="MaxElite1" Text='<%# Bind("MaxElite") %>' runat="Server" />
                    </td>
                </tr>
                <tr>
                    <td class="ltd">
                        店铺有效时间：
                    </td>
                    <td class="rtd">
                        <asp:TextBox ID="CloseDate" Text="1" runat="Server" Style="width: 60px" />年
                    </td>
                </tr>
                <tr>
                    <td class="ltd">
                        开启二级域名的权限：
                    </td>
                    <td class="rtd">
                        <asp:CheckBox ID="chk_IsUseSecUrl" runat="server" Text="是" />
                    </td>
                </tr>
                <tr>
                    <td class="ltd">
                        店铺权限：
                    </td>
                    <td class="rtd">
                        <asp:CheckBoxList ID="GroupPower" runat="server">
                            <asp:ListItem Value="addclass" Text="允许添加自定义分类" />
                            <asp:ListItem Value="changeskin" Text="允许更换店铺皮肤" />
                            <asp:ListItem Value="needcheck" Text="修改店铺资料不需重新审核" />
                            <asp:ListItem Value="showShopInfo" Text="允许店铺头部信息出现在商品详情页" />
                        </asp:CheckBoxList>
                    </td>
                </tr>
                <tr>
                    <td class="ltd">
                        选用模板：
                    </td>
                    <td class="rtd">
                        <asp:TextBox ID="TextTemplatePath" Width="300px" Text='<%# Bind("TemplatePath") %>'
                            runat="server" />
                        <input type="button" name="tem" value=" 浏 览 " onclick="return OpenFileList('TextTemplatePath')" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2" class="btm">
                        <asp:Button ID="Button1" runat="server" Text="提 交" CommandName="Update" />
                        <input type="button" name="cl" onclick="history.back();" value="返 回" />
                    </td>
                </tr>
            </table>
        </EditItemTemplate>
        <InsertItemTemplate>
            <table class="nick">
                <tr>
                    <td colspan="2" class="tit">
                        编辑店铺等级
                    </td>
                </tr>
                <tr>
                    <td class="ltd">
                        等级名称：
                    </td>
                    <td class="rtd">
                        <asp:TextBox ID="GroupName1" Text='<%# Bind("GroupName") %>' Width="300px" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="ltd">
                        说 明：
                    </td>
                    <td class="rtd">
                        <asp:TextBox ID="GroupIntros" TextMode="MultiLine" Height="80px" Width="500px" Text='<%# Bind("GroupIntro") %>'
                            runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="ltd">
                        推荐商品数量：
                    </td>
                    <td class="rtd">
                        <asp:TextBox ID="MaxElite1" Text='<%# Bind("MaxElite") %>' runat="Server" />
                    </td>
                </tr>
                <tr>
                    <td class="ltd">
                        店铺有效时间：
                    </td>
                    <td class="rtd">
                        <asp:TextBox ID="CloseDate" Text="1" runat="Server" Style="width: 60px" />年
                    </td>
                </tr>
                <tr>
                    <td class="ltd">
                        开启二级域名的权限：
                    </td>
                    <td class="rtd">
                        <asp:CheckBox ID="chk_IsUseSecUrl" runat="server" Text="是" />
                    </td>
                </tr>
                <tr>
                    <td class="ltd">
                        店铺权限：
                    </td>
                    <td class="rtd">
                        <asp:CheckBoxList ID="GroupPower" runat="server">
                            <asp:ListItem Value="addclass" Text="允许添加自定义分类" />
                            <asp:ListItem Value="changeskin" Text="允许更换店铺皮肤" />
                            <asp:ListItem Value="needcheck" Text="修改店铺资料不需重新审核" />
                            <asp:ListItem Value="showShopInfo" Text="允许店铺头部信息出现在商品详情页" />
                        </asp:CheckBoxList>
                    </td>
                </tr>
                <tr>
                    <td class="ltd">
                        选用模板：
                    </td>
                    <td class="rtd">
                        <asp:TextBox ID="TextTemplatePath" Width="300px" Text='<%# Bind("TemplatePath") %>'
                            runat="server" />
                        <input type="button" name="tem" value=" 浏 览 " onclick="return OpenFileList('TextTemplatePath')" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2" class="btm">
                        <asp:Button ID="Button1" runat="server" Text="提 交" CommandName="Insert" />
                        <input type="button" name="cl" onclick="history.back();" value="返 回" />
                    </td>
                </tr>
            </table>
        </InsertItemTemplate>
    </asp:FormView>
</asp:Content>
