<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Exchange_Settings.ascx.cs"
    Inherits="SolidCP.Portal.ProviderControls.Exchange2010_Settings" %>
<%@ Register Src="../SkinControls/BootstrapDropDownList.ascx" TagName="BootstrapDropDownList" TagPrefix="scp" %>

<%@ Import Namespace="SolidCP.Portal" %>

<table cellpadding="3" cellspacing="0" width="100%">
    
    <tr runat="server" id="powershellUrl1" width="200" nowrap>
        <td class="SubHead">
        </td>
        <td>
            <asp:Label runat="server" ID="lblFileServiceInfo" meta:resourcekey="lblPowerShellUrl" Text="e.g. http://server.domain.com/PowerShell" Font-Italic="true"></asp:Label>
        </td>
    </tr>

    <tr runat="server" id="powershellUrl2" width="200" nowrap>
        <td class="SubHead">
            <asp:Localize ID="loclocPowerShellUrl" runat="server" meta:resourcekey="locPowerShellUrl"
                Text="Powershell URL:"></asp:Localize>
        </td>
        <td>
            <asp:TextBox ID="txtPowerShellUrl" runat="server" Width="400px"></asp:TextBox>
        </td>
    </tr>
    
    <tr runat="server" id="storageGroup">
			<td class="SubHead" width="200" nowrap>
			    <asp:Localize ID="locStorageGroup" runat="server" meta:resourcekey="locStorageGroup" Text="Storage Group Name:"></asp:Localize>
			</td>
			<td>
				<asp:TextBox ID="txtStorageGroup" runat="server" Width="200px"></asp:TextBox>	
            </td>
		</tr>
    <tr>
        <td class="SubHead" width="200" nowrap>
            <asp:Localize ID="locMailboxDatabase" runat="server" meta:resourcekey="locMailboxDatabase"
                Text="Mailbox Database Name:"></asp:Localize>
            <asp:Localize ID="locMailboxDAG" runat="server" meta:resourcekey="locMailboxDAG"
                Text="Database Availability Group:"></asp:Localize>
        </td>
        <td>
            <asp:TextBox ID="txtMailboxDatabase" runat="server" Width="200px"></asp:TextBox>
        </td>
    </tr>

    <tr>
        <td class="SubHead" runat="server" id="archivingGroup" width="200" nowrap>
            <asp:Localize ID="locArchivingDatabase" runat="server" meta:resourcekey="locArchivingDatabase"
                Text="Archiving Database Name:"></asp:Localize>
        </td>
        <td>
            <asp:TextBox ID="txtArchivingDatabase" runat="server" Width="200px"></asp:TextBox>
        </td>
    </tr>


    <tr>
        <td class="SubHead">
            <asp:Localize ID="locKeepDeletedItems" runat="server" meta:resourcekey="locKeepDeletedItems"
                Text="Keep Deleted Items (days):"></asp:Localize>
        </td>
        <td>
            <asp:TextBox ID="txtKeepDeletedItems" runat="server" Width="50px"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td class="SubHead">
            <asp:Localize ID="locKeepDeletedMailboxes" runat="server" meta:resourcekey="locKeepDeletedMailboxes"
                Text="Keep Deleted Mailboxes (days):"></asp:Localize>
        </td>
        <td>
            <asp:TextBox ID="txtKeepDeletedMailboxes" runat="server" Width="50px"></asp:TextBox>
        </td>
    </tr>
