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

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server">
    <asp:Label ID="lblHeader" CssClass="skjema-admin__page-title" runat="server" Text="Velg organisasjon"/>

    <div class="skjema-admin__mb-80">
        <asp:Label ID="lblInfo" runat="server" Text="Din bruker kan være tilknyttet flere organisasjoner. Velg en organisasjon for å administrere."/>
        <asp:Label ID="lblMessage" runat="server" ForeColor="Red"/>
    </div>

    <asp:GridView
        runat="server"
        ID="grid"
        DataKeyNames="Id" 
        Border="0"
        Width="100%"
        CssClass="skjema-admin__table skjema-admin__table--smaller-width-1"
        ItemType="eDocument.Model.Customer"
        AutoGenerateEditButton="False"
        SelectMethod="GetData"
        AutoGenerateColumns="false">
        <Columns>
            <asp:DynamicField DataField="Id" Visible="False" />
            <asp:TemplateField HeaderText="Organisasjon">
                <ItemTemplate>
                    <asp:LinkButton 
                        runat="server"
                        CommandName="Action"
                        id="btnSelectCustomer"
                        Text='<%# Eval("Name") %>'
                        OnCommand="btnSelectCustomer_OnCommand"
                        CommandArgument='<%#Bind("Id") %>'>
                    </asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:DynamicField DataField="Username" HeaderText="Brukernavn"/>
        </Columns>
    </asp:GridView>
</asp:Content>