<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="CSEasyWMDefinitionList.aspx.vb" Inherits="CSEasyWM.CSEasyWMDefinitionList" %>
<%@ 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;
}
#SQLQuerySelect, #SQLQueryFrom, #SQLQueryWhere, #SQLQueryOrderBy
{
    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 () {
        $('#btnCustomize').hide();

        if ($('#SQLQuerySelect').length > 0) {
            $('#SQLQuerySelect').blur(function () {
                if ($(this).val().length == 0)
                    $(this).val('SELECT column1, column2').addClass('watermark');
            });
            $('#SQLQuerySelect').focus(function () {
                if ($(this).val() == 'SELECT column1, column2')
                    $(this).val('').removeClass('watermark');
            });
            if ($('#SQLQuerySelect').val().length == 0)
                $('#SQLQuerySelect').val('SELECT column1, column2').addClass('watermark');
        }
        if ($('#SQLQueryFrom').length > 0) {
            $('#SQLQueryFrom').blur(function () {
                if ($(this).val().length == 0)
                    $(this).val('FROM table').addClass('watermark');
            });
            $('#SQLQueryFrom').focus(function () {
                if ($(this).val() == 'FROM table')
                    $(this).val('').removeClass('watermark');
            });
            if ($('#SQLQueryFrom').val().length == 0)
                $('#SQLQueryFrom').val('FROM table').addClass('watermark');
        }
        if ($('#SQLQueryWhere').length > 0) {
            $('#SQLQueryWhere').blur(function () {
                if ($(this).val().length == 0)
                    $(this).val('WHERE column3 = 15').addClass('watermark');
            });
            $('#SQLQueryWhere').focus(function () {
                if ($(this).val() == 'WHERE column3 = 15')
                    $(this).val('').removeClass('watermark');
            });
            if ($('#SQLQueryWhere').val().length == 0)
                $('#SQLQueryWhere').val('WHERE column3 = 15').addClass('watermark');
        }
        if ($('#SQLQueryOrderBy').length > 0) {
            $('#SQLQueryOrderBy').blur(function () {
                if ($(this).val().length == 0)
                    $(this).val('ORDER BY column4').addClass('watermark');
            });
            $('#SQLQueryOrderBy').focus(function () {
                if ($(this).val() == 'ORDER BY column4')
                    $(this).val('').removeClass('watermark');
            });
            if ($('#SQLQueryOrderBy').val().length == 0)
                $('#SQLQueryOrderBy').val('ORDER BY column4').addClass('watermark');
        }
    });
</script>

</head>
<body>

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

<ex:InputField runat="server" Hidden="True" ID="DoClose" 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" onClick="ClosePopup(false);" />
    </ex:ButtonBar>

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

    <ex:cardrow runat="server" id="crDef">
	    <ex:cardcolumn runat="server" id="ccDef">
		    <ex:cardsection runat="server" id="csGeneral" caption="List" captionid="421080">
			    <ex:cardfield runat="server" id="cfName" caption="Name" captionid="206">
				    <ex:inputfield runat="server" id="Name" datasource="bc" StartFocus="True" />
			    </ex:cardfield>
                <ex:cardfield runat="server" id="cfDescription" caption="Description" captionid="4243">
                    <ex:memofield id="Description" runat="server" datasource="bc" width="100%" height="3" htmlencoded="true" />
			    </ex:cardfield>
                <ex:cardfield runat="server" id="cfUseNoData" caption="Use 'No data' tag" captionid="421268">
				    <ex:CheckBox runat="server" ID="UseNoData" DataSource="bc" />
			    </ex:cardfield>
		    </ex:cardsection>

            <ex:cardsection runat="server" id="csQuery" caption="Query" captionid="13207">
                <ex:cardfield runat="server" id="cfConnection" caption="Connection" captionid="27055">
                    <ex:combobox id="Connection" runat="server" datasource="bc" />
                </ex:cardfield>
                <ex:cardfield runat="server" id="cfSQLQuerySelect" caption="SELECT-clause" captionid="421040">
                    <ex:memofield id="SQLQuerySelect" runat="server" datasource="bc" width="100%" height="4" htmlencoded="true" />
			    </ex:cardfield>
                <ex:cardfield runat="server" id="cfSQLQueryFrom" caption="FROM-clause" captionid="421041">
                    <ex:memofield id="SQLQueryFrom" runat="server" datasource="bc" width="100%" height="4" htmlencoded="true" />
			    </ex:cardfield>
                <ex:cardfield runat="server" id="cfSQLQueryWhere" caption="WHERE-clause" captionid="421042">
                    <ex:memofield id="SQLQueryWhere" runat="server" datasource="bc" width="100%" height="4" htmlencoded="true" />
			    </ex:cardfield>
                <ex:cardfield runat="server" id="cfSQLQueryOrderBy" caption="ORDER BY-clause" captionid="421043">
                    <ex:memofield id="SQLQueryOrderBy" runat="server" datasource="bc" width="100%" height="4" htmlencoded="true" />
			    </ex:cardfield>
            </ex:cardsection>
	    </ex:cardcolumn>
    </ex:cardrow>


	<ex:cardrow runat="server" id="crTab" SingleColumn="true">
		<ex:cardcolumn runat="server" id="ccTab">				
            <ex:CardTabSection runat="server" ID="csTab" CaptionID="0" ShowHeader="false">                     
                <ex:Tabstrip runat="server" ID="tabstp">
					<ex:tabpage runat ="server"  caption="Columns" captionid="1253" id="tabColumns">
						<ex:cardlistview runat="server" id="csColumns" showheader="True" customizecolumns="False" customizerows="False">
							<ex:listview runat="server" id="ListColumns" caption="Columns" captionid="1253" showbutton="False" showpagesize="false" ongetdata="ListColumnsOnGetData" onquery="ListColumnsOnQuery" ruler="false">
                                <Columns>
                                    <ex:listviewcolumn captionid="27288" caption="Alias" width="35%" />
                                    <ex:listviewcolumn captionid="22703" caption="Column name" width="35%" />
                                    <ex:listviewcolumn captionid="17159" caption="Data type" width="10%" />
                                    <ex:listviewcolumn captionid="34348" caption="Display options" width="10%" />
                                    <ex:listviewcolumn captionid="3801" caption="Type" width="10%" />
                                </Columns>
							</ex:listview>
						</ex:cardlistview>
					</ex:tabpage>

                    <ex:tabpage runat ="server"  caption="List parameters" captionid="421082" id="tabSelection">
						<ex:cardlistview runat="server" id="csSelection" showheader="True" customizecolumns="False" customizerows="False">
							<ex:listview runat="server" id="ListSelection" caption="List parameters" captionid="421082" showbutton="True" showpagesize="false" ongetdata="ListSelectionOnGetData" onquery="ListSelectionOnQuery" ruler="false">
                                <buttons>
                                    <ex:button runat="server" id="btnSelectionAdd" buttonstyle="Custom" caption="Add" captionid="8343" />
                                </buttons>
                                <Columns>
                                    <ex:listviewcolumn captionid="421026" caption="Definition: Column" width="50%" />
                                    <ex:listviewcolumn captionid="421079" caption="List: Column" width="50%" />
                                </Columns>
							</ex:listview>
						</ex:cardlistview>
					</ex:tabpage>

                </ex:Tabstrip>                                     
            </ex:CardTabSection>
		</ex:cardcolumn>			
	</ex:cardrow>
</ex:CardControl>

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