<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="CSEasyWMSynergyIntegration.aspx.vb" Inherits="CSEasyWM.CSEasyWMSynergyIntegration" %>
<%@ register tagprefix="ex" namespace="Exact.Web.UI.Controls" assembly="Exact.Web.UI.Controls" %>
<html>
<head>
	<meta name="save" content="history" />
	<link rel="stylesheet" type="text/css" href="Exact.css" />

<style type="text/css">
.watermark
{
	color: #999;
	font-style: italic;
}
#DisplayCriteria
{
    font-family: Consolas, Courier New, Courier, monospace !important;
}
</style>
    <script language="javascript" type="text/javascript" src="jquery.js"></script>
    <script language="javascript" type="text/javascript" src="CSEasyWMDefinitionPopup.js"></script>
    <script language="javascript" type="text/javascript">
    $(document).ready(function () {
        if ($('#DisplayCriteria').length > 0) {
            $('#DisplayCriteria').blur(function () {
                if ($(this).val().length == 0)
                    $(this).val('Type = 123').addClass('watermark');
            });
            $('#DisplayCriteria').focus(function () {
                if ($(this).val() == 'Type = 123')
                    $(this).val('').removeClass('watermark');
            });
            if ($('#DisplayCriteria').val().length == 0)
                $('#DisplayCriteria').val('Type = 123').addClass('watermark');
        }

        $('#ColumnID').change(function () {
            var columnid = $('#ColumnID').val();
            SysSet('DefColumnName', columnid);
        });

        $('#ButtonType').change(function () {
            ShowHideButtonTypeFields();
        });
        ShowHideButtonTypeFields();
    });

    function ShowHideButtonTypeFields() {
        if ($('#ButtonType').val() == '')
            return;

        if ($('#ButtonType').val() == 'D') {
            $('#csIntegration').show();
            $('#csIntegrations').hide();
            //$('#cfShowAsButtons').hide();
        } else {
            $('#csIntegration').hide();
            $('#csIntegrations').show();
            //$('#cfShowAsButtons').show();
        }
    }
</script>

</head>
<body>

<ep:form id="frm" runat="server">

<ex:InputField runat="server" Hidden="True" ID="DoClose" ValidationAs="Int" ValidationDefault="0" CreateClientControl="True" />
<ex:InputField runat="server" Hidden="True" ID="DefIDDisabled" ValidationAs="Int" ValidationDefault="0" CreateClientControl="True" />