</table>
<br />
<table cellpadding="4" cellspacing="0" width="100%">
    <tr runat="server" id="clusteredMailboxServer">
        <td class="SubHead">
            <asp:Localize ID="locMailboxClusterName" runat="server" meta:resourcekey="locMailboxClusterName"
                Text="Clustered Mailbox Server:"></asp:Localize>
        </td>
        <td>
            <asp:TextBox ID="txtMailboxClusterName" runat="server" Width="200px"></asp:TextBox>
        </td>
    </tr>
    
    <tr>
        <td class="SubHead">
            <asp:Localize ID="Localize1" runat="server" meta:resourcekey="locPublicFolderServer"    ></asp:Localize>
        </td>
        <td>
            <asp:TextBox ID="txtPublicFolderServer" runat="server" Width="200px"></asp:TextBox>
        </td>
    </tr>
    
    <tr>
        <td class="SubHead">
            <asp:Localize ID="Localize2" runat="server" meta:resourcekey="locOABServer"    ></asp:Localize>
        </td>
        <td>
            <asp:TextBox ID="txtOABServer" runat="server" Width="200px"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td class="SubHead" width="200" nowrap valign="top">
            <asp:Localize ID="locHubTransport" runat="server" meta:resourcekey="locHubTransport"
                Text="Hub Transport Service:"></asp:Localize>
        </td>
        <td>
            <asp:DropDownList ID="ddlHubTransport" runat="server" CssClass="form-control">
            </asp:DropDownList>
            <CPCC:StyleButton id="btnAdd" CssClass="btn btn-success" runat="server" OnClick="btnAdd_Click"> <i class="fa fa-plus">&nbsp;</i>&nbsp;<asp:Localize runat="server" meta:resourcekey="btnAddText"/> </CPCC:StyleButton><br />
            <asp:GridView ID="gvHubTransport" runat="server" AutoGenerateColumns="False" EmptyDataText="gvRecords"
                CssSelectorClass="NormalGridView" OnRowCommand="gvHubTransport_RowCommand" meta:resourcekey="gvHubTransport">
                <Columns>
                    <asp:TemplateField meta:resourcekey="locServerNameColumn" ItemStyle-Width="100%" >
                        <ItemTemplate>
                            <asp:Label runat="server" ID="lblServiceName" Text='<%#Eval("ServiceName") + "(" + Eval("ServerName") +")"%>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                                        
                    <asp:TemplateField>
                        <ItemTemplate>
                            <CPCC:StyleButton id="cmdDelete" CssClass="btn btn-danger" runat="server" CommandName='RemoveServer' CommandArgument='<%#Eval("ServiceId") %>' OnClientClick="return confirm('Delete?');"> 
                                &nbsp;<i class="fa fa-trash-o"></i>&nbsp; 
                            </CPCC:StyleButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </td>
    </tr>
    <tr>
        <td class="SubHead" width="200" nowrap valign="top">
            <asp:Localize ID="locClientAccess" runat="server" meta:resourcekey="locClientAccess"
                Text="Client Access Service:"></asp:Localize>
        </td>
        <td>
            <asp:DropDownList ID="ddlClientAccess" runat="server" CssClass="form-control">
            </asp:DropDownList>
            <CPCC:StyleButton id="Button1" CssClass="btn btn-success" runat="server" OnClick="btnAddClientAccess_Click"> <i class="fa fa-plus">&nbsp;</i>&nbsp;<asp:Localize runat="server" meta:resourcekey="btnAddText"/> </CPCC:StyleButton><br />
            
            <asp:GridView ID="gvClients" runat="server" AutoGenerateColumns="False" EmptyDataText="gvRecords"
                CssSelectorClass="NormalGridView" OnRowCommand="gvClientAccess_RowCommand" meta:resourcekey="gvClientAccess">
                <Columns>
                    <asp:TemplateField meta:resourcekey="locServerNameColumn" ItemStyle-Width="100%" >
                        <ItemTemplate>
                            <asp:Label runat="server" ID="lblServiceName" Text='<%#Eval("ServiceName") + "(" + Eval("ServerName") +")"%>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                    <asp:TemplateField>
                        <ItemTemplate>
                            <CPCC:StyleButton id="cmdDelete" CssClass="btn btn-danger" runat="server" CommandName='RemoveServer' CommandArgument='<%#Eval("ServiceId") %>' OnClientClick="return confirm('Delete?');"> 
                                &nbsp;<i class="fa fa-trash-o"></i>&nbsp; 
                            </CPCC:StyleButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </td>
    </tr>
