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

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">
    
    <h1 class="skjema-admin__page-title">
        Innsendinger med feil
    </h1>

    <p class="mb-4">
        Denne siden gir en oversikt over avbrutte prosesser. 
        Listen viser navnet på prosessene som er avbrutt og hvor mange prosess-instanser som er avbrutt av denne. 
        Klikk på detaljer for å se prosess-instansene som ble avbrutt.
    </p>

    <h2 class="skjema-admin__section-title">
        Prosesser med feil
    </h2>

    <asp:GridView 
        ID="dgAbortedProcess" 
        runat="server" 
        AutoGenerateColumns="False" 
        Width="100%"
        Border="0"
        CssClass="skjema-admin__table"
        HeaderStyle-CssClass="HeaderStyle" 
        ItemStyle-CssClass="ItemStyle" 
        AlternatingItemStyle-CssClass="AlternatingItemStyle"
        OnRowDataBound="dgAbortedProcess_OnRowDataBound"
        AllowSorting="False">
        <AlternatingRowStyle CssClass="AlternatingItemStyle"></AlternatingRowStyle>
        <RowStyle CssClass="ItemStyle"></RowStyle>
        <HeaderStyle CssClass="HeaderStyle"></HeaderStyle>
        <Columns>
            <asp:BoundField Visible="False" DataField="ProcessId"></asp:BoundField>
            <asp:HyperLinkField DataTextField="ProcessName" HeaderText="Prosess" DataNavigateUrlFields="ProcessID"
                DataNavigateUrlFormatString="../Process/Details.aspx?ProcessID={0}" />
            <%--<asp:BoundField DataField="ConsumerName" HeaderText="Organisasjon"></asp:BoundField>--%>
            <asp:BoundField DataField="Count" SortExpression="Count ASC" HeaderText="Antall"></asp:BoundField>
            <asp:HyperLinkField Text="Detaljer" HeaderText="Detaljer" DataNavigateUrlFields="ProcessID" DataNavigateUrlFormatString="~/AbortedProcessListItem/List.aspx?ProcessID={0}" />
        </Columns>
    </asp:GridView>
    
    <p class="mb-4">
        <asp:Label ID="lblNoAbortedProcessMessage" runat="server">Ingen avbrutte prosesser.</asp:Label>
    </p>

<%--    <div id="divPendingProcesses" runat="server">
        <h2 class="skjema-admin__section-title">
            Prosesser på vent
        </h2>

        <asp:GridView 
            ID="dgPendingProcesses" 
            runat="server" 
            AutoGenerateColumns="False" 
            Width="100%"
            Border="0"
            CssClass="skjema-admin__table"
            HeaderStyle-CssClass="HeaderStyle" 
            ItemStyle-CssClass="ItemStyle" 
            AlternatingItemStyle-CssClass="AlternatingItemStyle"
            OnRowDataBound="dgPendingProcess_OnRowDataBound"
            AllowSorting="False">
            <AlternatingRowStyle CssClass="AlternatingItemStyle"></AlternatingRowStyle>
            <RowStyle CssClass="ItemStyle"></RowStyle>
            <HeaderStyle CssClass="HeaderStyle"></HeaderStyle>
            <Columns>
                <asp:BoundField Visible="False" DataField="ProcessId"></asp:BoundField>
                <asp:HyperLinkField DataTextField="ProcessName" HeaderText="Prosess" DataNavigateUrlFields="ProcessID"
                                    DataNavigateUrlFormatString="../Process/Details.aspx?ProcessID={0}" />
                <asp:BoundField DataField="Count" SortExpression="Count ASC" HeaderText="Antall"></asp:BoundField>
                <asp:HyperLinkField Text="Detaljer" HeaderText="Detaljer" DataNavigateUrlFields="ProcessID" DataNavigateUrlFormatString="~/AbortedProcessListItem/List.aspx?ProcessID={0}&isPending=1" />
            </Columns>
        </asp:GridView>
        
        <p class="mb-4">
            <asp:Label ID="lblNoPendingProcessMessage" runat="server">Ingen prosesser i påvente.</asp:Label>
        </p>
    </div>--%>
    
    <br />

    <p class="mb-4">
        <asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label>
    </p>

    <br />

    <asp:Button 
        ID="btnRefresh" 
        runat="server" 
        Text="Oppdater" 
        CssClass="skjema-admin__button skjema-admin__button--primary"
        OnClick="btnRefresh_Click">
    </asp:Button>
</asp:Content>
