<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Manage.aspx.cs" Inherits="eDocument.Server.Administrator.DestinationSystem.Manage" MasterPageFile="~/Site.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">

    <h2 class="skjema-admin__page-title">
        Nytt system
    </h2>

    <div class="skjema-admin__page__field">
        <label class="skjema-admin__page__label">
            Navn *:
        </label>

        <asp:TextBox 
            ID="txtDestinationSystemName" 
            CssClass="skjema-admin__page__text"
            runat="server" />

        <asp:RequiredFieldValidator
            ID="requiredName" 
            runat="server" 
            Display="Dynamic"
            ErrorMessage="*" 
            ControlToValidate="txtDestinationSystemName">
        </asp:RequiredFieldValidator>
    </div>

    <div class="skjema-admin__page__field">
        <label class="skjema-admin__page__label">
            Beskrivelse:
        </label>

        <asp:TextBox 
            ID="txtDestionationSystemDescription" 
            CssClass="skjema-admin__page__text"
            runat="server" />
    </div>

    <div class="mb-5">
        <asp:Button 
            ID="btnCreateDestinationSystem"
            CssClass="skjema-admin__button skjema-admin__button--primary"
            Text="Opprett" 
            runat="server" 
            OnClick="btnCreateDestinationSystem_Click" />
    </div>

    <h2 class="skjema-admin__section-title">
        Eksisterende systemer
    </h2>

    <asp:GridView 
        ID="gridDestionationSystems" 
        CssClass="skjema-admin__table"
        Border="0"
        Width="100%"
        runat="server"
        AutoGenerateColumns="false"
        DataKeyNames="DestinationSystemID" 
        OnRowDeleting="gridDestionationSystems_RowDeleting">
        <Columns>
            <asp:HyperLinkField HeaderText="Navn" DataTextField="Name" DataNavigateUrlFields="DestinationSystemID,Name"
                DataNavigateUrlFormatString="Edit.aspx?DestinationSystemID={0}&Name={1}" />
            <asp:BoundField DataField="Description" HeaderText="Beskrivelse" />
            <asp:TemplateField HeaderText="Slett">
                <ItemTemplate>
                    <asp:LinkButton ID="lnkDelete" CausesValidation="false" CommandArgument='<%# Eval("DestinationSystemID") %>'
                        CommandName="Delete" runat="server">Slett</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>

</asp:Content>