</table>
<br />
<fieldset>
    <legend>
        <asp:Label ID="lblSetupVariables" runat="server" meta:resourcekey="lblSetupVariables"
            Text="Setup Instruction Variables" CssClass="NormalBold"></asp:Label>&nbsp;
    </legend>
    <table cellpadding="2" cellspacing="0" width="100%" style="margin: 10px;">
        <tr>
            <td class="SubHead" valign="top" style="width: 200px;">
                <asp:Localize ID="locSmtpServers" runat="server" meta:resourcekey="locSmtpServers"
                    Text="SMTP Servers:"></asp:Localize>
            </td>
            <td>
                <asp:TextBox ID="txtSmtpServers" runat="server" Width="300px" CssClass="form-control"
                    TextMode="MultiLine" Rows="3"></asp:TextBox>
                <br />
                <asp:Localize ID="locSmtpComments" runat="server" meta:resourcekey="locSmtpComments"
                    Text=" * one SMTP server record per line"></asp:Localize>
            </td>
        </tr>
        <tr>
            <td class="SubHead">
                <asp:Localize ID="locAutodiscoverIP" runat="server" meta:resourcekey="locAutodiscoverIP"
                    Text="Autodiscover Server IP:"></asp:Localize>
            </td>
            <td>
                <asp:TextBox ID="txtAutodiscoverIP" runat="server" Width="100px" CssClass="form-control"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="SubHead">
                <asp:Localize ID="locAutodiscoverDomain" runat="server" meta:resourcekey="locAutodiscoverDomain"
                    Text="Autodiscover Server Domain:"></asp:Localize>
            </td>
            <td>
                <asp:TextBox ID="txtAutodiscoverDomain" runat="server" Width="300px" CssClass="form-control"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="SubHead">
                <asp:Localize ID="locOwaUrl" runat="server" meta:resourcekey="locOwaUrl" Text="OWA URL:"></asp:Localize>
            </td>
            <td>
                <asp:TextBox ID="txtOwaUrl" runat="server" Width="300px" CssClass="form-control"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="SubHead">
                <asp:Localize ID="locActiveSyncServer" runat="server" meta:resourcekey="locActiveSyncServer"
                    Text="ActiveSync Server:"></asp:Localize>
            </td>
            <td>
                <asp:TextBox ID="txtActiveSyncServer" runat="server" Width="300px" CssClass="form-control"></asp:TextBox>
            </td>
        </tr>
    </table>
</fieldset>


