<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VoteControl.ascx.cs"
    Inherits="PowerEasy.Module.General.WebSite.Admin.Controls.Contents.VoteControl" %>
<tr class="tdbg">
    <td class="tdbgleft" style="width:23%">
        <strong>启用投票：</strong>
    </td>
    <td style="width:77%">
        <asp:CheckBox ID="ChkIsAlive" runat="server" />
    </td>
</tr>
<tr class="tdbg">
    <td class="tdbgleft">
        <strong>投票主题：</strong>
    </td>
    <td>
        <asp:TextBox ID="TxtVoteTitle" runat="server" TextMode="multiline" Height="49px"
            Width="308px"></asp:TextBox>
    </td>
</tr>
<tr>
<td colspan="2">
<asp:UpdatePanel ID="UpdatePanelvoteItem2" runat="server" UpdateMode="Conditional">
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="VoteItems" />
    </Triggers>
    <ContentTemplate>
        <pe:ExtendedRepeater runat="server" ID="VoteItems" OnItemDataBound="VoteItems_OnItemDataBound"
            OnItemCommand="VoteItems_OnItemCommand">
            <HeaderTemplate>
                        <table width="100%" border="0" cellpadding="2" cellspacing="0">
            </HeaderTemplate>
            <ItemTemplate>
                <tr class="tdbg">
                    <pe:ExtendedLiteral runat="server" ID="LitItemTd" HtmlEncode="false"></pe:ExtendedLiteral>
                    <td style="width:77%">
                        <asp:TextBox ID="TxtItem" runat="server"></asp:TextBox>&nbsp;票数：
                        <asp:TextBox ID="TxtVoteNumber" runat="server"></asp:TextBox>
                        <span style="cursor: pointer;" onclick="moveUp(this)">
                            <img border="0" align="absmiddle" src="<%=BasePath %>Admin/Images/icon_up.gif" alt="上移项目"
                                title="上移项目"></span> <span style="cursor: pointer;" onclick="moveDown(this)">
                                    <img border="0" align="absmiddle" src="<%=BasePath %>Admin/Images/icon_down.gif"
                                        alt="下移项目" title="下移项目"></span> <span style="cursor: pointer;">
                                            <asp:ImageButton runat="server" ID="ItemAdd" CommandName="CmdItemAdd" ToolTip="增加项目"
                                                ImageAlign="AbsMiddle" CausesValidation="False"/></span> <span style="cursor: pointer;">
                                                    <asp:ImageButton runat="server" ID="ItemDel" CommandName="CmdItemDel" ToolTip="删除项目"
                                                        ImageAlign="AbsMiddle" CausesValidation="False"/></span>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                            </table>
            </FooterTemplate>
        </pe:ExtendedRepeater>
    </ContentTemplate>
</asp:UpdatePanel>
<script type="text/javascript">
    function moveUp(obj) {
        var ptr = $(obj).parent().parent().prev();
        if (ptr != null) {
            var oldTxtItem = $(obj).parent().find("input[id$=TxtItem]");
            var oldTxtVoteNumber = $(obj).parent().find("input[id$=TxtVoteNumber]");
            var newTxtItem = $(ptr).find("input[id$=TxtItem]");
            var newTxtVoteNumber = $(ptr).find("input[id$=TxtVoteNumber]");
            var tempTxtItem, tempTxtVoteNumber;
            tempTxtItem = $(oldTxtItem).val();
            tempTxtVoteNumber = $(oldTxtVoteNumber).val();
            $(oldTxtItem).val($(newTxtItem).val());
            $(oldTxtVoteNumber).val($(newTxtVoteNumber).val());
            $(newTxtItem).val(tempTxtItem);
            $(newTxtVoteNumber).val(tempTxtVoteNumber);
        }
    }
    function moveDown(obj) {
        var ntr = $(obj).parent().parent().next();
        if (ntr != null) {
            var oldTxtItem = $(obj).parent().find("input[id$=TxtItem]");
            var oldTxtVoteNumber = $(obj).parent().find("input[id$=TxtVoteNumber]");
            var newTxtItem = $(ntr).find("input[id$=TxtItem]");
            var newTxtVoteNumber = $(ntr).find("input[id$=TxtVoteNumber]");
            var tempTxtItem, tempTxtVoteNumber;
            tempTxtItem = $(oldTxtItem).val();
            tempTxtVoteNumber = $(oldTxtVoteNumber).val();
            $(oldTxtItem).val($(newTxtItem).val());
            $(oldTxtVoteNumber).val($(newTxtVoteNumber).val());
            $(newTxtItem).val(tempTxtItem);
            $(newTxtVoteNumber).val(tempTxtVoteNumber);
        }
    }
</script>
</td>
</tr>
<tr class="tdbg">
    <td class="tdbgleft">
        <strong>选项类型：</strong>
    </td>
    <td>
        <asp:DropDownList ID="DropItemType" runat="server">
            <asp:ListItem Value="0" Text="单选框" Selected="true"></asp:ListItem>
            <asp:ListItem Value="1" Text="复选框"></asp:ListItem>
        </asp:DropDownList>
    </td>
</tr>
<tr class="tdbg" id="item">
    <td class="tdbgleft">
        <strong>投票开始的时间：</strong>
    </td>
    <td>
        <pe:DatePicker ID="DpkStartTime" DateFormat="yyyy-MM-dd HH:mm:ss" runat="server"></pe:DatePicker>
    </td>
</tr>
<tr class="tdbg">
    <td class="tdbgleft">
        <strong>投票结束的时间：</strong>
    </td>
    <td>
        <pe:DatePicker ID="DpkEndTime" DateFormat="yyyy-MM-dd HH:mm:ss" runat="server"></pe:DatePicker>
    </td>
</tr>
