<%@ Page Language="C#" %>
<%@ Register TagPrefix="aspxform" Namespace="XFormDesigner.Framework.Web.UI" Assembly="XFormDesigner.Framework" %>
<script runat="server">

    // Insert page code here
    //
    
    
    // Insert page code here
    //

</script>
<html xmlns:xform="xmlns:xform">
<head runat="server">
    <link href="/Oimec/Styles/css/StyleSheet.css" rel="stylesheet" type="text/css" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <title>BPM Form</title>
    <style>
        BODY {
            FONT-SIZE: 12px;
            FONT-FAMILY: verdana;
        }

        TABLE {
            border-collapse: collapse;
            FONT-SIZE: 12px;
            FONT-FAMILY: verdana;
        }

        P {
            PADDING-RIGHT: 0px;
            PADDING-LEFT: 0px;
            PADDING-BOTTOM: 0px;
            MARGIN: 0px;
            PADDING-TOP: 0px;
            FONT-SIZE: 12px;
            FONT-FAMILY: verdana;
        }

        TD {
            padding: 1px;
        }

            TD.NoPadding {
                PADDING-RIGHT: 0px;
                PADDING-LEFT: 0px;
                PADDING-BOTTOM: 0px;
                PADDING-TOP: 0px;
            }
        /*INPUT {height: 15px}*/
        INPUT.UL {
            BORDER-RIGHT: medium none;
            BORDER-TOP: medium none;
            BORDER-LEFT: medium none;
            BORDER-BOTTOM: #33ff33 1px solid;
        }

        TEXTAREA {
            FONT-SIZE: 12px;
        }

        input {
            vertical-align: middle; /*margin-right:-3px*/
        }
    </style>

    <script type="text/javascript">
        Ext.onReady(function () {
            var stepName = agent.Eles[document.getElementById("XTextBox5").getAttribute("xform_xele_index")].getValue();
            var state = request("formstate");
            var tableObj = document.getElementById('tablenew');
            if (stepName == "提交信息") {
                if (tableObj.rows.length <= 3) { // 若数据已保存到数据库则不进行刷新
                    XFormOnChange(agent.Eles[document.getElementById("XLabel2").getAttribute("xform_xele_index")]);
                    XFormOnChange(agent.Eles[document.getElementById("XDropDownList3").getAttribute("xform_xele_index")]);
                }
            }
        });


        function IsChecked(OptionsID, checkbox, lineNo) {
            var stepName = agent.Eles[document.getElementById("XTextBox5").getAttribute("xform_xele_index")].getValue();
            if (stepName == "提交信息") {
                var tableObj = document.getElementById('tablenew');
                var row = lineNo + 1;
                if (checkbox == "1") {
                    var Answer = agent.Eles[tableObj.rows[row].cells[3].children[0].getAttribute("xform_xele_index")].getValue();
                    Answer = Answer + OptionsID;
                    agent.Eles[tableObj.rows[row].cells[3].children[0].getAttribute("xform_xele_index")].setValue(Answer);
                }
                else {
                    var Answer = agent.Eles[tableObj.rows[row].cells[3].children[0].getAttribute("xform_xele_index")].getValue();
                    Answer = Answer.replace(OptionsID, "");
                    agent.Eles[tableObj.rows[row].cells[3].children[0].getAttribute("xform_xele_index")].setValue(Answer);
                }
            }

        }


        agent.on('Submit', function (action, actionname) {
            //alert(actionname);
        });

        function request(paras) {
            var url = location.href;
            var paraString = url.substring(url.indexOf("?") + 1, url.length).split("&");
            var paraObj = {};
            for (i = 0; j = paraString[i]; i++) {
                paraObj[j.substring(0, j.indexOf("=")).toLowerCase()] = j.substring(j.indexOf("=") + 1, j.length);
            }
            var returnValue = paraObj[paras.toLowerCase()];
            if (typeof (returnValue) == "undefined")
            { return ""; }
            else
            { return returnValue; }
        }
    </script>
