| [752] | 1 | <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Wierszowki.Models.AuthorViewData>" %>
|
|---|
| [844] | 2 | <%@ Import namespace="Wierszowki.Core.Validation"%>
|
|---|
| 3 | <asp:Content ID="js" ContentPlaceHolderID="jsContent" runat="server">
|
|---|
| 4 | <script src="../../Scripts/jquery-1.3.1.js" type="text/javascript"></script>
|
|---|
| 5 | <script src="../../Scripts/jquery-1.3.1.min.js" type="text/javascript"></script>
|
|---|
| 6 | <script src="../../Scripts/jquery.form.js" type="text/javascript"></script>
|
|---|
| 7 | <script src="../../Scripts/jquery.blockUI.js" type="text/javascript"></script>
|
|---|
| 8 | <script src="../../Scripts/date.js" type="text/javascript"></script>
|
|---|
| 9 | <script src="../../Scripts/jquery.datePicker.js" type="text/javascript"></script>
|
|---|
| 10 | <script src="../../Scripts/spiffy.js" type="text/javascript"></script>
|
|---|
| 11 | <script src="../../Scripts/jHelper.js" type="text/javascript"></script>
|
|---|
| 12 | <script src="../../Scripts/jquery.validate.js" type="text/javascript" ></script>
|
|---|
| 13 | <script src="../../Scripts/xVal.jquery.validate.js" type="text/javascript"></script>
|
|---|
| 14 | </asp:Content>
|
|---|
| [752] | 15 | <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
|
|---|
| 16 | Dodaj autora
|
|---|
| 17 | </asp:Content>
|
|---|
| 18 |
|
|---|
| 19 | <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
|
|---|
| [844] | 20 | <script type="text/javascript">
|
|---|
| 21 | $(function() {
|
|---|
| 22 | jQuery.validator.setDefaults({
|
|---|
| 23 | success: "valid"
|
|---|
| 24 | });
|
|---|
| 25 | $("#myform").validate({
|
|---|
| 26 | rules: {
|
|---|
| 27 | "Author.FirstName": { required: true },
|
|---|
| 28 | "Author.LastName": { required: true },
|
|---|
| 29 | "Author.EmploymentTypeId": { required: true, range: [1, 10] }
|
|---|
| 30 | },
|
|---|
| 31 | messages: {
|
|---|
| 32 | "Author.FirstName": { required: "Proszê podaæ imiê autora." },
|
|---|
| 33 | "Author.LastName": { required: "Proszê podaæ nazwisko autora." },
|
|---|
| 34 | "Author.EmploymentTypeId": { required: "Proszê wybraæ typ zatrudnienia.", range: "dshvsh" }
|
|---|
| 35 | }
|
|---|
| 36 | });
|
|---|
| 37 | $("#myform").change(function() {
|
|---|
| 38 | $("#myform").valid();
|
|---|
| 39 | });
|
|---|
| 40 | });
|
|---|
| 41 | </script>
|
|---|
| [752] | 42 | <h2>Dodaj autora</h2>
|
|---|
| 43 |
|
|---|
| 44 | <%= Html.ValidationSummary("Proszê poprawiæ b³êdy i spróbowaæ ponownie.")%>
|
|---|
| 45 |
|
|---|
| [844] | 46 | <% using (Html.BeginForm("Create", "Author", Model.Author, FormMethod.Post, new { id = "myform" }))
|
|---|
| 47 | {%>
|
|---|
| [752] | 48 |
|
|---|
| 49 | <fieldset>
|
|---|
| 50 | <legend>Dane autora</legend>
|
|---|
| 51 | <p>
|
|---|
| 52 | <label for="FirstName">Imiê:</label>
|
|---|
| 53 | <%= Html.TextBox("Author.FirstName", Model.Author.FirstName)%>
|
|---|
| 54 | <%= Html.ValidationMessage("FirstName", "*") %>
|
|---|
| 55 | </p>
|
|---|
| 56 | <p>
|
|---|
| 57 | <label for="LastName">Nazwisko:</label>
|
|---|
| 58 | <%= Html.TextBox("Author.LastName", Model.Author.LastName)%>
|
|---|
| 59 | <%= Html.ValidationMessage("LastName", "*")%>
|
|---|
| 60 | </p>
|
|---|
| 61 | <p>
|
|---|
| 62 | <label for="LastName">Zatrudnienie:</label>
|
|---|
| 63 | <%= Html.DropDownList("Author.EmploymentTypeId", ViewData.Model.EmploymentTypeList, "-- proszê wybraæ --") %>
|
|---|
| 64 | <%= Html.ValidationMessage("EmploymentTypeId", "*")%>
|
|---|
| 65 | </p>
|
|---|
| 66 | <p>
|
|---|
| 67 | <input type="submit" value="Dodaj" />
|
|---|
| 68 | </p>
|
|---|
| 69 | </fieldset>
|
|---|
| 70 |
|
|---|
| 71 | <% } %>
|
|---|
| 72 |
|
|---|
| 73 | <div>
|
|---|
| 74 | <%=Html.ActionLink("Powrót do listy autorów", "Index")%>
|
|---|
| [844] | 75 | <%=Html.ClientSideValidation<AuthorValidation>("Author")%>
|
|---|
| [752] | 76 | </div>
|
|---|
| 77 | </asp:Content> |
|---|