<%@ Page Title="多选项子项管理" Language="C#" StylesheetTheme="AdminSkin" MasterPageFile="~/Others/AdminMasterPage.Master" AutoEventWireup="true" CodeBehind="FormControlOptionManage.aspx.cs" Inherits="Solution.Admin.Contents.FormControlOptionManage" %>

<%@ Register Assembly="BX.Common" Namespace="Common" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="AdminContentHead" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="AdminContentCenter" runat="server">
    <form id="Form1" runat="server">
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" EnablePaging="True"
            SelectMethod="ListOption" TypeName="Logic.HtmlForm"
            OldValuesParameterFormatString="original_{0}">
            <SelectParameters>
                <asp:QueryStringParameter DefaultValue="0" Name="GroupID" QueryStringField="groupid"
                    Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <div class="DivRightCenter">
            <div class="listdiv">
                <div class="grid-title">
                    <div class="grid-title-text">
                        <h4>
                            <span>多选项子项管理</span>
                        </h4>
                    </div>
                    <div class="grid-title-menu"></div>
                </div>
                <div class="grid-search">
                    Search:
                       <div class="grid-searchcontent">
                           <div class="userddl">
                               <ul>
                                   <li class="userddl-li">
                                       <input style="width: 40px;" class="ddltext" value="" id="ddlSearchOption" type="text" /><a href="javascript:" class="ddlarrow"></a></li>
                               </ul>
                           </div>
                           <input class="searchtext" id="txtKeywords" onkeypress="if(event.keyCode==13){ListSearch();}" type="text" /><input class="searchbutton" id="Button6" type="button" value="" onclick="ListSearch();" />
                       </div>
                </div>
                <div class="grid-list">
                    <cc1:ExtendedGridView ID="ExtendedGridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                        CssClass="grid" DataSourceID="ObjectDataSource1"
                        CheckBox="False" EnableTheming="False" ItemName="多选项子项管理" PageSize="100" CheckBoxDataIndex="0">
                        <Columns>
                            <asp:BoundField DataField="OptionID" HeaderText="ID">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" Width="50px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="GroupName" HeaderText="分组名称">
                                <HeaderStyle Wrap="False" />
                                <ItemStyle Wrap="False" Width="100px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="OptionName" HeaderText="选项名称"></asp:BoundField>

                            <asp:BoundField DataField="OptionValue" HeaderText="选项值">
                                <ItemStyle Width="50px" Wrap="False" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Sequence" HeaderText="排序">
                                <ItemStyle Width="50px" Wrap="False" />
                            </asp:BoundField>
                            <asp:BoundField DataField="CreateDate" HeaderText="创建时间">
                                <ItemStyle Width="50px" Wrap="False" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="选中状态">
                                <ItemStyle Width="50px" Wrap="False" />
                                <ItemTemplate>
                                    <%#Convert.ToInt32(DataBinder.Eval(Container.DataItem,"Selected"))==1?"√":"" %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="操作">
                                <ItemStyle Width="100px" Wrap="False" />
                                <ItemTemplate>
                                    <a href='FormControlOptionManage.aspx?cmd=delete&optionid=<%#DataBinder.Eval(Container.DataItem, "OptionID")%>&groupid=<%#DataBinder.Eval(Container.DataItem, "GroupID")%>' onclick="return confirm('确认删除?');">删除</a>&nbsp;
                                 <a href='FormControlOptionEdit.aspx?cmd=modify&optionid=<%#DataBinder.Eval(Container.DataItem, "OptionID")%>&groupid=<%#DataBinder.Eval(Container.DataItem, "GroupID")%>'>修改</a>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </cc1:ExtendedGridView>
                </div>
            </div>
            <div class="FormButtonArea">
                <asp:Button ID="btnAdd" runat="server" Text="添加选项" OnClick="btnAdd_Click" />&nbsp;&nbsp;
                        &nbsp;&nbsp;
                <asp:Button ID="btnAddField0" runat="server" Text="返回多选项分组" OnClientClick="location.href='FormControlOptionGroupManage.aspx';return false;" />
            </div>
            <script type="text/javascript">
                var searchOption = new DropDownList("ddlSearchOption");
                searchOption.initial({ "名称": "OptionName" }, { "extend": true });
                function ListSearch() {
                    var keywords = document.getElementById("txtKeywords").value;
                    if (keywords != "") {
                        window.location.href = "FormControlOptionManage.aspx?category=" + searchOption.get() + "&keywords=" + encodeURI(keywords);
                    } else {
                        window.location.href = "FormControlOptionManage.aspx";
                    }
                }
            </script>
        </div>
    </form>
</asp:Content>
