<%@ page language="C#" autoeventwireup="true" inherits="Admin_Control_List, GroupTGWeb_deploy" %>

<%@ Register Assembly="ShopNum1.Control" Namespace="ShopNum1.Control" TagPrefix="cc1" %>
<%@ Register Src="UserControl/MessageShow.ascx" TagName="MessageShow" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>管理页面控件</title>
    <link type="text/css" rel="Stylesheet" href="css/index.css" />

    <script type="text/javascript" language="javascript" src="../js/CommonJS.js"></script>

</head>
<body style="padding: 0; background-image: url(images/Bg_right.gif); background-repeat: repeat;
    font-size: 12px">
    <form id="form2" runat="server">
    <div class="navigator">
        【 管理页面控件 】</div>
    <table style="width: 100%; line-height: 25px;">
        <tr>
            <td width="20%" align="right">
                <asp:Label ID="LabelPageType" runat="server" Text="当前页面类型："></asp:Label>
            </td>
            <td>
                <asp:Label ID="LabelPageTypeShow" runat="server"></asp:Label>
            </td>
            <td align="right">
                <asp:Label ID="LabelPageName" runat="server" Text="当前页面名称："></asp:Label>
            </td>
            <td>
                <asp:Label ID="LabelPageNameShow" runat="server"></asp:Label>
            </td>
            <td align="right">
                <asp:Label ID="LabelPagePath" runat="server" Text="当前页面源文件："></asp:Label>
            </td>
            <td>
                <asp:Label ID="LabelPagePathShow" runat="server"></asp:Label>
            </td>
        </tr>
    </table>
    <br />
    <cc1:Num1GridView ID="Num1GridViewShow" runat="server" AutoGenerateColumns="False"
        AllowPaging="True" AllowSorting="True" AscendingImageUrl="~/images/SortAsc.gif"
        DescendingImageUrl="~/images/SortDesc.gif" Width="100%" AddSequenceColumn="False"
        AllowMultiColumnSorting="False" BorderColor="#CCDDEF" BorderStyle="Solid" BorderWidth="1px"
        CellPadding="4" Del="False" DeletePromptText="确实要删除指定的记录吗？" Edit="False" FixHeader="False"
        CellSpacing="1" GridLines="None" Font-Size="Small" GridViewSortDirection="Ascending"
        PagingStyle="None" TableName="" DataSourceID="ObjectDataSourceData" Style="margin-left: 2px;">
        <HeaderStyle HorizontalAlign="Center" BackColor="#6699CC" Font-Bold="True" ForeColor="White">
        </HeaderStyle>
        <PagerStyle HorizontalAlign="center" BackColor="#EEEEEE" ForeColor="#6699CC"></PagerStyle>
        <Columns>
            <asp:TemplateField>
                <HeaderTemplate>
                    <input id="checkboxAll" onclick="javascript:SelectAllCheckboxes(this);" type="checkbox" />
                </HeaderTemplate>
                <ItemTemplate>
                    <input id="checkboxItem" value='<%# Eval("Guid") %>' type="checkbox" />
                </ItemTemplate>
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" Width="30px" />
            </asp:TemplateField>
            <asp:BoundField DataField="Guid" HeaderText="Guid" Visible="False" />
            <asp:BoundField DataField="ControlType" HeaderText="控件类型" SortExpression="ControlType">
                <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField HeaderText="控件名称" DataField="Name" SortExpression="Name">
                <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField HeaderText="控件ID" DataField="ControlID" SortExpression="ControlID">
                <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField HeaderText="描述" DataField="Description" SortExpression="Description">
            </asp:BoundField>
        </Columns>
    </cc1:Num1GridView>
    <div class="bottomLine">
        <asp:Button ID="ButtonAdd" runat="server" CausesValidation="False" Text="添加" OnClick="ButtonAdd_Click"
            CssClass="bt2" />
        <asp:Button ID="ButtonEdit" runat="server" CausesValidation="False" Text="编辑" OnClientClick="return EditButton()"
            OnClick="ButtonEdit_Click" CssClass="bt2" />
        <asp:Button ID="ButtonDelete" runat="server" CausesValidation="False" Text="删除" OnClientClick="return DeleteButton()"
            OnClick="ButtonDelete_Click" CssClass="bt2" /></div>
    <table cellpadding="0" cellspacing="1" border="0" style="width: 100%">
        <tr>
            <td colspan="2" style="width: 100%;">
                <div class="navigator">
                    <asp:Label ID="LabelPageTitle" runat="server" Font-Bold="True" Text="【 新增控件 】"></asp:Label>&nbsp;
                </div>
            </td>
        </tr>
        <tr>
            <td align="right" width="20%">
                &nbsp;
            </td>
            <td align="left">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:Label ID="LabelControlType" runat="server" Text="控件类型："></asp:Label>
            </td>
            <td align="left">
                <asp:DropDownList ID="DropDownListControlType" runat="server" OnSelectedIndexChanged="DropDownListControlType_SelectedIndexChanged"
                     CssClass="input1">
                    <asp:ListItem Value="Button">普通按钮</asp:ListItem>
                    <asp:ListItem Value="LinkButton">链接按钮</asp:ListItem>
                    <asp:ListItem Value="ImageButton">图片按钮</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:Label ID="LabelControlName" runat="server" Text="控件名称："></asp:Label>
            </td>
            <td align="left">
                <asp:TextBox ID="TextBoxControlName" runat="server" CssClass="input1"></asp:TextBox>
                <asp:Label ID="Label4" runat="server" ForeColor="#FF0066" Text="*"></asp:Label>
                <asp:RequiredFieldValidator ID="RequiredFieldValidatorName" runat="server" ControlToValidate="TextBoxControlName"
                    Display="Dynamic" ErrorMessage="该值不能为空"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:Label ID="LabelControlID" runat="server" Text="控件ID："></asp:Label>
            </td>
            <td align="left">
                <asp:TextBox ID="TextBoxControlID" runat="server" CssClass="input1"></asp:TextBox>
                <asp:Label ID="Label3" runat="server" ForeColor="#FF0066" Text="*"></asp:Label>
                <asp:RequiredFieldValidator ID="RequiredFieldValidatorControlID" runat="server" ControlToValidate="TextBoxControlID"
                    Display="Dynamic" ErrorMessage="该值不能为空"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td align="right">
                <asp:Label ID="LabelDescription" runat="server" Text="描述："></asp:Label>
            </td>
            <td align="left">
                <asp:TextBox ID="TextBoxDescription" runat="server" TextMode="MultiLine" Width="440px"
                    Height="60px" CssClass="input1"></asp:TextBox>
            </td>
        </tr>
        <tr>
        <td></td>
            <td>
                <div class="bottomLine">
                    <asp:Button ID="ButtonConfirm" runat="server" Text="确定" OnClick="ButtonConfirm_Click"
                        ToolTip="Submit" CssClass="bt2" />
                    <input id="Reset1" type="reset" value="重置" class="bt2" />
                    <uc1:MessageShow ID="MessageShow" runat="server" Visible="False" />
                </div>
            </td>
        </tr>
    </table>
    <asp:HiddenField ID="CheckGuid" runat="server" Value="0" />
    <asp:HiddenField ID="hiddenGuid" runat="server" Value="0" />
    <asp:HiddenField ID="hiddenControlGuid" runat="server" Value="0" />
    <asp:ObjectDataSource ID="ObjectDataSourceData" runat="server" SelectMethod="Search"
        TypeName="GroupFlyTG.BusinessLogic.GroupFlyTG_PageWebControl_Action" OldValuesParameterFormatString="original_{0}">
        <SelectParameters>
            <asp:ControlParameter ControlID="hiddenGuid" Name="pageGuid" PropertyName="Value"
                Type="String" DefaultValue="" />
            <asp:ControlParameter ControlID="CheckGuid" DefaultValue="" Name="guid" PropertyName="Value"
                Type="String" />
            <asp:Parameter Name="IsDeleted" Type="Int32" DefaultValue="0" />
        </SelectParameters>
    </asp:ObjectDataSource>

    <script language="javascript" type="text/javascript">
        var ul = document.getElementById("tab");
        for(var i=0;i<ul.childNodes.length;i++) {
            var li = ul.childNodes[i];
            li.onclick = function() { 
                funtab(this);
            };
        }
    
        function funtab(obj) {
            var tab = obj.parentNode;
            var target = document.getElementById("content").getElementsByTagName("ul")[0];
            for(var i=0;i<tab.childNodes.length;i++) {
                if(tab.childNodes[i] == obj) {
                    tab.childNodes[i].className = "cur";
                    target.childNodes[i].className = "cur";
                }
                else {
                    tab.childNodes[i].className = "";
                    target.childNodes[i].className = "";
                }
            }
        }
    </script>

    </form>
</body>
</html>
