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

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

    <div class="skjema-admin__page__field">
        <asp:Label 
            ID="Label1" 
            CssClass="skjema-admin__page__label"
            runat="server">
            Navn *
        </asp:Label>

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

        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Du må angi et navn." ControlToValidate="txtName" Display="Dynamic"></asp:RequiredFieldValidator>
    </div>

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

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

    <div class="skjema-admin__page__field">
        <asp:Label 
            ID="Label9" 
            CssClass="skjema-admin__page__label"
            runat="server">
            Fra-status *
        </asp:Label>

        <asp:DropDownList 
            ID="ddlFromFlowStatus" 
            runat="server" 
            CssClass="skjema-admin__page__text"
            DataTextField="Name" 
            DataValueField="FlowStatusID">
        </asp:DropDownList>

        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="ddlFromFlowStatus"
            ErrorMessage="Du må velge en fra-status"></asp:RequiredFieldValidator>
    </div>

    <div class="skjema-admin__page__field">
        <asp:Label 
            ID="Label4" 
            CssClass="skjema-admin__page__label"
            runat="server">
            Til-status *
        </asp:Label>

        <asp:DropDownList 
            ID="ddlToFlowStatus" 
            CssClass="skjema-admin__page__text"
            runat="server" 
            DataTextField="Name" 
            DataValueField="FlowStatusID">
        </asp:DropDownList>

        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="ddlToFlowStatus"
            ErrorMessage="Du må velge en til-status"></asp:RequiredFieldValidator>
    </div>

    <div class="skjema-admin__page__field">
        <label class="skjema-admin__page__label">
            Kjør ved *
        </label>

        <asp:DropDownList
            CssClass="skjema-admin__page__text"
            ID="ddlRuleType" 
            runat="server">
            <asp:ListItem Text="---" Value="---" />
            <asp:ListItem Text="Innsending" Value="SUBMIT" />
            <asp:ListItem Text="Lagring" Value="SAVE" />
            <asp:ListItem Text="Gjenopptaking" Value="RESUME" />
            <asp:ListItem Text="Tidsavbrudd" Value="TIMEOUT" />
            <asp:ListItem Text="Saksbehandling" Value="CUSTOM" />
        </asp:DropDownList>

        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="ddlRuleType" InitialValue="---"
            ErrorMessage="Du må velge når regelen skal kjøres"></asp:RequiredFieldValidator>
    </div>

    <div class="skjema-admin__page__field">
        <label class="skjema-admin__page__label">
            Tidsavbrudd (dager)
        </label>

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

    <div class="skjema-admin__page__field">
        <label class="skjema-admin__page__label">
            Regelfelt i skjema
        </label>

        <asp:TextBox 
            CssClass="skjema-admin__page__text mb-3"
            ID="txtRuleField" 
            runat="server">
        </asp:TextBox>

        Oppgi navn på felt (radioknapper eller nedtrekksliste) i skjema, og navn på valg, som skal avgjøre om denne regelen skal kjøres. 
        <br />
        Format: feltnavn:valgnavn. 
    </div>

    <div class="skjema-admin__page__field">
        <asp:Label 
            ID="Label3" 
            CssClass="skjema-admin__page__label"
            runat="server">
            Automatisk kjøring
        </asp:Label>

        <asp:TextBox 
            ID="txtMatchModels" 
            CssClass="skjema-admin__page__text"
            runat="server" 
            TextMode="MultiLine" 
            Height="50px">
        </asp:TextBox>
    </div>

    <div class="skjema-admin__page__field">
        <label class="skjema-admin__page__label">
            Opprett oppgave
        </label>

        <asp:CheckBox 
            runat="server" 
            CssClass="skjema-admin__page__tick"
            ID="chkCreateInstanceTask" />
    </div>

    <div class="skjema-admin__page__field">
        <label class="skjema-admin__page__label">
            Krever melding
        </label>

        <asp:CheckBox 
            class="skjema-admin__page__tick"
            runat="server" 
            ID="checkIsMessageRequired" />
    </div>

    <div class="skjema-admin__page__field">
        <asp:Label 
            ID="Label5" 
            class="skjema-admin__page__label"
            runat="server">
            Meldingsprompt
        </asp:Label>

        <asp:TextBox 
            ID="txtMessagePrompt" 
            class="skjema-admin__page__text"
            runat="server" 
            TextMode="MultiLine" 
            Height="50px">
        </asp:TextBox>
    </div>

    <div class="skjema-admin__page__field">
        <asp:Label 
            ID="Label2" 
            class="skjema-admin__page__label" 
            runat="server">
            Beskrivelse
        </asp:Label>

        <asp:TextBox 
            ID="txtDescription" 
            class="skjema-admin__page__text"
            runat="server" 
            TextMode="MultiLine"
            Height="50px">
        </asp:TextBox>
    </div>

    <asp:Button 
        ID="btnCreate"
        runat="server" 
        CssClass="skjema-admin__button skjema-admin__button--primary mb-5"
        Text="Opprett" 
        OnClick="btnCreate_Click">
    </asp:Button>

    <asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label>
</asp:Content>
