<%@ Page Language="c#" CodeBehind="Details.aspx.cs" AutoEventWireup="True" Inherits="eDocument.Server.Administrator.Xsl.Details" MasterPageFile="~/Site.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">
    <h1 class="skjema-admin__page-title">Detaljer for XSL objekt
    </h1>

    <p class="mb-5">
        Denne siden viser deg detaljer for et XSL objekt. Klikk på "Rediger" knappen dersom
        du ønsker å redigere XSL objektet. Klikk på "Vis XSL" linken dersom du ønsker å
        se XSL filen.
    </p>

    <h2 class="skjema-admin__section-title">Details
    </h2>

    <div class="skjema-admin__page__field">
        <asp:Label ID="Label4" runat="server">Navn</asp:Label>
        <asp:Label ID="lblName" runat="server"></asp:Label>

        <asp:HyperLink ID="Hyperlink2" runat="server" Target="_blank" Visible="False">Help</asp:HyperLink>
    </div>

    <div class="skjema-admin__page__field">
        <asp:Label ID="Label3" runat="server">Kommentar</asp:Label>
        <asp:Label ID="lblComment" runat="server"></asp:Label>
    </div>

    <div class="skjema-admin__page__field">
        <asp:Label ID="Label7" runat="server">Opprettet</asp:Label>
        <asp:Label ID="lblCreated" runat="server"></asp:Label>

        <asp:HyperLink ID="Hyperlink8" runat="server" Target="_blank" NavigateUrl="~/Help/Created.aspx"
            Visible="False">Help</asp:HyperLink>
    </div>


    <asp:Button
        ID="btnEdit"
        runat="server"
        CssClass="skjema-admin__button skjema-admin__button--primary"
        Text="Rediger"
        OnClick="btnEdit_Click"></asp:Button>

    <p>
        <asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label>
    </p>

    <h2 class="skjema-admin__section-title mt-5">Oppgaver
    </h2>

    <div class="skjema-admin__page__field">
        <asp:HyperLink
            ID="lnkXsl"
            runat="server"
            NavigateUrl="~/Xsl/DownloadXsl.aspx?xslID="
            Target="_blank">
            Vis XSL
        </asp:HyperLink>
    </div>

    <div id="divSuperAdmin" runat="server" visible="False">
        <h2 class="skjema-admin__section-title">Skjemaer
        </h2>

        <div class="skjema-admin__page__field">
            <asp:DropDownList
                DataValueField="Id"
                CssClass="skjema-admin__page__text mb-4"
                DataTextField="FormId"
                ID="ddlTemplates"
                runat="server" />

            <asp:Button
                Text="Legg til"
                CssClass="skjema-admin__button skjema-admin__button--primary mb-5"
                ID="btnAddTemplate"
                runat="Server"
                OnClick="btnAddTemplate_Click" />

            <asp:GridView
                ID="gridTemplates"
                runat="server"
                DataKeyNames="Id"
                CssClass="skjema-admin__table"
                Border="0"
                Width="100%"
                AutoGenerateColumns="false"
                OnRowDeleting="gridTemplates_RowDeleting">

                <Columns>
                    <asp:HyperLinkField DataTextField="Name" DataNavigateUrlFields="Id"
                        DataNavigateUrlFormatString="../eDocumentTemplate/Details.aspx?eDocumentTemplateID={0}"
                        HeaderText="Navn" />
                    <asp:BoundField DataField="FormId" HeaderText="FormID" />
                    <asp:TemplateField HeaderText="Fjern">
                        <ItemTemplate>
                            <asp:LinkButton ID="lnkDeleteTemplate" CommandArgument='<%# Eval("Id") %>'
                                CommandName="Delete" runat="server">Fjern</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>

        <h2 class="skjema-admin__section-title">Systemer
        </h2>

        <asp:DropDownList
            DataValueField="Id"
            DataTextField="Name"
            CssClass="skjema-admin__page__text mb-4"
            ID="ddlDestinationSystem"
            runat="server" />

        <div class="mb-5">
            <asp:Button
                Text="Legg til"
                ID="btnAddDestinationSystem"
                CssClass="skjema-admin__button skjema-admin__button--primary mr-4"
                runat="Server"
                OnClick="btnAddDestinationSystem_Click" />

            <a href='../DestinationSystem/Manage.aspx?Return=~/Xsl/Details.aspx?XslID=<%= Request.QueryString["XslID"] %>'>Opprett system
            </a>
        </div>

        <asp:GridView
            ID="gridDestinationSystem"
            runat="server"
            DataKeyNames="Id"
            CssClass="skjema-admin__table"
            Border="0"
            Width="100%"
            AutoGenerateColumns="false"
            OnRowDeleting="gridDestinationSystem_RowDeleting">
            <Columns>
                <asp:HyperLinkField DataTextField="Name" DataNavigateUrlFields="Id"
                    DataNavigateUrlFormatString="../DestinationSystem/Edit.aspx?DestinationSystemID={0}"
                    HeaderText="Navn" />
                <asp:BoundField DataField="Description" HeaderText="Beskrivelse" />
                <asp:TemplateField HeaderText="Fjern">
                    <ItemTemplate>
                        <asp:LinkButton ID="lnkDeleteSystem" CommandArgument='<%# Eval("Id") %>'
                            CommandName="Delete" runat="server">Fjern</asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
</asp:Content>
