<%@ Page language="c#" Codebehind="List.aspx.cs" AutoEventWireup="True" Inherits="eDocument.Server.Administrator.Action.List" MasterPageFile="~/Site.Master" %>

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

    <h1 class="skjema-admin__page-title">
        Oversikt over handlinger
    </h1>

    <p class="mb-5">
	    Denne siden gir en oversikt over de handlinger du har opprettet. Du kan se 
	    detaljer for, redigere og slette eksisterende handlinger.
    </p>

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

    <asp:datagrid 
        id="dgActions" 
        runat="server" 
        AutoGenerateColumns="False" 
        Width="100%" 
        HeaderStyle-CssClass="HeaderStyle"
	    ItemStyle-CssClass="ItemStyle" 
        AlternatingItemStyle-CssClass="AlternatingItemStyle" 
        CssClass="skjema-admin__table"
        Border="0"
        AllowSorting="False">
	    <Columns>
		    <asp:BoundColumn DataField="ActionID" Visible="False"></asp:BoundColumn>
		    <asp:BoundColumn DataField="Name" SortExpression="Name ASC" HeaderText="Navn"></asp:BoundColumn>
		    <asp:BoundColumn DataField="ActionTypeID" Visible="False"></asp:BoundColumn>
		    <asp:BoundColumn HeaderText="Handlingstype"></asp:BoundColumn>
		    <asp:BoundColumn DataField="Comment" HeaderText="Kommentar"></asp:BoundColumn>
		    <asp:BoundColumn DataField="CreatedOn" SortExpression="CreatedOn ASC" HeaderText="Opprettet"></asp:BoundColumn>
		    <asp:HyperLinkColumn Text="Rediger" DataNavigateUrlField="ActionID" DataNavigateUrlFormatString="Edit.aspx?ActionID={0}"/>
		    <asp:ButtonColumn Text="Slett" CommandName="Delete"></asp:ButtonColumn>
	    </Columns>
    </asp:datagrid>

    <asp:label id="lblMessage" runat="server" ForeColor="Red"></asp:label>

</asp:Content>