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

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

    <h3 class="skjema-admin__section-title">
        Oppdater personalia
    </h3>

    <div class="skjema-admin__page__field">

        <label class="skjema-admin__page__label">
            E-mail
        </label>

        <asp:TextBox 
            ID="txtEmail" 
            CssClass="skjema-admin__page__text"
            runat="server" 
            MaxLength="300" >
        </asp:TextBox>

        <asp:RequiredFieldValidator runat="server" ControlToValidate="txtEmail" ForeColor="Red" Display="Dynamic">
            *
        </asp:RequiredFieldValidator>

        <asp:RegularExpressionValidator 
            runat="server" 
            ControlToValidate="txtEmail" 
            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" 
            Display="Dynamic" 
            ErrorMessage="Ugyldig e-postadresse" 
            ForeColor="Red">
        </asp:RegularExpressionValidator>
        
        <asp:Label runat="server" ID="lblEmail" ForeColor="Red" />
    </div>

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

        <asp:TextBox 
            CssClass="skjema-admin__page__text"
            ID="txtDisplayName" 
            runat="server" 
            MaxLength="300">
        </asp:TextBox>
        
        <asp:RequiredFieldValidator runat="server" ControlToValidate="txtDisplayName" Display="Dynamic" ForeColor="Red">*</asp:RequiredFieldValidator>
    </div>

    <div class="skjema-admin__page__field">

        <div class="mb-4">
            <asp:HyperLink 
                runat="server" 
                NavigateUrl="~/User/SetPassword.aspx">
                Endre passord
            </asp:HyperLink>
        </div>
        
        <br />

        <asp:Button 
            runat="server" 
            ID="btnSetProfileInfo" 
            CssClass="skjema-admin__button skjema-admin__button--primary"
            OnClick="btnSetProfileInfo_OnClick" 
            Text="Lagre endringer" />
    </div>
 
    <asp:Label runat="server" ID="lblOkMessage" ForeColor="Green"></asp:Label>
    <asp:Label runat="server" ID="lblErrorMessage" ForeColor="Green"></asp:Label>

    <br/>
    <br/>   
    <h3 class="skjema-admin__section-title">
        Mine roller
    </h3>

    <asp:GridView 
        runat="server" 
        ID="grid"
        DataKeyNames="CustomerId"
        ItemType="eDocument.Server.Administrator.User.AdminUserOnCustomerWithRoles"
        CssClass="skjema-admin__table"
        Border="0"
        Width="100%"
        AutoGenerateEditButton="False"
        SelectMethod="GetData"
        AutoGenerateColumns="false">
        <Columns>
            <asp:DynamicField DataField="CustomerId" Visible="False" />
            <asp:DynamicField DataField="Username" />
            <asp:DynamicField DataField="Name" />
            <asp:TemplateField HeaderText="Roles">
                <ItemTemplate>
                    <%#Eval("Roles")%>
                </ItemTemplate>
            </asp:TemplateField>
            <%--                <asp:TemplateField HeaderText="Velg">
                    <ItemTemplate>
                        <asp:LinkButton runat="server" CommandName="Action" id="btnSelectCustomer" Text="Velg" OnCommand="btnSelectCustomer_OnCommand" CommandArgument='<%#Bind("CustomerId") %>'>Velg</asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>--%>
        </Columns>
    </asp:GridView>
</asp:Content>
