<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LicenseManagement.ascx.cs" Inherits="Zap.BI.Portal.Controls.Settings.LicenseManagement" %>

<zapWeb:ZapUpdatePanel runat="server">
    <ContentTemplate>
        <div style="padding: 0 10px 0 10px;" class="ui-text">
            <fieldset id="NoLicenseFieldSet" runat="server" style="width: 650px; display: none;" class="ui-fieldset">
                <legend>
                    <asp:Label runat="server" Text="<%$ Resources: Controls.Settings.SettingsText, Label_NoLicenseHeading %>" />
                </legend>
                <asp:Label runat="server" Text="<%$ Resources: Controls.Settings.SettingsText, Message_EnterProductKey %>" CssClass="ui-text" /><br />
                <br />
                <asp:Label runat="server" Text="<%$ Resources: Controls.Settings.SettingsText, Message_GetProductKey %>" CssClass="ui-text" /><br />
                <br />

                <asp:HyperLink runat="server" ID="linkLicenseDownload" Text="<%$ Resources: Controls.Settings.SettingsText, Label_LicenseDownload %>" Target="_blank" CssClass="ui-text ui-link" NavigateUrl="http://www.zapbi.com/Support/LicenseDownload.aspx"/>

                <br />
                <asp:Label runat="server" ID="LicenseFailures" Visible="false" CssClass="ErrorLabel ui-text" />
            </fieldset>

            <fieldset runat="server" Visible="<%# !IsInCloud || divResults.Visible %>" style="width: 650px;" class="ui-fieldset">
                <legend>
                    <asp:Label runat="server" Text="<%$ Resources: Controls.Settings.SettingsText, Label_Licensing_ProductDetails %>" />
                </legend>
                <table>
                    <tr runat="server" Visible="<%# !IsInCloud %>">
                        <td style="padding-right: 10px; vertical-align: top;">
                            <asp:Label runat="server" Text="<%$ Resources: Controls.Settings.SettingsText, Label_Licensing_ProductKey %>" CssClass="ui-form-label" />
                        </td>
                        <td style="padding-right: 5px;" class="licenseManagement-licenseTypes">
                            <asp:RadioButton runat="server" AutoPostBack="true" ID="DefaultLicense" GroupName="LicenseType" Text="<%$ Resources: Controls.Settings.SettingsText, LicenseType_Default %>" ToolTip="<%$ Resources: Controls.Settings.SettingsTooltips, DefaultLicense_Text %>" CssClass="ui-form-control ui-radio ui-radio-label"/>
                            <asp:RadioButton runat="server" AutoPostBack="true" ID="CustomLicense" GroupName="LicenseType" Text="<%$ Resources: Controls.Settings.SettingsText, LicenseType_Custom %>" ToolTip="<%$ Resources: Controls.Settings.SettingsTooltips, ProductKey_Text %>" CssClass="ui-form-control ui-radio ui-radio-label"/>
                            <div class="ui-indented ui-field"><asp:TextBox runat="server" ID="txtClientGuid" Columns="40" CssClass="ui-input-box" ToolTip="<%$ Resources: Controls.Settings.SettingsText, Tooltip_LicenseKey %>" /></div>
                        </td>
                        <td style="vertical-align: top;">
                            <asp:Button runat="server" ID="bRequestLicense" Text="<%$ Resources: Controls.Settings.SettingsText, Button_RequestLicense %>" ToolTip="<%$ Resources: Controls.Settings.SettingsText, ToolTip_RequestLicense %>" OnClick="RequestLicense_Click" CssClass="button" />
                            <asp:Button runat="server" ID="CloseButton" Text="<%$ Resources: Controls.Settings.SettingsText, Menu_Close %>" CssClass="button standardbutton" OnClick="CloseButton_Click" Visible="false" />
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <div runat="server" id="divLicenseServiceUrl" visible="false" class="ui-text"></div>
                        </td>
                    </tr>
                    <tr>
                        <td runat="server" Visible="<%# !IsInCloud %>"></td>
                        <td runat="server" colspan="<%# IsInCloud ? 3 : 2 %>">
                            <div runat="server" id="divResults" visible="false" class="ErrorLabel ui-text"></div>
                        </td>
                    </tr>
                </table>
            </fieldset>

            <fieldset style="width: 650px;" class="ui-fieldset">
                <legend>
                    <asp:Label runat="server" Text="<%$ Resources: Controls.Settings.SettingsText, Label_LicenseDetails %>" />
                </legend>

                <div id="PopupDisplayLimiter" runat="server">

                    <asp:GridView runat="server" ID="LicenseDetailsGridView" AutoGenerateColumns="false"
                        BorderWidth="0" GridLines="None"
                        CssClass="large-rows wrap-cells"
                        RowStyle-CssClass="grid-row dxgvDataRow_DE ui-text"
                        AlternatingRowStyle-CssClass="grid-row dxgvDataRowAlt_DE"
                        HeaderStyle-CssClass="grid-header dxgvHeader_DE"
                        EmptyDataRowStyle-CssClass="grid-empty">
                        <Columns>
                            <asp:BoundField HeaderText="<%$ Resources: Controls.Settings.SettingsText, Label_LicenseRestrictionType %>" DataField="RestrictionType" HtmlEncode="false" HeaderStyle-Width="30%" ItemStyle-Width="30%" />
                            <asp:TemplateField HeaderText="<%$ Resources: Controls.Settings.SettingsText, Label_LicenseRestrictionDetails %>">
                                <ItemTemplate>
                                    <asp:Label ID="lblDetails" runat="server" Text='<%# Eval("Details") %>' ToolTip='<%# Eval("Tooltip") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>

                        <EmptyDataTemplate>
                            <asp:Label runat="server" Text="<%$ Resources: Controls.Settings.SettingsText, Label_NoLicense %>" CssClass="ui-text" />
                        </EmptyDataTemplate>
                    </asp:GridView>

                </div>

            </fieldset>

        </div>

    </ContentTemplate>

</zapWeb:ZapUpdatePanel>