</head>
<body>
    <form runat="server">
        <!-- Insert content here -->
        <table width="1200" align="center" class="head" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td class="logo">
                    </td>
                    <td class="biaoti" style="PADDING-LEFT: 30px">
                        <asp:Label id="Label1" runat="server" text="考题信息表"></asp:Label></td>
                    <td class="formno">
                        <asp:Label id="Label6" runat="server" text="表单号："></asp:Label>
                        <aspxform:XLabel id="XLabel3" runat="server" BackColor="#8AB3DF" Value ValueToDisplayText XDataBind="DF_OA_ExaminationApp_Info.FormNo" Text="--系统自动生成--"></aspxform:XLabel>
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <table width="1192" class="table" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr class="title1">
                    <td height="21" colspan="4">
                        <asp:Label id="Label2" runat="server" text="基本信息"></asp:Label>
                        <aspxform:XTextBox id="XTextBox5" runat="server" XDataBind="Global.StepName" HiddenInput="True" BorderColor="#DCDCDC" BorderWidth="1" Width="50px"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td width="131" height="22" class="tsbottomlabel">
                        <asp:Label id="Label8" runat="server" text="提交人"></asp:Label>
                        <aspxform:XLabel id="XLabel2" runat="server" BackColor="#D4E4FE" XDataBind="DF_OA_ExaminationApp_Info.AppAccount" HiddenExpress="1"></aspxform:XLabel>
                    </td>
                    <td width="465" class="tsbottomtext">
                        <aspxform:XLabel id="XLabel1" runat="server" BackColor="#D4E4FE" XDataBind="DF_OA_ExaminationApp_Info.AppName"></aspxform:XLabel>
                    </td>
                    <td width="131" class="tsbottomlabel">
                        <asp:Label id="Label9" runat="server" text="创建时间"></asp:Label></td>
                    <td width="465" class="tsbottomtext">
                        <aspxform:XLabel id="XLabel9" runat="server" BackColor="#D4E4FE" XDataBind="DF_OA_ExaminationApp_Info.CreateTime"></aspxform:XLabel>
                    </td>
                </tr>
                <tr>
                    <td height="21" class="tsbottomlabel">
                        <asp:Label id="Label11" runat="server" text="BU"></asp:Label>
                        <aspxform:XDropDownList id="XDropDownList1" runat="server" HiddenExpress="1" XDataSource="TableName:V_DF_HR_BasicInfo;Filter:AttendanceKakaNO->DF_OA_ExaminationApp_Info.AppAccount" DataMap="BUName->DF_OA_ExaminationApp_Info.BU;Department->DF_OA_ExaminationApp_Info.Department"></aspxform:XDropDownList>
                    </td>
                    <td class="tsbottomtext">
                        <aspxform:XLabel id="XLabel7" runat="server" BackColor="#D4E4FE" XDataBind="DF_OA_ExaminationApp_Info.BU"></aspxform:XLabel>
                    </td>
                    <td class="tsbottomlabel">
                        <asp:Label id="Label10" runat="server" text="提交时间"></asp:Label></td>
                    <td class="tsbottomtext">
                        <aspxform:XLabel id="XLabel10" runat="server" BackColor="#D4E4FE" XDataBind="DF_OA_ExaminationApp_Info.CompletionTime"></aspxform:XLabel>
                    </td>
                </tr>
                <tr>
                    <td height="20" class="tsbottomlabel">
                        <asp:Label id="Label12" runat="server" text="部门"></asp:Label></td>
                    <td class="tsbottomtext">
                        <aspxform:XLabel id="XLabel8" runat="server" BackColor="#D4E4FE" XDataBind="DF_OA_ExaminationApp_Info.Department"></aspxform:XLabel>
                        <aspxform:XTextBox id="XTextBox3" runat="server" XDataBind="DF_OA_ExaminationApp_Info.IsPreserve" HiddenInput="True" BorderColor="#DCDCDC" BorderWidth="1" Width="50px"></aspxform:XTextBox>
                    </td>
                    <td class="tsbottomlabel">
                        <asp:Label id="Label13" runat="server" text="考卷编号"></asp:Label></td>
                    <td class="tsbottomtext">
                        <aspxform:XDropDownList id="XDropDownList3" runat="server" XDataBind="DF_OA_ExaminationApp_Info.PaperID" XDataSource="TableName:DF_OA_ExaminationPaper" DisableExpress="1" ValueColumn="ID" DisplayColumn="ExaminationPaperName"></aspxform:XDropDownList>
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <table width="1200" align="left" id="tablenew" border="0" cellspacing="0" cellpadding="0" xdatasource="TableName:DF_OA_ExaminationQuestionInfo;Filter:PaperID->DF_OA_ExaminationApp_Info.PaperID" datamap="ID->DF_OA_ExaminationApp_Detail.QuestionID;Contents->DF_OA_ExaminationApp_Detail.Contents;Score->DF_OA_ExaminationApp_Detail.Score;Answer->DF_OA_ExaminationApp_Detail.Answer" dynamicarea="2,1" emptygrid="KeepEmpty">
            <tbody>
                <tr class="title1">
                    <td height="16" colspan="4">
                        <asp:Label id="Label3" runat="server" text="考题信息"></asp:Label></td>
                </tr>
                <tr align="center">
                    <td width="177" height="17" class="tds">
                        <asp:Label id="Label27" runat="server" text="考题编号"></asp:Label></td>
                    <td width="747" class="tds">
                        <asp:Label id="Label5" runat="server" text="考题内容"></asp:Label></td>
                    <td width="136" class="tds">
                        <asp:Label id="Label4" runat="server" text="考题分值"></asp:Label></td>
                    <td width="136" class="tds" hiddenexpress='Global.StepName=="提交信息"'>
                        <asp:Label id="Label33" runat="server" text="得分"></asp:Label></td>
                </tr>
                <tr>
                    <td height="85" align="center" class="tds1">
                        <aspxform:XTextBox id="XTextBox2" runat="server" XDataBind="DF_OA_ExaminationApp_Detail.QuestionID" HiddenInput="True" BorderColor="#DCDCDC" BorderWidth="1" Width="50px"></aspxform:XTextBox>
                        <aspxform:XGridLineNo id="XGridLineNo2" runat="server" BackColor="#E9F1F4" XDataBind="DF_OA_ExaminationApp_Detail.LineID" BorderWidth="1px" Width="20px" BorderStyle="None" TextAlign="Center">1</aspxform:XGridLineNo>
                        <aspxform:XTextBox id="XTextBox4" runat="server" XDataBind="DF_OA_ExaminationApp_Detail.PaperID" HiddenInput="True" BorderColor="#DCDCDC" BorderWidth="1" Width="50px" Express="DF_OA_ExaminationApp_Info.PaperID"></aspxform:XTextBox>
                    </td>
                    <td class="tds1">
                        <aspxform:XLabel id="XLabel6" runat="server" BackColor="#E9F1F4" XDataBind="DF_OA_ExaminationApp_Detail.Contents"></aspxform:XLabel>
                        &nbsp;<br />
                        <table width="100%" id="tableOptions" border="0" cellspacing="0" cellpadding="0" xdatasource="TableName:DF_OA_ExaminationQuestionsOptions;Filter:QuestionsID->DF_OA_ExaminationApp_Detail.QuestionID" datamap="OptionsID->DF_OA_ExaminationApp_Detail1.OptionsID;OptionsContent->DF_OA_ExaminationApp_Detail1.OptionsContent" dynamicarea="0,1">
                            <tbody>
                                <tr>
                                    <td width="50" align="left" class="tds1" style="BORDER-TOP: medium none; BORDER-RIGHT: medium none; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none">
                                        <aspxform:XCheckBox id="XCheckBox1" style="HEIGHT: 19px; WIDTH: 20px" runat="server" XDataBind="DF_OA_ExaminationApp_Detail1.IsChecked" Width="20px" DisableExpress='Global.StepName!="提交信息"'></aspxform:XCheckBox>
                                        <aspxform:XLabel id="XLabel5" runat="server" BackColor="#E9F1F4" XDataBind="DF_OA_ExaminationApp_Detail1.OptionsID"></aspxform:XLabel>
                                        <br />
                                        <aspxform:XLabel id="XLabel15" runat="server" BackColor="#E9F1F4" XDataBind="DF_OA_ExaminationApp_Detail1.QuestionID"></aspxform:XLabel>
                                    </td>
                                    <td width="671" align="left" class="tds1" style="BORDER-TOP: medium none; BORDER-RIGHT: medium none; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none">
                                        <aspxform:XLabel id="XLabel11" runat="server" BackColor="#E9F1F4" XDataBind="DF_OA_ExaminationApp_Detail1.OptionsContent"></aspxform:XLabel>
                                        <aspxform:XTextBox id="XTextBox1" runat="server" ValueToDisplayText HiddenInput="True" BorderColor="Gainsboro" BorderWidth="1px" Width="50px" Max="0" Min="0" DisableExpress='Global.StepName!="提交信息"' Express="javascript('IsChecked',DF_OA_ExaminationApp_Detail1.OptionsID,DF_OA_ExaminationApp_Detail1.IsChecked,DF_OA_ExaminationApp_Detail.LineID)"></aspxform:XTextBox>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                    <td align="center" class="tds1">
                        <aspxform:XLabel id="XLabel12" runat="server" BackColor="#E9F1F4" XDataBind="DF_OA_ExaminationApp_Detail.Score" Text="Label" TextAlign="Center"></aspxform:XLabel>
                    </td>
                    <td align="center" class="tds1" hiddenexpress='Global.StepName=="提交信息"'>
                        <aspxform:XTextBox id="XTextBox15" runat="server" XDataBind="DF_OA_ExaminationApp_Detail.Answer1" HiddenInput="True" BorderColor="#DCDCDC" BorderWidth="1" Width="100%" TextAlign="Center"></aspxform:XTextBox>
                        <aspxform:XLabel id="XLabel14" runat="server" BackColor="#E9F1F4" XDataBind="DF_OA_ExaminationApp_Detail.Answer" Text="Label" HiddenExpress="1" TextAlign="Center"></aspxform:XLabel>
                        <aspxform:XLabel id="XLabel4" runat="server" BackColor="#E9F1F4" ValueToDisplayText Text="Label" TextAlign="Center" Express='if(DF_OA_ExaminationApp_Detail.Answer1==DF_OA_ExaminationApp_Detail.Answer,DF_OA_ExaminationApp_Detail.Score,"0")'></aspxform:XLabel>
                    </td>
                </tr>
                <tr hiddenexpress='Global.StepName=="提交信息"'>
                    <td class="tds1" colspan="2">
                    </td>
                    <td align="right" class="tds1">
                        <asp:Label id="Label7" runat="server" text="总分"></asp:Label></td>
                    <td align="center" class="tds1">
                        <aspxform:XLabel id="XLabel13" runat="server" BackColor="#E9F1F4" XDataBind="DF_OA_ExaminationApp_Info.GrossScore" Text="Label" TextAlign="Center"></aspxform:XLabel>
                    </td>
                </tr>
            </tbody>
        </table>
        <aspxform:XRequiredFieldValidator id="XRequiredFieldValidator1" runat="server" Display="None" ErrorMessage="请填写答案！" ControlToValidate="XTextBox15" ForeColor="Red">请填写答案！</aspxform:XRequiredFieldValidator>
    </form>
</body>
</html>
