<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="exampapertypeitemmanage.aspx.cs" Inherits="School_Web.admin.exam.exampapertypeitemmanage" %>


<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<!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">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>题型信息</title>
    <asp:Literal ID="litregscript" runat="server" Text=""></asp:Literal>
   <link href="../style/green/style.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="/admin/js/System.js" type="text/javascript"></script>
<script  language="javascript" src="/editor/xheditor.js" type="text/javascript" ></script>
<script src="../js/jquery/jquery.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
    //请求数量
    function jsShowCount(sid) {
        var PType = $("#drpTID").val();
        $.ajax({
            type: "POST",
            url: "exambaseajax.aspx",
            data: "key=1&para=" + sid + "&type=" + PType,
            success: function(msg) {
                var strs = msg.split(",")
                $("#litSIDCount1").html(strs[0]);
                $("#litSIDCount2").html(strs[1]);
                $("#litSIDCount3").html(strs[2]);
            }
        });
    }
    
    //判断页面选择类型
    function jsShowDrpPCType() {
        var pcType = $("#drpPCType").val();
        if (pcType == "1" || pcType == "3") {
            $("#highbody").hide();
        }
        if (pcType == "2") {
            jsShowCount($("#txtSIDList").val())
            $("#highbody").show();
        }
    }


    $(document).ready(function() {
        jsShowDrpPCType();
        $("#drpPCType").change(function() {
            jsShowDrpPCType();
        });
        $("#drpTID").change(function() {
            jsShowDrpPCType();
        });
    });

    function jscheckAll() {
        var bReturn = true;
        var pcType = $("#drpPCType").val();
        var PType = $("#drpTID").val();
        if (PType == "") {
            alert("对不起，题型类型必须选择！");
            $("#drpTID")[0].focus();
            return false;
        }
        if (pcType == "2") {
            if ($("#txtSIDListName").val() == "") {
                alert("对不起，出题领域必须选择！");
                $("#txtSIDListName")[0].focus();
                bReturn = false;
            }
           
            if (parseInt($("#txtTCount1").val()) > parseInt($("#litSIDCount1").html())) {
                alert("对不起，基础题的出题个数大于题库数量，请修改后提交!");
                $("#txtTCount1")[0].focus();
                bReturn = false;
            }
            if (parseInt($("#txtTCount2").val()) > parseInt($("#litSIDCount2").html())) {
                alert("对不起，中级题的出题个数大于题库数量，请修改后提交!");
                $("#txtTCount2")[0].focus();
                bReturn = false;
            }
            if (parseInt($("#txtTCount3").val()) > parseInt($("#litSIDCount3").html())) {
                alert("对不起，拔高题的出题个数大于题库数量，请修改后提交!");
                $("#txtTCount3")[0].focus();
                bReturn = false;
            }

            var pCount = parseInt($("#txtTCount1").val()) + parseInt($("#txtTCount2").val()) + parseInt($("#txtTCount3").val());
            if (pCount <= 0) {
                alert("对不起，出题总数量不能等于零，请修改后提交!");
                bReturn = false;
            }
        }

        if (bReturn) {
            bReturn = window.confirm("您确实要提交题型数据吗？");
        }
        
        return bReturn;
    }

    function opJsTree() {
        var para = "?para=1&list=" + $("#txtSIDList").val();
        //alert(para);
        UsOpenDialogTree(para, 'txtSIDListName')
    }
</script>

