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

    // Insert page code here
    //

</script>
<html xmlns:xform="xmlns:xform">
<head runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
    <link href="/Oimec/Styles/css/StyleSheet.css" rel="stylesheet" type="text/css" />
    <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-RIGHT: 0px; PADDING-LEFT: 2px; PADDING-BOTTOM: 0px}
    TD.NoPadding {PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px}
    INPUT {HEIGHT: 20px}
    INPUT.UL {BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: #33ff33 1px solid}
    TEXTAREA {FONT-SIZE:12px}
    </style>
    <script type="text/javascript">
        agent.on('Submit', function (v1, actname) {
            //alert(actname);
            if (actname == "同意") {
                var title = agent.Eles[document.getElementById("XTextBox1").getAttribute("xform_xele_index")].getValue();
                var name = agent.Eles[document.getElementById("XTextBox8").getAttribute("xform_xele_index")].getValue();
                var taskID = agent.Eles[document.getElementById("XTextBox5").getAttribute("xform_xele_index")].getValue();
                var voteID = agent.Eles[document.getElementById("XTextBox9").getAttribute("xform_xele_index")].getValue();

                YZSoft.Ajax.request({
                    async: false,
                    url: YZSoft.$url('Oimec/ApiServices/OAAPIHandler.ashx'),
                    params: {
                        method: 'SendVoteMessage',
                        taskID: taskID,
                        name: name,
                        title: title,
                        voteID:voteID
                    },
                    success: function (action) {
                        var data = action.result;
                        //alert(data.Msg);
                    },
                    failure: function (response) {
                        //alert(action.result.Msg);
                    }
                });
            }
            
        });
    </script>
</head>
<body>
    <form runat="server">
        <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="XLabel2" runat="server" text="表单号："></asp:Label>
                        <aspxform:XLabel id="XLabel3" runat="server" text="--系统自动生成--" Value ValueToDisplayText BackColor="#8AB3DF" XDataBind="DF_OA_Vote.FormNo"></aspxform:XLabel>
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <table width="1200" class="table" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td height="13" class="title1" colspan="5">
                        <asp:Label id="Label3" runat="server" text="基本信息"></asp:Label>
                        <aspxform:XTextBox id="XTextBox5" runat="server" XDataBind="DF_OA_Vote.TaskID" HiddenInput="True" BorderWidth="1" BorderColor="#DCDCDC"></aspxform:XTextBox>
                        <aspxform:XTextBox id="XTextBox8" runat="server" XDataBind="DF_OA_Vote.voteName" HiddenInput="True" BorderWidth="1" BorderColor="#DCDCDC"></aspxform:XTextBox>
                        <aspxform:XTextBox id="XTextBox9" runat="server" XDataBind="DF_OA_Vote.id" HiddenInput="True" BorderWidth="1" BorderColor="#DCDCDC"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td height="19" class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="Label4" runat="server" text="投票名称"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%" colspan="3">
                        <aspxform:XTextBox id="XTextBox1" runat="server" ValueToDisplayText XDataBind="DF_OA_Vote.title" BorderWidth="1" BorderColor="#DCDCDC" width="70%"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td height="20" class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="Label6" runat="server" text="介绍"></asp:Label></td>
                    <td class="tsbottomtext" colspan="3">
                        <aspxform:XTextBox id="XTextBox2" runat="server" XDataBind="DF_OA_Vote.voteContent" BorderWidth="1" BorderColor="#DCDCDC" width="80%" TextMode="MultiLine" Height="40"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td height="20" class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="Label5" runat="server" text="投票截止时间"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%">
                        <aspxform:XDateTimePicker id="XDateTimePicker4" runat="server" XDataBind="DF_OA_Vote.endTime" BorderWidth="1" BorderColor="#DCDCDC" Type="TimeMinutes30" Width="50%"></aspxform:XDateTimePicker>
                    </td>
                    <td height="19" class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="Label8" runat="server" text="显示投票结果"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%">
                        <aspxform:XRadioButtonList id="XRadioButtonList3" runat="server" XDataBind="DF_OA_Vote.ISshow" Width="70px" RepeatDirection="Horizontal">
                            <asp:ListItem Value="1">是</asp:ListItem>
                            <asp:ListItem Value="0">否</asp:ListItem>
                        </aspxform:XRadioButtonList>
                    </td>
                </tr>
                <tr>
                    <td height="19" class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="Label21" runat="server" text="投票人员"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%" colspan="3">
                        <table width="100%" align="center" style="HEIGHT: auto" border="0" cellspacing="0" cellpadding="0" menudock="Rignt" dynamicarea="1,1">
                            <tbody>
                                <tr>
                                    <td class="tds1">
                                        <aspxform:XCustomBrowserButton id="XCustomBrowserButton1" runat="server" XClass="Oimec.Dialogs.VoteGetDepartButton" Width="91px" Text="按部门添加" DataMap="id->DF_OA_Voter.VoterID;name->DF_OA_Voter.VoterName"></aspxform:XCustomBrowserButton>
                                        &nbsp;<aspxform:XSelectUserButton id="XSelectUserButton1" runat="server" Width="91px" Text="按员工添加" DataMap="Account->DF_OA_Voter.VoterID;DisplayName->DF_OA_Voter.VoterName" MultiSelect="True"></aspxform:XSelectUserButton>
                                        &nbsp; 
                                        <aspxform:XCustomBrowserButton id="XCustomBrowserButton2" runat="server" XClass="Oimec.Dialogs.VoterGroupButton" Width="91px" Text="按组添加" DataMap="ID->DF_OA_Voter.VoterID;GroupName->DF_OA_Voter.VoterName;Type->DF_OA_Voter.VoterType"></aspxform:XCustomBrowserButton>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="tds1">
                                        <aspxform:XTextBox id="XTextBox7" runat="server" ValueToDisplayText XDataBind="DF_OA_Voter.VoterID" HiddenInput="True" Max="0" Min="0" Width="10px" ReadOnly="True" CssClass="text"></aspxform:XTextBox>
                                        <aspxform:XTextBox id="XTextBox10" runat="server" ValueToDisplayText XDataBind="DF_OA_Voter.VoterType" HiddenInput="True" Max="0" Min="0" Width="10px" ReadOnly="True" CssClass="text"></aspxform:XTextBox>
                                        <aspxform:XTextBox id="XTextBox6" runat="server" XDataBind="DF_OA_Voter.VoterName" Width="98%" ReadOnly="True" CssClass="text"></aspxform:XTextBox>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
            </tbody>
        </table>
        <aspxform:XRequiredFieldValidator id="XRequiredFieldValidator1" runat="server" ForeColor="Red" ErrorMessage="请输入投票名称" ControlToValidate="XTextBox1" ValidationGroup="submit"></aspxform:XRequiredFieldValidator>
        &nbsp;<aspxform:XRequiredFieldValidator id="XRequiredFieldValidator2" runat="server" ForeColor="Red" ErrorMessage="请选择投票截止时间" ControlToValidate="XDateTimePicker4" ValidationGroup="submit"></aspxform:XRequiredFieldValidator>
        &nbsp;<aspxform:XRequiredFieldValidator id="XRequiredFieldValidator3" runat="server" ForeColor="Red" ErrorMessage="请选择是否显示投票结果" ControlToValidate="XRadioButtonList3" ValidationGroup="submit"></aspxform:XRequiredFieldValidator>
        <br />
        <table width="1200" align="center" class="table" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td height="13" class="title1" colspan="5">
                        <asp:Label id="Label2" runat="server" text="详细信息"></asp:Label></td>
                </tr>
                <tr>
                    <td height="20" class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="Label7" runat="server" text="标题"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%" colspan="3">
                        <aspxform:XTextBox id="XTextBox3" runat="server" XDataBind="DF_OA_Vote_Question.title" Width="98%" CssClass="text"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td height="19" class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="Label9" runat="server" text="选择方式"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%">
                        <aspxform:XRadioButtonList id="XRadioButtonList1" runat="server" XDataBind="DF_OA_Vote_Question.typeId" Width="110px" RepeatDirection="Horizontal">
                            <asp:ListItem Value="0">单选</asp:ListItem>
                            <asp:ListItem Value="1">多选</asp:ListItem>
                        </aspxform:XRadioButtonList>
                    </td>
                    <td class="tsbottomlabel" style="HEIGHT: 19px; WIDTH: 10%">
                        <asp:Label id="Label13" runat="server" text="选项模式"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%">
                        <aspxform:XRadioButtonList id="XRadioButtonList2" runat="server" XDataBind="DF_OA_Vote_Question.imgText" Width="100px" RepeatDirection="Horizontal">
                            <asp:ListItem Selected="True" Value="0">文本</asp:ListItem>
                            <%--<asp:ListItem Value="1">图片</asp:ListItem>--%> 
                        </aspxform:XRadioButtonList>
                    </td>
                </tr>
                <tr hiddenexpress="DF_OA_Vote_Question.typeId=='0'||DF_OA_Vote_Question.typeId==''">
                    <td height="19" class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="Label12" runat="server" text="控制多选数量"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%">
                        <aspxform:XRadioButtonList id="XRadioButtonList4" runat="server" XDataBind="DF_OA_Vote_Question.IsLimit" Width="110px" RepeatDirection="Horizontal">
                            <asp:ListItem Value="0">是</asp:ListItem>
                            <asp:ListItem Value="1">否</asp:ListItem>
                        </aspxform:XRadioButtonList>
                    </td>
                    <td height="19" class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="Label11" runat="server" text="可选数量"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox11" runat="server" XDataBind="DF_OA_Vote_Question.limitNum" Width="58%" CssClass="text" Format="type:number;.0"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="tsbottomlabel" style="HEIGHT: 19px; WIDTH: 10%">
                        <asp:Label id="Label10" runat="server" text="选项"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%" colspan="3">
                        <!--文本选项-->
                        <table width="100%" align="center" border="0" cellspacing="0" cellpadding="0" menudock="Right" dynamicarea="1,1" hiddenexpress="DF_OA_Vote_Question.imgText=='1'">
                            <tbody>
                                <tr>
                                    <td class="tds" style="WIDTH: 40px; TEXT-ALIGN: center">
                                        <asp:Label id="Label15" runat="server" text="序号"></asp:Label></td>
                                    <td class="tds" style="TEXT-ALIGN: center">
                                        <asp:Label id="Label16" runat="server" text="选项内容"></asp:Label></td>
                                </tr>
                                <tr>
                                    <td class="tds1" style="HEIGHT: 28px; TEXT-ALIGN: center">
                                        <aspxform:XGridLineNo id="XGridLineNo1" runat="server" BackColor="Transparent" BorderColor="Transparent" Width="20px" CssClass="text" BorderStyle="None" TextAlign="Center">1</aspxform:XGridLineNo>
                                    </td>
                                    <td class="tds1">
                                        <aspxform:XTextBox id="XTextBox4" runat="server" XDataBind="DF_OA_Vote_Question_Options.title" TextMode="MultiLine" Width="98%" CssClass="text"></aspxform:XTextBox>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
            </tbody>
        </table>
        <!--图片选项--><%--<table width="1200" align="center" class="table" border="0" cellspacing="0" cellpadding="0" menudock="Left" dynamicarea="2,1">
            <tbody>
                <tr>
                    <td class="title1" style="FONT-SIZE: 14px; TEXT-ALIGN: left" colspan="2">
                        <asp:Label id="Label17" runat="server" text="选项"></asp:Label></td>
                </tr>
                <tr>
                    <td width="37" class="tds" style="TEXT-ALIGN: center">
                        <asp:Label id="Label18" runat="server" text="序号"></asp:Label></td>
                    <td class="tds" style="WIDTH: 183px; TEXT-ALIGN: center">
                        <asp:Label id="Label19" runat="server" text="图片"></asp:Label></td>
                    <td class="tds" style="WIDTH: 183px; TEXT-ALIGN: center">
                        <asp:Label id="Label20" runat="server" text="图片描述"></asp:Label></td>
                </tr>
                <tr>
                    <td class="tds1" style="HEIGHT: 28px; TEXT-ALIGN: center">
                        <aspxform:XGridLineNo id="XGridLineNo2" runat="server" BackColor="Transparent" XDataBind="DF_MCustomer_BillInfo.LineNumber" BorderColor="Transparent" Width="20px" CssClass="text" BorderStyle="None" TextAlign="Center">1</aspxform:XGridLineNo>
                    </td>
                    <td class="tds1">
                        <aspxform:XImageAttachment id="XImageAttachment1" runat="server" XDataBind="DF_OA_Vote_Question_Options.image" BorderWidth="3px" BorderColor="Gainsboro" Height="128px" Width="112px" BorderStyle="Solid"></aspxform:XImageAttachment>
                    </td>
                    <td class="tds1">
                        <aspxform:XTextBox id="XTextBox6" runat="server" XDataBind="DF_OA_Vote_Question_Options.title" Width="98%" CssClass="text"></aspxform:XTextBox>
                    </td>
                </tr>
            </tbody>
        </table>--%>
        <aspxform:XRequiredFieldValidator id="XRequiredFieldValidator5" runat="server" ForeColor="Red" ErrorMessage="请输入具体投票问题" ControlToValidate="XTextBox3" ValidationGroup="submit"></aspxform:XRequiredFieldValidator>
        &nbsp;<aspxform:XRequiredFieldValidator id="XRequiredFieldValidator6" runat="server" ForeColor="Red" ErrorMessage="请选择投票方式" ControlToValidate="XRadioButtonList1" ValidationGroup="submit"></aspxform:XRequiredFieldValidator>
        &nbsp;<aspxform:XRequiredFieldValidator id="XRequiredFieldValidator7" runat="server" ForeColor="Red" ErrorMessage="请选择选项模式" ControlToValidate="XRadioButtonList2" ValidationGroup="submit"></aspxform:XRequiredFieldValidator>
        &nbsp;&nbsp;<aspxform:XRequiredFieldValidator id="XRequiredFieldValidator8" runat="server" ForeColor="Red" ErrorMessage="请选择是否控制可选数量" ControlToValidate="XRadioButtonList4" ValidationGroup="submit" DisableExpress="DF_OA_Vote_Question.typeId==0"></aspxform:XRequiredFieldValidator>
        <aspxform:XRequiredFieldValidator id="XRequiredFieldValidator4" runat="server" ForeColor="Red" ErrorMessage="请填写可选数量" ControlToValidate="XTextBox11" ValidationGroup="submit" DisableExpress="DF_OA_Vote_Question.typeId==0||DF_OA_Vote_Question.IsLimit==1"></aspxform:XRequiredFieldValidator>
        <br />
        <table width="1200" align="center" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td>
                        <aspxform:XSignTrace id="XSignTrace1" runat="server" BorderWidth="1" BorderColor="#dcdcdc" Width="1200px"></aspxform:XSignTrace>
                    </td>
                </tr>
            </tbody>
        </table>
    </form>
</body>
</html>
