<%@ Page Title="" Language="VB" MasterPageFile="~/App_MasterPage/mpManager.master" AutoEventWireup="false" CodeFile="VoteQuestion.aspx.vb" Inherits="Manager_Vote_VoteQuestion" %>
<%@ Register assembly="ControlPageing" namespace="ControlPageing" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="chpPageTitle" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="chpHead" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="chpScript" Runat="Server"></asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="chpTitle" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="chpContent" Runat="Server">
    <asp:MultiView ID="MultiView1" runat="server">
        <asp:View ID="View_Edit" runat="server">
<script type="text/javascript" src="/App_Themes/ManagerTheme/Js/jquery.min.js"></script> 
<script type="text/javascript" src="/App_Themes/ManagerTheme/js/lhgdialog.min.js"></script>
<script type="text/javascript" src="/App_Themes/ManagerTheme/js/JSON.js"></script>
<script type="text/javascript" src="/App_Themes/ManagerTheme/js/Vote.js"></script>
<script language="javascript" type="text/javascript">
    var hfOptionTypeID = '<%=hfOptionType.ClientID %>';
    var hfOptionsID = '<%=hfOptions.ClientID %>';
    var hfRightID = '<%=hfRight.ClientID %>';
    var SitePath = '/Sites/Site<%=BaseFunction.PublicMethod.GetApplication("SiteID") %>/Upload/';
    var QusPicID = '<%=txtQuestionPic.ClientID %>';
    $(document).ready(function() {
        var typeValue = $('#' + hfOptionTypeID).attr('value');
        if (typeValue == '' || typeValue == null) {
            typeValue = 'radio';
            $('#' + hfOptionTypeID).attr('value', 'radio');
            $('input[type="radio"][value="0"]').attr('checked', 'checked');
        } else {
            var mValue;
            if (typeValue == 'radio') {
                mValue = '0';
            } else {
                mValue = '1';
            }
            $('input[name="QuestionType"]').each(function() {
                if (this.value == mValue) {
                    $(this).attr('checked', true);
                } else {
                    $(this).attr('checked', false);
                }
            });
        }
        InsertOption(typeValue);
        $('#<%=imgSave.ClientID %>').bind('click', function() { SaveOption(); });
    });
</script>
            <asp:HiddenField ID="hfOptionType" runat="server" Value="" />
            <asp:HiddenField ID="hfOptions" runat="server" Value="" />
            <asp:HiddenField ID="hfRight" runat="server" Value="" />
<table border="0" cellpadding="0" cellspacing="0" width="100%" id="table4">
	<tr>
		<td width="10%" align="right" class="edittd">题目类型：</td>
		<td align="left"><input type="radio" value="0" name="QuestionType" onclick="InsertOption('radio')" />单选题&nbsp; <input type="radio" value="1" name="QuestionType" onclick="InsertOption('checkbox')" />多选题</td>
	</tr>
	<tr>
		<td align="right" width="10%" class="edittd">问题：</td>
		<td align="left"  class="left_bt2">
		<asp:TextBox ID="txtQuestionTitle" Width="220px" runat="server" ></asp:TextBox></td>
	</tr>
	<tr>
        <td align="right" class="edittd" width="10%">图片：</td>
        <td align="left" class="left_bt2">
        <asp:TextBox ID="txtQuestionPic" Width="220px" runat="server" ></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;<span title="插入网上图片，支持格式为：gif、jpg、bmp" onclick="javascript:SetPic('<%=txtQuestionPic.ClientID %>');" style="cursor: hand; line-height:30px">选择图片</span></td>
    </tr>
	<tr>
        <td align="right" class="edittd" width="10%">分数：</td>
        <td align="left" class="left_bt2"><asp:TextBox ID="txtIntegral" Width="100px" runat="server" onkeypress="event.returnValue=IsDigit();" Text="0"></asp:TextBox></td>
    </tr>
	<tr>
        <td id="QusTitle" align="right"  width="10%" class="edittd">备选项：</td>
        <td align="left" class="left_bt2">
        </td>
    </tr>
	<tr>
		<td align="right"></td>
		<td align="left">
		    <ul id="QusOption"></ul>
		    <div id="button" style="width:240px; text-align:center;">
		    <img src="/App_Themes/ManagerTheme/Images/MoreOption.gif" alt="增加选项" id="imgMore" style="cursor:hand;" onclick="MoreOption();" />
		    <img src="/App_Themes/ManagerTheme/Images/LessOption.gif" alt="减少选项" id="imgLess" style="cursor:hand;" onclick="LessOption();" />
		    <asp:ImageButton ID="imgSave" runat="server" ImageUrl="~/App_Themes/ManagerTheme/Images/AddOption.gif" style="height: 22px" ToolTip="添加" />
            </div>
		</td>
	</tr>
</table>
  
        </asp:View>
        <asp:View ID="View_List" runat="server">
    	    <div style="text-align: right; " class="edittd">
        	<asp:CheckBox ID="cbSelectAll" runat="server" AutoPostBack="True" Text="全部" />&nbsp;
        	<asp:LinkButton ID="lnkBtnDel" runat="server"><img src="/App_Themes/ManagerTheme/Images/Delete.gif" style=" border:0px"/>&nbsp;删除选中</asp:LinkButton>&nbsp;&nbsp;
        	<a href="/Manager/Vote/VoteQuestion.aspx?Action=Add&SubID=<%=Request("SubID") %>"><img src="/App_Themes/ManagerTheme/Images/add.gif" style=" border:0px" />&nbsp;添加</a>
    	    </div>       
            <asp:Repeater ID="rptList" runat="server">
                <HeaderTemplate>
                    <table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0" class="line_table">
			<tr>
			    <td width="5%" align="center" class="left_bt2">选择</td>
			    <td width="45%" align="left" class="left_bt2">题目</td>
			    <td width="15%" align="center" class="left_bt2">类型</td>
			    <td width="15%" align="center" class="left_bt2">分数</td>
			    <td align="center" width="20%" class="left_bt2">操作</td>
			</tr>
	        </HeaderTemplate>
                <ItemTemplate>
                    <tr class="menuout"   onMouseOver="this.className='menuin'" onMouseOut="this.className='menuout'">
			<td width="5%" align="center"><asp:CheckBox ID="CheckOn" runat="server" ToolTip='<%#Eval("ID")%>' /></td>
			<td width="45%" align="left"><%#Eval("Title")%></td>
			<td width="15%" align="center"><%#NameToString(Eval("VoteType"))%></td>
			<td width="15%" align="center"><%#Eval("Integral")%></td>
			<td width="20%" align="center">
			<a href="/Manager/Vote/VoteQuestion.aspx?Action=Edit&ID=<%#Eval("ID") %>&SubID=<%=Request("SubID") %>"><img src="/App_Themes/ManagerTheme/Images/Edit.gif" style=" border:0px" />&nbsp;编辑</a>&nbsp;&nbsp;&nbsp;
			<a href="/Manager/Vote/VoteQuestion.aspx?Action=Del&ID=<%#Eval("ID") %>"><img src="/App_Themes/ManagerTheme/Images/Delete.gif" style=" border:0px" />&nbsp;删除</a></td>
			        </tr>
                </ItemTemplate>
                <FooterTemplate></table></FooterTemplate>
            </asp:Repeater>
            <div style="text-align:center"> <cc1:iPaging ID="ListPaging" runat="server" /></div>        
        </asp:View>        
    </asp:MultiView>
</asp:Content>

