<%@ Page Language="C#" MasterPageFile="~/MasterPage/MasterPage.master" AutoEventWireup="true" CodeFile="Insert.aspx.cs" Inherits="address_book_Insert" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="menuleft" Runat="Server">
    <a runat="server" id="tag_voltar" title="Voltar">Voltar</a>
    </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="menurigth" Runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="main" Runat="Server">
    
    
    
<asp:MultiView ID="mv" runat="server" ActiveViewIndex="0">
<asp:View ID="v_insert" runat="server">

    <h2 title="titulo"> Agenda - Inserir
    </h2> 
    
    <p title="titulo"> 
        <asp:Label ID="Label2" runat="server" Text="Nome"></asp:Label>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="text_box_nome" runat="server"  Width="394px"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
        ControlToValidate="text_box_nome" CssClass="validate" 
        ErrorMessage="Campo de preenchimento obrigatório" Display="Dynamic"></asp:RequiredFieldValidator>
        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
            ControlToValidate="text_box_nome" CssClass="validate" 
            ErrorMessage="Este campo não pode conter caracteres especiais" 
            ValidationExpression="^[0-9a-zA-Z. ]{1,50}"  Display="Dynamic"></asp:RegularExpressionValidator>
        </p>
    
    
    <p title="titulo"> 
        <asp:Label ID="label_tipo" runat="server" Text="Tipo"></asp:Label>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="text_box_tipo" runat="server" ></asp:TextBox>
        <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
            ControlToValidate="text_box_tipo" CssClass="validate" 
            ErrorMessage="Este campo não pode conter caracteres especiais" 
            ValidationExpression="^[0-9a-zA-Z. ]{1,50}" Display="Dynamic"></asp:RegularExpressionValidator>
    </p>
    
    
    
    <p title="titulo"> 
        <asp:Label ID="label_morada" runat="server" Text="Morada"></asp:Label>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="text_box_morada" runat="server" Height="66px" 
            Width="280px"></asp:TextBox>
            
        <asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server" 
        ControlToValidate="text_box_morada" CssClass="validate" 
        ErrorMessage="Este campo não pode conter caracteres especiais" 
        ValidationExpression="^[0-9a-zA-Z. ]{1,100}" Display="Dynamic"></asp:RegularExpressionValidator>
    </p>
    
    
    <p title="titulo"> 
        <asp:Label ID="label_n_telefone" runat="server" Text="Nº Telefone"></asp:Label>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="text_box_telefone" runat="server" 
            Width="148px"></asp:TextBox>
            
        <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" 
        ControlToValidate="text_box_telefone" CssClass="validate" 
        ErrorMessage="Este campo não pode conter caracteres especiais" 
        ValidationExpression="^[0-9a-zA-Z. ]{1,15}" Display="Dynamic"></asp:RegularExpressionValidator>
    </p>
    
    
    <p title="titulo"> 
        <asp:Label ID="label_n_fax" runat="server" Text="Nº Fax"></asp:Label>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="text_box_fax" runat="server"  Width="148px"></asp:TextBox>
         <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" 
        ControlToValidate="text_box_fax" CssClass="validate" 
        ErrorMessage="Este campo não pode conter caracteres especiais" 
        ValidationExpression="^[0-9a-zA-Z. ]{1,15}" Display="Dynamic"></asp:RegularExpressionValidator>
    </p>
    
    
    <p title="titulo"> 
        <asp:Label ID="label_email" runat="server" Text="E-mail"></asp:Label>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="text_box_email" runat="server"  Width="196px"></asp:TextBox>
         <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" 
        ControlToValidate="text_box_email" CssClass="validate" Display="Dynamic" 
        ErrorMessage="Endereço de email inválido" 
        ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
    </p>
    
    
    <p title="titulo"> 
        <asp:Label ID="label_observacoes" runat="server" Text="Observações"></asp:Label>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="text_box_observacoes" runat="server" Height="63px" 
             Width="205px"></asp:TextBox>
        <asp:RegularExpressionValidator ID="RegularExpressionValidator7" runat="server" 
        ControlToValidate="text_box_observacoes" CssClass="validate" 
        ErrorMessage="Este campo não pode conter caracteres especiais" 
        ValidationExpression="^[0-9a-zA-Z. ]{1,100}" Display="Dynamic"></asp:RegularExpressionValidator>            
    </p>
    
    
    <p title="titulo">
        <asp:Button ID="button_guardar" runat="server" onclick="Button_Guardar_Click" CausesValidation="true"
            Text="Guardar" />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="button_cancelar" runat="server" onclick="Button_Cancelar_Click"  CausesValidation="false"
            Text="Cancelar" OnClientClick="return confirm('Deseja cancelar a inserção?');"/>
    </p>
    
    
</asp:View>


<asp:View ID="v_success" runat="server">
<asp:Label ID="LabelSucesso" runat="server" Text="Label" CssClass="sucessfulMessage">O 
    contacto foi inserido com sucesso</asp:Label>
</asp:View>

<asp:View ID="v_error" runat="server">
<asp:Label ID="Label1" runat="server" Text="Label" CssClass="errorMessage">Ocorreu 
    um erro na inserção do contacto</asp:Label>
</asp:View>


</asp:MultiView>
    
    
</asp:Content>
