<%@ page language="C#" autoeventwireup="true" inherits="V5Shop.Admin.Other_Vote_Operate, V5Shop.Shop.Others" enableviewstatemac="false" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register Src="control/HiddenField.ascx" TagName="HiddenField" TagPrefix="uc1" %>
<%@ Register TagPrefix="V5Shop" Namespace="V5Shop.Control" Assembly="V5Shop.Control" %>
<%@ Register Src="control/PageBottom.ascx" TagName="PageBottom" TagPrefix="uc1" %>
<%@ Register Assembly="V5Shop.Control" Namespace="V5Shop.Control" TagPrefix="cc1" %>
<!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 runat="server">
    <title>投票添加/编辑页面</title>
    <link href="css/css.css" rel="stylesheet" type="text/css" />
    <link href="css/css_list.css" rel="stylesheet" type="text/css" />
    <link href="css/control.css" rel="stylesheet" type="text/css" />

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

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

</head>
<body>
    <form id="form1" runat="server">
        <div class="OperateTitle">
            <div>
                <asp:Label ID="lblAdd" runat="server" Text="【 在线调查添加 】"></asp:Label>
                <asp:Label ID="lblEdit" runat="server" Text="【 在线调查编辑 】" Visible="false"></asp:Label>
                <a href="Other_Vote_Manage.aspx" title="返回在线调查列表">返回列表</a>
            </div>
        </div>
        <div>
            <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" id="OperateTable">
                <tr>
                    <td align="right" bgcolor="#FFFFFF" style="height: 30px; width: 20%;">
                        <asp:Label ID="lblTitle" runat="server" Text="调查主题："></asp:Label>
                    </td>
                    <td bgcolor="#FFFFFF" align="left" style="height: 30px">
                        <asp:TextBox ID="txtTitle" runat="server" MaxLength="50" Width="300px"></asp:TextBox>
                        <span class="NeedMsg">*<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                            ControlToValidate="txtTitle" ErrorMessage="不能为空"></asp:RequiredFieldValidator></span>&nbsp;
                    </td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#FFFFFF" style="height: 30px; width: 20%;">
                        <asp:Label ID="lblStartDate" runat="server" Text="开始日期："></asp:Label>
                    </td>
                    <td bgcolor="#FFFFFF" align="left" style="height: 30px">
                        <asp:TextBox ID="txtStartDate" runat="server" Width="200px"></asp:TextBox>
                        <img id="sltStart" src="images/calendar1.gif" title="打开日历" alt="打开日历" align="absmiddle" />
                        <span class="NeedMsg">*</span>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtStartDate"
                            Display="Dynamic" ErrorMessage="日期格式不正确" ValidationExpression="^\d{4}-(\d{2}|\d{1})-(\d{2}|\d{1})( (\d{2}|\d{1}):(\d{2}|\d{1}):(\d{2}|\d{1}))*"></asp:RegularExpressionValidator>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtEndDate"
                            Display="Dynamic" ErrorMessage="不能为空"></asp:RequiredFieldValidator></td>
                </tr>
                <tr>
                    <td width="20%" align="right" bgcolor="#FFFFFF" style="height: 30px">
                        <asp:Label ID="lblEndDate" runat="server" Text="结束日期："></asp:Label>
                    </td>
                    <td bgcolor="#FFFFFF" align="left" style="height: 30px">
                        <asp:TextBox ID="txtEndDate" runat="server" Width="200px"></asp:TextBox>
                        <img id="sltEnd" src="images/calendar1.gif" title="打开日历" alt="打开日历" align="absmiddle" />
                        <span style="color: #ff0000">*</span>&nbsp;<asp:RegularExpressionValidator ID="RegularExpressionValidator2"
                            runat="server" ControlToValidate="txtEndDate" Display="Dynamic" ErrorMessage="日期格式不正确"
                            ValidationExpression="^\d{4}-(\d{2}|\d{1})-(\d{2}|\d{1})( (\d{2}|\d{1}):(\d{2}|\d{1}):(\d{2}|\d{1}))*"></asp:RegularExpressionValidator>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtEndDate"
                            Display="Dynamic" ErrorMessage="不能为空"></asp:RequiredFieldValidator></td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#ffffff" style="width: 20%; height: 30px" valign="top">
                        <V5Shop:HelpCtrl ID="HelpCtrl1" runat="server" FontColor="red" Header="调查选项" ImageURL="images/help.gif"
                            Text="此处可以添加选项供客户选择。如：您觉得v5shop8.0怎样等等。" />
                        <asp:Label ID="lblOption" runat="server" Text="调查选项："></asp:Label></td>
                    <td align="left" bgcolor="#ffffff" style="height: 30px">
                        <div class="listborder">
                            <V5Shop:V5ShopGridView ID="GridViewShow" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                                CssClass="datalist" HeaderStyle-Height="18px" HeaderStyle-ForeColor="#000" EmptyDataText="请添加主题选项"
                                TableName="VoteOption" BorderWidth="0px" CacheName="VoteOption" GridLines="None" PageSize="12"
                                Width="60%" PagerSettings-Visible="false">
                                <Columns>
                                    <asp:TemplateField>
                                        <itemstyle width="3%" />
                                        <itemtemplate>
                                <input runat="server" Value='<%# Eval("Id") %>' ID="CheckBoxID" type="checkbox" onmouseover="this.mouse='over'" onmouseout="this.mouse='out'" mouse="out" class="checkbox">
                            
</itemtemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="Id" HeaderText="ID">
                                        <itemstyle width="8%" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="Name" HeaderText="主题选项">
                                        
                                    </asp:BoundField>
                                    <asp:BoundField DataField="Count" HeaderText="投票数">
                                        <itemstyle width="12%" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="OrderId" HeaderText="排序">
                                        <itemstyle width="11%" />
                                    </asp:BoundField>
                                </Columns>
                                <PagerSettings Mode="NumericFirstLast" />
                                <HeaderStyle CssClass="category" ForeColor="Black" Height="18px" />
                            </V5Shop:V5ShopGridView>
                        </div>
                        <div id="hiddenfield">
                            <asp:HiddenField ID="CheckedIDS" runat="server" Value="0" />
                            <asp:HiddenField ID="PageIndex" runat="server" Value="0" />
                            <asp:HiddenField ID="MaxPageIndex" runat="server" Value="0" />
                            &nbsp;
                            <uc1:HiddenField ID="Alert" runat="server" />
                        </div>
                        <div style="padding: 3px 25px; color: #4B6888; border-bottom: 1px #CCCCCC solid">
                            <input type="checkbox" id="CheckAllBox" onclick="CheckAll()" class="checkbox" />
                            全选
        　    <asp:LinkButton ID="lbADD" runat="server" ForeColor="#4B6888" OnClick="lbADD_Click"
                                CausesValidation="False"><img src="images/icon/key_add.gif" /> 添加</asp:LinkButton>
        　    <asp:LinkButton ID="lbEdit" runat="server" ForeColor="#4B6888" OnClientClick="return CheckEdit()"
                                CausesValidation="False" OnClick="lbEdit_Click"><img src="images/icon/key_edit.gif" /> 编辑</asp:LinkButton>
        　    <asp:LinkButton ID="lbDel" runat="server" ForeColor="#4B6888" OnClientClick="return CheckDel()"
                                CausesValidation="False" OnClick="lbDel_Click"><img src="images/icon/key_delete.gif" /> 删除</asp:LinkButton>
        　    <asp:LinkButton ID="btnUp" runat="server" ForeColor="#4B6888" OnClick="btnUp_Click"
                                OnClientClick="return CheckUp()" CausesValidation="False" Visible="False"><img src="images/icon/key_top.gif" /> 向上</asp:LinkButton>
        　    <asp:LinkButton ID="btnDown" runat="server" ForeColor="#4B6888" OnClick="btnDown_Click"
                                OnClientClick="return CheckDown()" CausesValidation="False" Visible="False"><img src="images/icon/key_down.gif" /> 向下</asp:LinkButton>
                        </div>
                        <asp:Panel ID="AreaOption" Visible="false" runat="server">
                            <div>
                                <asp:Label ID="lblVoteOption" runat="server" Text="选项标题："></asp:Label>
                                <asp:TextBox ID="txtVoteOption" runat="server" MaxLength="30"></asp:TextBox></div>
                            <div>
                                <asp:Label ID="lblOptionOrderId" runat="server" Text="选项排序："></asp:Label>
                                <asp:TextBox ID="txtOptionOrderId" runat="server" MaxLength="20"></asp:TextBox></div>
                            <asp:Label ID="lblOptionCount" runat="server" Text="投票数量："></asp:Label>
                            <asp:TextBox ID="txtOptionCount" runat="server" MaxLength="20"></asp:TextBox>
                            <span class="NeedMsg">*</span>
                            <asp:Button ID="btnOptionAdd" runat="server" Text="确定" CssClass="button" CausesValidation="False"
                                OnClick="btnOptionAdd_Click" />
                            <asp:Button ID="btnOptionEdit" runat="server" Text="更新" CssClass="button" CausesValidation="False"
                                OnClick="btnOptionEdit_Click" Visible="False" />
                            </asp:Panel>
                    </td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#FFFFFF" style="height: 30px; width: 20%;">
                        <V5Shop:HelpCtrl ID="HelpCtrl2" runat="server" FontColor="red" Header="是否多选" ImageURL="images/help.gif"
                            Text="选中此项，用户可进行多项选择进行投票。否则，只能单选投票" />
                        <asp:Label ID="lblIsRadio" runat="server" Text="是否多选："></asp:Label>
                    </td>
                    <td bgcolor="#FFFFFF" align="left" style="height: 30px">
                        <span style="color: #ff0000"></span>
                        <input id="cbIsRadio" class="checkbox" type="checkbox" runat="server" value="1" /></td>
                </tr>
                <tr>
                    <td align="right" bgcolor="#FFFFFF" style="width: 20%; height: 30px;">
                    </td>
                    <td bgcolor="#FFFFFF" align="left" style="height: 30px">
                        <asp:Button ID="btnAdd" runat="server" Text="确定" OnClick="btnAdd_Click" CssClass="button" />
                        <asp:Button ID="btnEdit" runat="server" Text="更新" OnClick="btnEdit_Click" Visible="False"
                            CssClass="button" />
                        <input id="iptReset" runat="server" type="reset" value="重置" class="button" />
                        <input id="btnReturn" runat="server" type="button" value="返回列表" onclick="window.location.href='Other_Vote_Manage.aspx'"
                            class="button" />
                    </td>
                </tr>
            </table>

            <script type="text/javascript">
            //加TABLE样式
            InitTrClass();
           Calendar.setup({
	                inputField     :    "txtStartDate",
	                ifFormat       :    "%Y-%m-%d", 
	                button         :    "sltStart",
	                align          :    "Br",
	                singleClick    :    true
           });
           Calendar.setup({
	                inputField     :    "txtEndDate",
	                ifFormat       :    "%Y-%m-%d", 
	                button         :    "sltEnd",
	                align          :    "Br",
	                singleClick    :    true
                });
            </script>

        </div>
    </form>
    <uc1:PageBottom ID="PageBottom1" runat="server" />
</body>
</html>