</head>
<body onload="win_onLoad();">
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
        <ProgressTemplate>
            <div id="divLoading">
                <img src="/admin/style/default/images/loading.gif" />
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <div id="tbMain">
        <div class="divTbg">
            <div class="divTbgL">
            </div>
            <div class="divTbgInfo">
                <div class="divTbgTitle">
                    题型管理</div>
            </div>
        </div>
        <div class="divTbgF">
        </div>
        <div class="divTNavBG" id="topURL">
            <ul id="topURLul">
                <li class="divURLed" id="div1">
                    <div>
                        <img src="../style/default/images/mini_icons_046.gif" width="10" height="10" />
                        基本信息</div>
                </li>
            </ul>
        </div>
        <div id="mypanel">
            <div class="divInfoContext">
                <div class="divInfo">
                    <div class="divInfoblack">
                        <div class="divInfoTopList">
                            <div class="listLeft">
                                <div class="navtitle">
                                    题型信息</div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="divInfo">
                    <table width="100%" border="0" cellpadding="0" cellspacing="1" class="tablist" id="mainlist"
                        >
                        <tr class="tablisttr">
                            <td class="tablisttitle"  style="width:100px">
                                题型标题</td>
                            <td class="tabmanagertr">
                                <asp:TextBox ID="txtTName" runat="server" CssClass="1" ToolTip="题型名称"></asp:TextBox>
                            </td>
                            <td class="tablisttitle">
                                题型类型</td>
                            <td class="tabmanagertr">
                                <asp:DropDownList ID="drpTID" runat="server">
                                            <asp:ListItem Value="ExamTID">code</asp:ListItem>
                        </asp:DropDownList>
                            </td>
                        </tr>
                        <tr class="tablisttr">
                            <td class="tablisttitle">
                                副标题 </td>
                            <td class="tabmanagertr" colspan="3">
                                <asp:TextBox ID="txtTAddName" runat="server" ToolTip="副标题" TextMode="MultiLine" Height="60px" Width="100%" ></asp:TextBox></td>
                        </tr>
                        <tr class="tablisttr">
                            <td class="tablisttitle">
                                题型排序</td>
                            <td class="tabmanagertr">
                                <asp:TextBox ID="txtShowID" runat="server" CssClass="2" ToolTip="题型排序"></asp:TextBox>
                            </td>
                            <td class="tablisttitle">
                                每题分数</td>
                            <td class="tabmanagertr">
                                <asp:TextBox ID="txtTScore" runat="server" CssClass="2" ToolTip="每题分数"></asp:TextBox>
                            </td>
                        </tr>
                        <tr class="tablisttr">
                            <td class="tablisttitle">
                                题型说明</td>
                            <td class="tabmanagertr" colspan="3">
                                <asp:TextBox ID="txtTInfo" runat="server" ToolTip="题型说明" TextMode="MultiLine" Height="100px" Width="100%" class="xheditor {upLinkUrl:s_upLinkUrl,upLinkExt:s_upLinkExt,upImgUrl:s_upLinkUrl,upImgExt:s_upImgExt,upFlashUrl:s_upLinkUrl,upFlashExt:s_upFlashExt,upMediaUrl:s_upLinkUrl,upMediaExt:s_upMediaExt}"></asp:TextBox></td>
                        </tr>
                        <tr class="tablisttr">
                            <td class="tablisttitle">
                                出题方式</td>
                            <td class="tabmanagertr">
                               <asp:DropDownList ID="drpPCType" runat="server" Enabled="false">
                                            <asp:ListItem Value="PCType">code</asp:ListItem>
                        </asp:DropDownList></td>
                            <td class="tablisttitle">
                                &nbsp;</td>
                            <td class="tabmanagertr">
                                </td>
                        </tr>
                        <tbody id="highbody" style="display:none">
                        <tr class="tablisttr">
                            <td class="tablisttitle">
                                抽题领域</td>
                            <td class="tabmanagertr"  colspan="3">
                               <asp:TextBox ID="txtSIDListName" runat="server" Width="90%"></asp:TextBox>
                               
                               <a href="javascript:opJsTree();">[选择]</a></td>
                           
                        </tr>
                        <tr class="tablisttr">
                            <td class="tablisttitle">
                                抽题数量</td>
                            <td class="tabmanagertr" colspan="3">
                                基础题:<asp:TextBox ID="txtTCount1" runat="server" CssClass="2" ToolTip="基础题">0</asp:TextBox>/<asp:Label ID="litSIDCount1" runat="server" ForeColor="Red">0</asp:Label>
                                中级题:<asp:TextBox ID="txtTCount2" runat="server" CssClass="2" ToolTip="中级题">0</asp:TextBox>/<asp:Label ID="litSIDCount2" runat="server" ForeColor="Red">0</asp:Label>
                                拔高题:<asp:TextBox ID="txtTCount3" runat="server" CssClass="2" ToolTip="拔高题">0</asp:TextBox>/<asp:Label ID="litSIDCount3" runat="server" ForeColor="Red">0</asp:Label>
                            
                            <div style="display:none"><asp:TextBox ID="txtSIDList" runat="server"></asp:TextBox></div>
                            </td>
                           
                        </tr>
                        </tbody>
                        
                        
                    </table>
                    <div class="divSave">
                        <asp:Button ID="btnSubmit" runat="server" Text="保存(S)" CssClass="SkyButtonFocus"
                            OnClick="btnSubmit_Click" />
                        <asp:Button ID="btnExit" runat="server" Text="取消(C)" CssClass="SkyButtonFocus" OnClick="btnSubmit_Click" />
                    </div>
                </div>
            </div>
        </div>
    </div>
    </div>
    </form>
</body>
</html>

