<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Wierszowki.Models.AuthorViewData>" %>
<%@ Import namespace="Wierszowki.Core.Validation"%> 
<asp:Content ID="js" ContentPlaceHolderID="jsContent" runat="server">
    <script src="../../Scripts/jquery-1.3.1.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-1.3.1.min.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.form.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.blockUI.js" type="text/javascript"></script>
    <script src="../../Scripts/date.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.datePicker.js" type="text/javascript"></script>
    <script src="../../Scripts/spiffy.js" type="text/javascript"></script>
    <script src="../../Scripts/jHelper.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.validate.js" type="text/javascript" ></script>
    <script src="../../Scripts/xVal.jquery.validate.js" type="text/javascript"></script>
    <script src="../../Scripts/jqueryvalid.js" type="text/javascript"></script>
    <script src="../../Scripts/xValAuthor.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Dodaj autora
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Dodaj autora</h2>

    <%= Html.ValidationSummary("Proszę poprawić błędy i spróbować ponownie.")%>

    <% using (Html.BeginForm("Create", "Author", Model.Author, FormMethod.Post, new { id = "myform" }))
       {%>

        <fieldset>
            <legend>Dane autora</legend>
            <div class="formitem">    
                <label for="FirstName">Imię:</label>
                <%= Html.TextBox("Author.FirstName", Model.Author.FirstName)%>
                <%= Html.ValidationMessage("FirstName", "*") %>
                <br />
            </div>
            <div class="formitem">    
                <label for="LastName">Nazwisko:</label>
                <%= Html.TextBox("Author.LastName", Model.Author.LastName)%>
                <%= Html.ValidationMessage("LastName", "*")%>
                <br />
            </div>
            <div class="formitem">    
                <label for="LastName">Zatrudnienie:</label>
                <%= Html.DropDownList("Author.EmploymentTypeId", ViewData.Model.EmploymentTypeList, "-- proszę wybrać --") %>
                <%= Html.ValidationMessage("EmploymentTypeId", "*")%>
                <br />
            </div>
            <div class="formitem">    
                <input type="submit" value="Dodaj" />
            </div>
        </fieldset>

    <% } %>

    <div>
        <%=Html.ActionLink("Powrót do listy autorów", "Index")%>
        <%=Html.ClientSideValidation<AuthorValidation>("Author")%>
    </div>
</asp:Content>