<ex:CardControl runat="server" ID="Card" Action="Show">
    <ex:Header runat="server" ID="hdr">
    </ex:Header>

    <ex:headerproperties runat="server" id="hdrProps" headerpropertiesstyle="CreatedModified" datasource="bc" datafieldcreated="Created" datafieldcreator="Creator" datafieldcreatorname="CreatorFullName" datafieldmodified="Modified" datafieldmodifier="Modifier" datafieldmodifiername="ModifierFullName" />

    <ex:ButtonBar runat="server" ID="Buttons">
        <ex:Button runat="server" ID="btnSave" ButtonStyle="Save" DataSource="bc" />
        <ex:Button runat="server" ID="btnDelete" ButtonStyle="Delete" DataSource="bc" />
        <ex:Button runat="server" ID="btnClose" ButtonStyle="Close" />
    </ex:ButtonBar>

    <ex:BCDataSource runat="server" ID="bc" Component="CSEasyWMIntegrationPages" AddNewProps="PageID,DefID" />
    <ex:bcerrormessages runat="server" id="errMsg" />

    <ex:cardrow runat="server" id="crDef">
	    <ex:cardcolumn runat="server" id="ccDef">
		    <ex:cardsection runat="server" id="csGeneral" caption="Page" captionid="8435">
			    <ex:cardfield runat="server" id="cfPageID" caption="Page" captionid="8435">
				    <ex:combobox runat="server" id="PageID" datasource="bc" AllowEmpty="True" AutoPostback="True" />
			    </ex:cardfield>
                <ex:cardfield runat="server" id="cfCaption" caption="Label" captionid="205">
				    <ex:inputfield runat="server" id="Caption" datasource="bc" />
			    </ex:cardfield>
                <ex:cardfield runat="server" id="cfCaptionTermID" caption="Label" captionid="205" CaptionSuffix=":Term ID" CaptionSuffixID="37212">
				    <ex:inputfield runat="server" id="CaptionTermID" datasource="bc" />
			    </ex:cardfield>
                <ex:cardfield runat="server" id="cfDisplayOrder" caption="Sorting" captionid="1272">
                    <ex:combobox runat="server" id="DisplayOrder" datasource="bc" ShowKey="True" />
			    </ex:cardfield>
                <ex:cardfield runat="server" id="cfButtonType" caption="Button type" captionid="421107">
                    <ex:combobox runat="server" id="ButtonType" datasource="bc" />
			    </ex:cardfield>
                <ex:cardfield runat="server" id="cfShowAsButtons" caption="Show as buttons" captionid="421271" visible="False">
                    <ex:checkbox runat="server" id="ShowAsButtons" datasource="bc" />
			    </ex:cardfield>
                <ex:cardfield runat="server" id="cfActive" caption="Active" captionid="2212">
                    <ex:checkbox runat="server" id="Active" datasource="bc" />
                </ex:cardfield> 
		    </ex:cardsection>

            <ex:cardsection runat="server" id="csQuery" caption="Criteria" captionid="9822">
                <ex:cardfield runat="server" id="cfDisplayCriteria" caption="Criteria" captionid="9822">
                    <ex:memofield id="DisplayCriteria" runat="server" datasource="bc" width="100%" height="4" htmlencoded="true" />
			    </ex:cardfield>
                <ex:cardfield runat="server" id="cfMyWorkflow" caption="Active" captionid="35339">
                    <ex:checkbox runat="server" id="MyWorkflow" datasource="bc" />
                </ex:cardfield> 
                <ex:cardfield runat="server" id="cfSaveRequestFirst" caption="Active" captionid="421190">
                    <ex:checkbox runat="server" id="SaveRequestFirst" datasource="bc" />
                </ex:cardfield> 
            </ex:cardsection>

            <ex:cardsection runat="server" id="csIntegration" caption="Integration" captionid="421106">
                <ex:cardfield runat="server" id="cfDefID" caption="WordMerge Definition" captionid="421008">
				    <ex:combobox runat="server" id="DefID" AutoPostBack="True" />
			    </ex:cardfield>
                <ex:cardfield runat="server" id="cfColumnID" caption="Definition: Column" captionid="421026">
                    <ex:combobox runat="server" id="ColumnID" />
			    </ex:cardfield>
                <ex:cardfield runat="server" id="cfDefColumnName" caption="Column name" captionid="22703">
                    <ex:inputfield runat="server" id="DefColumnName" inputSize="60" AutoPostBack="True" />
			    </ex:cardfield>
                <ex:cardfield runat="server" id="cfDefColumnType" caption="Type" captionid="3801">
				    <ex:combobox runat="server" id="DefColumnType" AllowEmpty="False" ValidationDefault="N" />
			    </ex:cardfield>
            </ex:cardsection>

            <ex:cardlistview runat="server" id="csIntegrations" showheader="True" customizecolumns="False" customizerows="False">
				<ex:listview runat="server" id="ListIntegrations" caption="Definitions" captionid="421029" showbutton="True" showpagesize="false" ongetdata="ListIntegrationsOnGetData" onquery="ListIntegrationsOnQuery" ruler="false">
                    <buttons>
                        <ex:button runat="server" id="btnIntegrationsAdd" buttonstyle="Custom" caption="Add" captionid="8343" />
                    </buttons>
                    <Columns>
                        <ex:listviewcolumn captionid="421008" caption="WordMerge Definition" width="65%" />
                        <ex:listviewcolumn captionid="4332" caption="Status" width="10%" />
                        <ex:listviewcolumn captionid="22703" caption="Column name" width="25%" />
                    </Columns>
				</ex:listview>
			</ex:cardlistview>
	    </ex:cardcolumn>
    </ex:cardrow>


</ex:CardControl>

</ep:form>
</body>
</html>