<div id="SeDiv" runat="server">
    <div class="Content">
        <h4>SpamExperts Info:</h4>
        <p>In order to use SpamExperts you will need an accout with them, You can use this link to get started (<a href="https://www.spamexperts.com/" target="_blank">https://www.spamexperts.com/</a>)</p>
        <p>Once you have your account set up, Create an Admin user with SE, then fill out the following form so SolidCP may contact SE. You must also create your MX template below in the DNS settings on this page to point to the SE Servers you are using.</p>
    </div>
<fieldset>
    <legend>
    <asp:Label ID="Label1" runat="server" meta:resourcekey="lblRouteFromSE"
            Text="SE Admin Credentials:" CssClass="NormalBold"></asp:Label>&nbsp;
        </legend>
    <div class="form-group">
            <asp:Label CssClass="col-xs-2 control-label" ID="locSchema" runat="server" meta:resourcekey="locSchema" Text="Schema:"></asp:Label>
            <div class="col-xs-10">
                <scp:BootstrapDropDownList ID="ddlSchema" runat="server" CssClass="InlineControl NormalTextBox">
                    <asp:ListItem Value="http" Text="http"></asp:ListItem>
                    <asp:ListItem Value="https" Text="https"></asp:ListItem>
                </scp:BootstrapDropDownList>
            </div>
        </div>
        <div class="clearfix"></div>

        <div class="form-group">
            <asp:Label CssClass="col-xs-2 control-label" ID="locUrl" runat="server" meta:resourcekey="locUrl" Text="Hostname:"></asp:Label>
            <div class="col-xs-9 col-sm-8 col-md-6 col-lg-5">
                <asp:TextBox ID="txtUrl" runat="server" CssClass="form-control"></asp:TextBox>
            </div>
            <div class="col-xs-1">
                <asp:RequiredFieldValidator ID="valRequireUrl" runat="server" meta:resourcekey="valUrl" ControlToValidate="txtUrl"
                    ErrorMessage="*" ValidationGroup="Edit" Display="Dynamic" SetFocusOnError="True">*</asp:RequiredFieldValidator>
            </div>
        </div>
        <div class="clearfix"></div>

        <div class="form-group">
            <asp:Label CssClass="col-xs-2 control-label" ID="locUser" runat="server" meta:resourcekey="locUser" Text="User:"></asp:Label>
            <div class="col-xs-9 col-sm-8 col-md-6 col-lg-5">
                <asp:TextBox ID="txtAdminUser" runat="server" CssClass="form-control" autocomplete="off"></asp:TextBox>
            </div>
            <div class="col-xs-1">
                <asp:RequiredFieldValidator ID="valRequireUser" runat="server" meta:resourcekey="valUser" ControlToValidate="txtAdminUser"
                    ErrorMessage="*" ValidationGroup="Edit" Display="Dynamic" SetFocusOnError="True">*</asp:RequiredFieldValidator>
            </div>
        </div>
        <div class="clearfix"></div>

        <div class="form-group">
            <asp:Label CssClass="col-xs-2 control-label" ID="locPassword" runat="server" meta:resourcekey="locPassword" Text="Password:"></asp:Label>
            <div class="col-xs-9 col-sm-8 col-md-6 col-lg-5">
                <asp:TextBox ID="txtAdminPassword" runat="server" CssClass="form-control" autocomplete="off"></asp:TextBox>
            </div>
        </div>
</fieldset>
<fieldset>
    <legend>
        <asp:Label ID="lblRouteFromSE" runat="server" meta:resourcekey="lblRouteFromSE"
            Text="Route from SE to:" CssClass="NormalBold"></asp:Label>&nbsp;
    </legend>
    <asp:UpdatePanel ID="GeneralUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
        <ContentTemplate>
            <asp:GridView id="gvSEDestinations" runat="server"  EnableViewState="true" AutoGenerateColumns="false"
	        Width="100%" EmptyDataText="" CssSelectorClass="NormalGridView" OnRowCommand="gvSEDestinations_RowCommand" >
	        <Columns>
		        <asp:TemplateField HeaderText="Destinations">
			        <ItemStyle Width="70%"></ItemStyle>
			        <ItemTemplate>
				        <asp:Label id="lblSEDestination" runat="server" EnableViewState="true" ><%# PortalAntiXSS.Encode((string)Container.DataItem)%></asp:Label>
                    </ItemTemplate>
		        </asp:TemplateField>
                <asp:TemplateField>
			        <ItemTemplate>
				        &nbsp;<asp:ImageButton id="imgDelRouteFromSE" runat="server" Text="Delete" SkinID="ExchangeDelete"
					        CommandName="DeleteItem" CommandArgument='<%# (string)Container.DataItem %>' 
					        meta:resourcekey="cmdDelete" OnClientClick="return confirm('Are you sure you want to delete selected route?')" >
					            </asp:ImageButton>
			        </ItemTemplate>
		        </asp:TemplateField>
	        </Columns>
	        </asp:GridView>
            <br />

            <asp:TextBox ID="tbSEDestinations" runat="server"></asp:TextBox>
            <asp:Button ID="bntAddSEDestination" runat="server" Text="Add" meta:resourcekey="bntAddSEDestination" OnClick="bntAddSEDestination_Click" CausesValidation="false"/>
            <br />
        </ContentTemplate>
    </asp:UpdatePanel>
</fieldset>
</div>


