<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Admin/MasterPage.master"
    Title="表单数据添加/修改" CodeBehind="Work.aspx.cs" EnableEventValidation="false" ValidateRequest="false" Inherits="PowerEasy.Module.General.WebSite.Admin.Work.Work" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CphNavigation" runat="Server">
    <table style="width: 100%; margin: 0 auto;" cellpadding="0" cellspacing="0">
        <tr>
            <td>
                <pe:ExtendedSiteMapPath ID="SmpNavigator" SiteMapProvider="AdminMapProvider" runat="server" />
            </td>
            <td align="right">
                <pe:ExtendedLabel ID="LblNodeName" HtmlEncode="false" runat="server" Text=""></pe:ExtendedLabel>
                &nbsp;
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CphContent" runat="Server">
<asp:ScriptManager ID="SmContent" runat="server" ScriptMode="Release" EnablePartialRendering="true">
  </asp:ScriptManager> 
    <script language="JavaScript" type="text/JavaScript">
        var tID = 0;
        var arrTabTitle = new Array("TabTitle0", "TabTitle1");
        var arrTrs0 = new Array("TabsWork");
        var arrTrs1 = new Array("TabsCustomForm");
        var arrTab = new Array(arrTrs0, arrTrs1);

        function ShowTabs(ID) {
            if (ID != tID) {
                document.getElementById(arrTabTitle[tID].toString()).className = "tabtitle";
                document.getElementById(arrTabTitle[ID].toString()).className = "titlemouseover";

                for (var i = 0; i < arrTab.length; i++) {
                    var tab = arrTab[i];
                    if (i == ID) {
                        for (var j = 0; j < tab.length; j++) {
                            document.getElementById(tab[j].toString()).style.display = "";
                        }
                    }
                    else {
                        for (var j = 0; j < tab.length; j++) {
                            document.getElementById(tab[j].toString()).style.display = "none";
                        }
                    }
                }

                tID = ID;
            }
        }
    </script>

    <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr align="center">
            <td colspan="6" class="spacingtitle">
                <pe:AlternateLiteral ID="LblTitle" Text="添加表单数据" AlternateText="修改表单数据" runat="Server" />
            </td>
        </tr>
        <tr align="center">
            <td id="TabTitle0" class="titlemouseover" onclick="ShowTabs(0)">
                基本信息
            </td>
            <td id="TabTitle1" class="tabtitle" onclick="ShowTabs(1)">
                表单内容
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
    </table>
    <div id="TabsWork">
        <table style="width: 100%; margin: 0 auto;" cellpadding="2" cellspacing="1" class="border">
            <tr class="tdbg">
                <td class='tdbgleft' align='right' style="width: 20%;">
                    <strong>标题：&nbsp;</strong><br />
                </td>
                <td>
                    <asp:TextBox ID="TxtWorkName" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr class="tdbg">
                <td class='tdbgleft' align='right' style="width: 20%;">
                    <strong>状态：&nbsp;</strong><br />
                </td>
                <td>
                    <pec:WorkStatus ID="WorkStatus" runat="server" ControlType="StatusType" />
                </td>
            </tr>
        </table>
    </div>
    <div id="TabsCustomForm" style="display: none">
     <style type="text/css">
    /*表单填写*/
.form_center dl dt div.formfill{
	float:right;
	background:url(Images/icon_man.gif) left center no-repeat;
	display:inline-block;
	padding-left:20px;
	font:bold 12px/32px "宋体";
	color:#690;
}
.border1,.border2,.border3,.border4/*外框*/{
	border:none;
	background:#FFF;
}
.border1 td input.inputtext{
	width:160px;
}
.border1 tr.tdbg2 td input.inputtext{
	width:80px;
}
.border2 td input.inputtext{
	width:80%;
}
.border2 td.tdpic input.inputtext{
	width:100px;
}
.border2 td.tdpic table tr.tdbg td{
	width:100px;
}
.border3 td input.inputtext{
	width:98%
}
.border4 td input.inputtext{
	width:100px
}
.border4 tr.tdbg2 td input.inputtext{
	width:100%
}
.border4 td.td3 input.inputtext{
	width:200px
}
.border1 tr.tdbg2 td.td4 input.inputtext,.border4 td.td4 input.inputtext{
	width:100%
}
    </style>
        <pe:ExtendedAdminRepeater ID="RepModel" runat="server" TemplateControlPath="~/Admin/Controls/FieldControl/ContentAdminControl.ascx" OnItemDataBound="RepModel_OnItemDataBound">
            <ItemTemplate>
                <tr id='Tab' runat="server" class='tdbg'>
                    <td class='tdbgleft' align='right' style="width: 20%;">
                        <div class="DivWordBreak">
                            <strong>
                                <%# Eval("FieldAlias")%>
                                ：&nbsp;</strong><br />
                            <%# Eval("Tips") %>
                        </div>
                    </td>
                    <td class='tdbg' align='left'>
                        <pe:AdminFieldControl ID="Field" runat="server" EnableNull='<%# (bool)Eval("EnableNull") %>'
                            FieldAlias='<%# Eval("FieldAlias")%>' Tips='<%# Eval("Tips") %>' FieldName='<%#Eval("FieldName")%>'
                            ControlType='<%# Eval("FieldType") %>' FieldLevel='<%# Eval("FieldLevel") %>'
                            Description='<%# Eval("Description")%>' Settings='<%# ((PowerEasy.Module.General.Model.CommonModel.FieldInfo)Container.DataItem).Settings %>'
                         IsAdminManage="true" Value='<%# Eval("DefaultValue") %>'>
                        </pe:AdminFieldControl>
                    </td>
                </tr>
            </ItemTemplate>
        </pe:ExtendedAdminRepeater>
    </div>
    <table style="width: 100%; margin: 0 auto;" cellpadding="2" cellspacing="1">
        <tr class="tdbgbottom">
            <td colspan="2">
                <pe:AlternateButton ID="BtnSubmit" runat="server" Text="保存表单数据" AlternateText="修改表单数据"
                    OnClick="BtnSubmit_Click" />
            </td>
        </tr>
    </table>
</asp:Content>
