<%@ 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">
	Edytuj autora
</asp:Content>

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

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

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

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

    <% } %>

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