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

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server">
    <h1 class="skjema-admin__page-title">
        Mottak
    </h1>

    <asp:Button 
        ID="btnCreate" 
        runat="server" 
        Text="OPPRETT"
        CssClass="skjema-admin__button skjema-admin__button--primary"
        OnClick="btnCreate_OnClick" />

        <div>
            <br/>
            <asp:Label runat="server" id="lblMessage" ForeColor="Red"></asp:Label>
            <asp:GridView runat="server" ID="grid"
                DataKeyNames="Id" 
                ItemType="eDocument.Server.Administrator.VapourClients.VapourClientInfo"
                AutoGenerateEditButton="False"
                SelectMethod="GetData"
                OnRowDataBound="grid_OnRowDataBound"
                AutoGenerateColumns="false">
            <Columns>
                <asp:DynamicField DataField="Id" Visible="False" />
                <asp:DynamicField HeaderText="Kjører" DataField="IsRunning" />
                <asp:DynamicField DataField="Name" />
                <asp:DynamicField DataField="Status" />
                <asp:DynamicField HeaderText="Antall skjema" DataField="SubscriptionCount" />
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:LinkButton runat="server" Enabled='<%#Eval("IsRunning") %>'  CommandName="Action" id="btnDisconnect" Text="Koble fra" OnCommand="btnDisconnect_OnCommand" CommandArgument='<%#Bind("Id") %>'>Stopp</asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:templatefield>
				    <itemtemplate>
				        <a href='Details.aspx?id=<%#Eval("Id")%>'>Detaljer</a>
				    </itemtemplate>
                </asp:templatefield>
                <asp:templatefield>
				    <itemtemplate>
				        <a href='Edit.aspx?id=<%#Eval("Id")%>'>Rediger</a>
				    </itemtemplate>
                </asp:templatefield>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:LinkButton runat="server" Enabled='<%#Eval("CanDelete") %>' CommandName="Action" id="btnRemove" Text="Fjern" OnCommand="btnRemove_OnCommand" CommandArgument='<%#Bind("Id") %>'>Fjern</asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
</asp:Content>