<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="Admin_Admin_ShopGroup, mallz" title="店铺等级" enableEventValidation="false" %>
<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>


    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetAllGroups" TypeName="MallZ.Data.ShopGroupBll"></asp:ObjectDataSource>

<asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1" AutoGenerateColumns="False" DataKeyNames="ID" CssClass="adminlist" OnRowDataBound="GridView1_RowDataBound">
    <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="MallZ.Data.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" ConvertEmptyStringToNull="false"/>
            <asp:Parameter Name="Power" Type="String" ConvertEmptyStringToNull="false"/>
            <asp:Parameter Name="MaxClass" Type="int32" DefaultValue="0" />
            <asp:Parameter Name="MaxElite" Type="int32" DefaultValue="0" />
            <asp:Parameter Name="TemplatePath" Type="string" DefaultValue="" ConvertEmptyStringToNull="false"  />
            <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" ConvertEmptyStringToNull="false"/>
            <asp:Parameter Name="Power" Type="String" ConvertEmptyStringToNull="false"/>
            <asp:Parameter Name="MaxClass" Type="int32" DefaultValue="0" />
            <asp:Parameter Name="MaxElite" Type="int32" DefaultValue="0" />
            <asp:Parameter Name="TemplatePath" Type="String" DefaultValue="" ConvertEmptyStringToNull="false" />
            <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="TextBox1" runat="server" Text='<%#Bind("MaxClass") %>' Width="80"/>
                    </td>
                </tr>
                <tr>
                    <td class="ltd">允许橱窗推荐数：</td>
                    <td class="rtd">
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%#Bind("MaxElite") %>' Width="80"/>
                    </td>
                </tr>
                <tr>
                    <td class="ltd">允许使用二级域名：</td>
                    <td class="rtd">
                        <asp:RadioButtonList ID="IsUseSecUrl" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal" SelectedValue='<%#Bind("IsUseSecUrl") %>' >
                            <asp:ListItem Value="0" Text="关闭" />
                            <asp:ListItem Value="1" Text="开启" />
                        </asp:RadioButtonList>
                    </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: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="TextBox1" runat="server" Text='<%# Bind("MaxClass") %>' Width="80"/>
                    </td>
                </tr>
                <tr>
                    <td class="ltd">允许橱窗推荐数：</td>
                    <td class="rtd">
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("MaxElite") %>' Width="80"/>
                    </td>
                </tr>
                <tr>
                    <td class="ltd">允许使用二级域名：</td>
                    <td class="rtd">
                        <asp:RadioButtonList ID="IsUseSecUrl" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal" SelectedValue='<%#Bind("IsUseSecUrl") %>' >
                            <asp:ListItem Value="0" Text="关闭" />
                            <asp:ListItem Value="1" Text="开启" />
                        </asp:RadioButtonList>
                    </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: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>

