<%@ Page Title="" Language="C#" MasterPageFile="~/SiteMaster.Master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="MKInsight.Online.Setup.Default" MaintainScrollPositionOnPostback="True" %>

<%@ Register Src="UIControls/MessageBox.ascx" TagName="MessageBox" TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="UIControls/ADServerDetails.ascx" TagName="ADServerDetails" TagPrefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cph_Head" runat="server">
    <style type="text/css">
        body {
            font-family: 'Segoe UI', Verdana;
            background-color: #e6e6e6;
            margin: 0;
            padding: 0;
            height: 100%;
        }

         td.ClientHeader {
            font-family: 'Segoe UI', Verdana;
            font-weight:bold;
            font-size:13pt;
            color:black;
            
            background: #EBECEC url(images/title.jpg) repeat-x left top;
        }

        td.ClientInsideFormat2 {
           height:0px;
        }

       
        .auto-style1 {
            width: 140px;
        }

       
    </style>


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cph_Body" runat="server">
    <div>
        <uc1:MessageBox ID="usc_M" runat="server" />
        <div style="height: 2px;"></div>
    </div>
    <div>
        <asp:Menu ID="mnu_Root" runat="server" Orientation="Horizontal" OnMenuItemClick="OnMenuItemClick">
            <StaticMenuItemStyle Font-Size="Small" ForeColor="Black" HorizontalPadding="4px"
                ItemSpacing="2px" />
            <StaticHoverStyle BackColor="#7C6F57" />
            <Items>
                <asp:MenuItem ImageUrl="~/images/home32.png" Text=" Home" Value="home" Selected="True"></asp:MenuItem>
                <asp:MenuItem ImageUrl="~/images/property32.png" Text="Globalsettings" Value="globalsettings"></asp:MenuItem>
                <asp:MenuItem ImageUrl="~/images/import32.png" Text="UpgradeLicense" Value="upgradelicense"></asp:MenuItem>
                <asp:MenuItem ImageUrl="~/images/lock32.png" Text="CreateNotificationServicePassword" Value="servicepassword"></asp:MenuItem>
            </Items>
        </asp:Menu>
        <div>
            <hr />
        </div>
    </div>
    <div>
        <asp:MultiView ID="mv" runat="server">
            <asp:View ID="v_M" runat="server">
                <div>
                    <table id="Table2" bgcolor="white" border="0" cellpadding="2" cellspacing="2" style="border-right: gainsboro thin solid; border-top: gainsboro thin solid; border-left: gainsboro thin solid; border-bottom: gainsboro thin solid"
                        width="99%">
                        <tr>
                            <td class="ClientHeader">
                                <asp:Label ID="lbl_Accounts" runat="server" Text="Please select account from the list"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td class="ClientInsideFormat2">
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lbl_Databases" runat="server" Font-Bold="True">Accounts:</asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:DropDownList ID="drp_Dbs" runat="server" DataTextField="Name" DataValueField="IntegerID"
                                    Width="400px" AutoPostBack="True" OnSelectedIndexChanged="OnAccountChanged">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td class="ClientHeader">
                                <asp:Label ID="lbl_Details" runat="server" Text="Details:"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lbl_Name" runat="server" Text="Name:" Font-Bold="True"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:TextBox ID="txt_Name" runat="server" Width="400px" ReadOnly="True"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lbl_Pass" runat="server" Font-Bold="True" Text="Password:"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:TextBox ID="txt_Password" runat="server"
                                    TextMode="Password" Width="400px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lbl_ConString" runat="server" Text="Connection String:" Font-Bold="True"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:TextBox ID="txt_ConString" runat="server" Height="80px" TextMode="MultiLine"
                                    Width="400px"></asp:TextBox>
                                <asp:Button ID="btn_TestConnection" runat="server" OnClick="OnTestDB" Text="Test Database" />
                                <asp:Button ID="btn_Build" runat="server" Text="Build" OnClick="OnBuild" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lbl_Comments" runat="server" Text="Comments:" Font-Bold="True"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:TextBox ID="txt_Comments" runat="server" Height="80px" TextMode="MultiLine"
                                    Width="400px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <hr class="ee" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Button ID="btn_Save" runat="server" Text="Save" OnClick="OnSave" />
                            </td>
                        </tr>
                    </table>
                </div>
            </asp:View>
            <asp:View ID="v_G" runat="server">
                <div>
                    <table id="Table3" bgcolor="white" border="0" cellpadding="2" cellspacing="2" style="border-right: gainsboro thin solid; border-top: gainsboro thin solid; border-left: gainsboro thin solid; border-bottom: gainsboro thin solid"
                        width="99%">

                        <tr>
                            <td class="ClientHeader">&nbsp;
                                <asp:Label ID="lbl_IntAuth2State" runat="server" Text="Integrated authentication"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td class="ClientInsideFormat2">
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lbl_State" runat="server" Font-Bold="True" Text="State:"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:CheckBoxList ID="lst_States" runat="server">
                                </asp:CheckBoxList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lbl_ADServers" runat="server" Font-Bold="True" Text="Servers:"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div style="float: left;">
                                    <div>
                                        <asp:Button ID="btn_AddADServer" runat="server" Text="Add" Width="100" OnClick="OnAdd"
                                            CausesValidation="False" />
                                    </div>
                                    <div>
                                        <asp:Button ID="btn_DelADServer" runat="server" Text="Remove" Width="100" CausesValidation="False"
                                            OnClick="OnRemove" />
                                    </div>
                                    <div>
                                        <asp:Button ID="btn_EditADServer" runat="server" Text="Edit" Width="100" CausesValidation="False"
                                            OnClick="OnEdit" />
                                    </div>
                                </div>
                                <div style="float: left;">
                                    <asp:ListBox ID="lst_ADServers" runat="server" Width="337px" Height="200px"></asp:ListBox>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td class="ClientHeader">
                                <asp:Label ID="lbl_MailServer" runat="server" Text="Mail server"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td class="ClientInsideFormat2">
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lbl_ServerName" runat="server" Font-Bold="True" Text="server address:"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:TextBox ID="txt_ServerName" runat="server" Width="400px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lbl_RA" runat="server" Font-Bold="True" Text="Requires authentication:"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:CheckBox ID="chk_RA" runat="server"
                                    Text="(specify server login details below)" AutoPostBack="True"
                                    OnCheckedChanged="OnMailOptionChanged" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lbl_MSUserName" runat="server" Font-Bold="True" Text="User name:"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:TextBox ID="txt_MSUsername" runat="server" Width="400px" Enabled="False"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lbl_MSPassword" runat="server" Font-Bold="True" Text="Password:"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:TextBox ID="txt_MSPassword" runat="server" TextMode="Password"
                                    Width="400px" Enabled="False"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lbl_MSUseSSL" runat="server" Font-Bold="True" Text="Use SSL security:"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:CheckBox ID="chk_UseMailSSL" runat="server" Text="(secure mail must be supported by the server)" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lbl_MSUsePort" runat="server" Font-Bold="True"
                                    Text="Use specific tcp port:"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:TextBox ID="txt_MailPort" runat="server" Width="100px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lbl_MSUseTimeout" runat="server" Font-Bold="True"
                                    Text="Use specific timeout (seconds):"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:TextBox ID="txt_MailTimeout" runat="server" Width="100px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="ClientHeader">
                                <asp:Label ID="lbl_ServerTemp" runat="server" Text="Temp Data"></asp:Label></td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lbl_TempPath" runat="server" Font-Bold="True"
                                    Text="Temp storage path:"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:CheckBox ID="chk_TempPath" runat="server"
                                    Text="(Use specific location for temporary files)"
                                    AutoPostBack="True" OnCheckedChanged="OnTempPathCheckChanged" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lbl_TempStorePath" runat="server" Font-Bold="True"
                                    Text="Storage path:"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:TextBox ID="txt_TempStorePath" runat="server" Width="400px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="ClientHeader">
                                <asp:Label ID="lbl_ServerSettings" runat="server" Text="Server Settings"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lbl_OnlineLoginPersistence" runat="server" Font-Bold="True" Text="Online Login Persistence:"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:CheckBox ID="chk_SaveAccount" runat="server" Text="Save account name" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:CheckBox ID="chk_SaveUsername" runat="server" Text="Save user name" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:CheckBox ID="chk_SavePassword" runat="server" Text="Save password" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lbl_OnlineDetailTimeout" runat="server" Font-Bold="True" Text="Saved details timeout (days):"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:TextBox ID="txt_OnlineDetailTimeout" runat="server" Width="400px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <hr class="ee" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Button ID="btn_LASave" runat="server" OnClick="OnSave" Text="Save" CausesValidation="False" />
                            </td>
                        </tr>
                    </table>
                </div>
                <uc2:ADServerDetails ID="usc_AD" runat="server" OnServerSaved="ServerSaved" />
            </asp:View>
            <asp:View ID="v_L" runat="server">
                <div>
                    <table id="Table4" bgcolor="white" border="0" cellpadding="2" cellspacing="2" style="border-right: gainsboro thin solid; border-top: gainsboro thin solid; border-left: gainsboro thin solid; border-bottom: gainsboro thin solid"
                        width="99%">
                        <tr>
                            <td class="ClientHeader">
                                <asp:Label ID="lbl_UL" runat="server" Text="Upgrade License"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td class="ClientInsideFormat2">
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lbl_UpgradeInfo" runat="server" Text="Please select upgrade file with extension .mkl"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:FileUpload ID="f_UP" runat="server" Width="400px" />
                            </td>
                        </tr>
                        <tr>
                            <td>&nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <hr class="ee" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Button ID="btn_Upgrade" runat="server" Text="Upgrade" OnClick="OnSave" />
                            </td>
                        </tr>
                    </table>
                </div>
            </asp:View>
            <asp:View ID="V_DB" runat="server">
                <table>
                    <tr>
                        <td>
                            <asp:Label ID="lbl_Provider" runat="server" Text="Provider:"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txt_Provider" runat="server" Width="400px" Enabled="False"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lbl_NL" runat="server" Text="Network Location:"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txt_NL" runat="server" Width="400px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lbl_TP" runat="server" Text="Transmission Protocol:"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txt_TP" runat="server" Width="400px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lbl_DB" runat="server" Text="Database Name:"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txt_DB" runat="server" Width="400px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">&nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lbl_IADB" runat="server" Text="Integrated Authentication:"></asp:Label>
                        </td>
                        <td>
                            <asp:CheckBox ID="mki_AI" runat="server" AutoPostBack="True" OnCheckedChanged="OnADModeChanged"
                                Text="(Specify user name and password when this option is off)" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lbl_U" runat="server" Text="User name:"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txt_U" runat="server" Width="400px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lbl_P" runat="server" Text="Password:"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txt_P" runat="server" Width="400px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:Button ID="btn_OK" runat="server" OnClick="OnDBChanged" Text="Ok" />
                            <asp:Button ID="btn_C" runat="server" OnClick="OnCancel" Text="Cancel" />
                        </td>
                    </tr>
                </table>
            </asp:View>

            <asp:View ID="v_S" runat="server">
                <table style="width: 100%">
                    <tr>
                        <td class="ClientHeader" colspan="2">
                            <asp:Label ID="lbl_NotificationPasswordTitle" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td class="ClientInsideFormat2" colspan="2">
                        </td>
                    </tr>
                    <tr>
                        <td  style="vertical-align:top" class="auto-style1">
                            <asp:Label ID="lbl_ServicePassword" runat="server"></asp:Label>
                        </td>
                        <td style="vertical-align:top">
                           
                            <asp:TextBox ID="txt_ServicePassword" runat="server" TextMode="Password" Width="400px"></asp:TextBox>
                           
                               
                        </td>
                    </tr>
                    <tr>
                        <td class="auto-style1" style="vertical-align:top">
                            <asp:Label ID="lbl_ServiceEncPassword" runat="server"></asp:Label>
                        </td>
                        <td style="vertical-align:top">
                            <asp:TextBox ID="txt_ServiceEncPassword" runat="server" Width="400px" ReadOnly="True"></asp:TextBox>

                             <div runat="server" id="p_ns" visible="false">
                            <asp:Label ID="lbl_ServicePasswordInfo" runat="server" Font-Italic="true" Font-Size="X-Small"></asp:Label>    
                                <br />
                                <br />
                            </div>
                            
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <br />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">

                            <asp:Button ID="btn_CreateServicePassword" runat="server" OnClick="OnCreateNotificationPassword" />
                        </td>
                    </tr>
                </table>
            </asp:View>

        </asp:MultiView>
    </div>
</asp:Content>
