<%@ page language="VB" autoeventwireup="false" inherits="Utilities_ParallelDatabaseExport, App_Web_lm-oqfjm" enableEventValidation="false" %>
<%@ Register Assembly="obout_Window_NET" Namespace="OboutInc.Window" TagPrefix="owd" %>
<%@ Register TagPrefix="uctrl" Src="~/Header.ascx" TagName="header" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Untitled Page</title>
    <link href="../StyleSheet.css" rel="stylesheet" type="text/css" />
    
</head>
<body onload="drp_DatabaseType_OnChange();Chk_ReservedField_ChekChange();chk_IsParallelDatabaseExport_onclick();">
    <form id="form1" runat="server">
    <div>
            <uctrl:header ID="MyHeader" runat="server" />
        <owd:Window ID="Wnd_ParallelDatabaseExport" runat="server"  Height="520" Width="670" StyleFolder="~/Styles/mainwindow/blue" Title="Parallel Database Export" ShowCloseButton="false"  ShowStatusBar="False" Left="350" Top="100">
            <table class="rowEditTable"  width="100%"  cellpadding="1"  style="border-top-style: none; border-right-style: none; border-left-style: none; border-bottom-style: none;height:100%">
                <tr>
                    <td>
                        <fieldset>
                            <legend><asp:CheckBox ID="chk_IsParallelDatabaseExport" onclick="chk_IsParallelDatabaseExport_onclick();" Text=" Is Parallel Database Export" runat="server" /></legend>
                                
                            <table id="table_ParallelDatabaseExport">
                            <tr>
                            <td style="font-weight: bold;">Database Type</td>
                            <td>
                                <asp:DropDownList ID="drp_DatabaseType" runat="server" Width="152px" onchange="drp_DatabaseType_OnChange();" >
                                <asp:ListItem>MS SQL Server</asp:ListItem>
                                <asp:ListItem>Oracle</asp:ListItem>
                                <asp:ListItem>My Sql</asp:ListItem>
                                </asp:DropDownList>
                             </td>
                           <td>Service</td>  
                           <td><asp:TextBox ID="txt_Service" runat="server" Width="100px"></asp:TextBox></td>
                           <td>Port</td>
                           <td><asp:TextBox ID="txt_Port" runat="server" Width="50px"></asp:TextBox></td>
                            </tr>
                            
                            <tr>
                            <td style="font-weight: bold;">Server Name/IP</td>
                            <td>
                                <asp:TextBox ID="txt_Ip" runat="server"></asp:TextBox>
                             </td>
                           <td colspan="4" style="font-weight: bold;">Database Name&nbsp;
                                <asp:TextBox ID="txt_DBName" runat="server" Width="210px" ></asp:TextBox>
                           </td>  
                            </tr>
                            
                             <tr>
                            <td>User Name</td>
                            <td>
                                <asp:TextBox ID="txt_UserName" runat="server"></asp:TextBox>
                             </td>
                           <td colspan="4">
                               &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Password&nbsp;
                                <asp:TextBox ID="txt_Password" TextMode="Password" runat="server" Width="210px"></asp:TextBox>
                           </td>  
                            </tr>
                            
                           <tr>
                            <td style="font-weight: bold;">Table Name</td>
                            <td colspan="5">
                                <asp:TextBox ID="txt_TableName" runat="server" Width="490px" ></asp:TextBox>
                           </td>  
                            </tr>
                            
                            
                            <tr>
                            <td colspan="6">
                            <fieldset>
                            <legend>Table Field Mapping</legend>
                            <table>
                            <tr>
                            <td >Employee Code=</td>
                            <td colspan="3"><asp:TextBox ID="txt_EmployeeCode"  runat="server" Width="192px"></asp:TextBox></td>
                            </tr>
                              <tr>
                            <td>Log DateTime=</td>
                            <td><asp:TextBox ID="txt_LogDateTime" runat="server" Width="192px"></asp:TextBox></td>
                            <td>
                            Format
                            </td>
                            <td><asp:TextBox ID="txt_LogDateTimeFormat" runat="server" Width="192px"></asp:TextBox></td>
                            </tr>
                           
                            <tr>
                            <td>Log Date=</td>
                            <td><asp:TextBox ID="txt_LogDate" runat="server" Width="192px"></asp:TextBox></td>
                            <td>
                            Format
                            </td>
                            <td><asp:TextBox ID="txt_LogDateFormat" runat="server" Width="192px"></asp:TextBox></td>
                            </tr>
                            
                            <tr>
                            <td>Log Time=</td>
                            <td><asp:TextBox ID="txt_LogTime" runat="server" Width="192px"></asp:TextBox></td>
                            <td>
                            Format
                            </td>
                            <td><asp:TextBox ID="txt_LogTimeFormat" runat="server" Width="192px"></asp:TextBox></td>
                            </tr>
                            
                           
                            
                             <tr>
                            <td>Direction=</td>
                            <td><asp:TextBox ID="txt_Direction" runat="server" Width="192px"></asp:TextBox></td>
                            <td colspan="3">
                            <table>
                            <tr>
                            <td>
                            In
                            </td>
                            <td>
                            <asp:TextBox ID="txt_InValue" Width="88px" runat="server"></asp:TextBox>
                            </td>
                            
                            <td>
                            Out
                            </td>
                            <td>
                            <asp:TextBox ID="txt_OutValue" Width="93px" runat="server"></asp:TextBox>
                            </td>
                            
                            </tr>
                            </table>
                            </td>
                            </tr>
                            
                            
                            
                            
                            
                            <tr>
                            <td>Work Code=</td>
                            <td colspan="3"><asp:TextBox ID="txt_WorkCode" runat="server" Width="192px"></asp:TextBox></td>
                            </tr>
                            
                            
                            </table>
                            </fieldset>
                            </td>
                            </tr>
                            
                            
                            <tr>
                            <td colspan="6">
                            <fieldset>
                            <legend>Reserved Fields</legend>
                            <table>
                            <tr>
                            <td><asp:CheckBox ID="chk_ReservedField1" runat="server" Text="Reserved Field 1=&nbsp;  " onclick="Chk_ReservedField_ChekChange();"  /></td>
                            <td><asp:TextBox ID="txt_ReservedField1" runat="server" Width="160px"></asp:TextBox></td>
                            <td>
                                &nbsp;&nbsp; Value</td>
                            <td><asp:TextBox ID="txt_ReservedField1Value" runat="server" Width="188px"></asp:TextBox></td>
                            </tr>
                            
                            <tr>
                            <td><asp:CheckBox ID="chk_ReservedField2"  runat="server"  Text="Reserved Field 2=&nbsp;" onclick="Chk_ReservedField_ChekChange();"  /></td>
                            <td><asp:TextBox ID="txt_ReservedField2" runat="server" Width="160px"></asp:TextBox></td>
                            <td>
                                &nbsp;&nbsp; Value</td>
                            <td><asp:TextBox ID="txt_ReservedField2Value" runat="server" Width="188px"></asp:TextBox></td>
                            </tr>
                            
                            
                            </table>
                            </fieldset>
                            </td>
                            </tr>
                            
                            
                                
                            </table>
                        </fieldset>
                    </td>
                    </tr>
                    <tr>
                        <td >
                        <table>
                        <tr>
                        <td align="left" style="width:520px">
                            <asp:Button ID="btn_TestConnection" runat="server" Text="Test Connection"  />
                        </td>
                        <td align="right">
                        <asp:Button ID="Btn_Save" runat="server" Text="Save" />&nbsp;&nbsp;
                            <input id="btn_Cancel" type="button" value="Close" OnClick="Wnd_ParallelDatabaseExport.Close();" />&nbsp;&nbsp;
                        </td>
                        </tr>
                        </table>
                        </td>
                    </tr>
                <tr>
                    <td>
                        <asp:Label ID="Lbl_Error" runat="server" EnableViewState="False" Text="&nbsp;" ForeColor="Red"></asp:Label>
                           
                    </td>
                </tr>
            </table>
        </owd:Window>
    
    </div>
    </form>
    
    <script type="text/javascript">
        function drp_DatabaseType_OnChange()
        {
            document.getElementById("<%=txt_Service.ClientID %>").disabled=false;
            document.getElementById("<%=txt_Port.ClientID %>").disabled=false;
            document.getElementById("<%=txt_Ip.ClientID %>").disabled=false;
            document.getElementById("<%=txt_DBName.ClientID %>").disabled=false;
            document.getElementById("<%=txt_UserName.ClientID %>").disabled=false;
            document.getElementById("<%=txt_Password.ClientID %>").disabled=false;
            var DatabaseType=document.getElementById("<%=drp_DatabaseType.ClientID %>").value;
            
            if(DatabaseType=='MS SQL Server')
            {
                document.getElementById("<%=txt_Service.ClientID %>").disabled=true;
                document.getElementById("<%=txt_Port.ClientID %>").disabled=true;
            }
            
            else if(DatabaseType=='Oracle')
            {
                document.getElementById("<%=txt_DBName.ClientID %>").disabled=true;
            }
            
            else if(DatabaseType=='My Sql')
            {
                document.getElementById("<%=txt_Service.ClientID %>").disabled=true;
            }
        }
        
        function chk_IsParallelDatabaseExport_onclick()
        {
            if(document.getElementById("<%=chk_IsParallelDatabaseExport.ClientID %>").checked)
            {
                document.getElementById("table_ParallelDatabaseExport").disabled=false;
            }
            else
            {
                document.getElementById("table_ParallelDatabaseExport").disabled=true;
            }
            
        }
        
        function Chk_ReservedField_ChekChange()
        {
            if(document.getElementById("<%=chk_ReservedField1.ClientID %>").checked)
            {
                document.getElementById("<%=txt_ReservedField1.ClientID %>").disabled=false;
            }
            else
            {
                document.getElementById("<%=txt_ReservedField1.ClientID %>").disabled=true;
            }
            
            if(document.getElementById("<%=chk_ReservedField2.ClientID %>").checked)
            {
                document.getElementById("<%=txt_ReservedField2.ClientID %>").disabled=false;
            }
            else
            {
                document.getElementById("<%=txt_ReservedField2.ClientID %>").disabled=true;
            }
        }
    </script>
</body>
</html>
