| 1 | <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Wierszowki.Models.AuthorViewData>" %>
|
|---|
| 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>
|
|---|
| 15 |
|
|---|
| 16 | <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
|
|---|
| 17 | Edytuj autora
|
|---|
| 18 | </asp:Content>
|
|---|
| 19 |
|
|---|
| 20 | <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
|
|---|
| 21 | <script type="text/javascript">
|
|---|
| 22 | $(function() {
|
|---|
| 23 | jQuery.validator.setDefaults({
|
|---|
| 24 | success: "valid"
|
|---|
| 25 | });
|
|---|
| 26 | $("#myform").validate({
|
|---|
| 27 | rules: {
|
|---|
| 28 | "Author.FirstName": { required: true },
|
|---|
| 29 | "Author.LastName": { required: true },
|
|---|
| 30 | "Author.EmploymentTypeId": { required: true, range:[1,10]}
|
|---|
| 31 | },
|
|---|
| 32 | messages: {
|
|---|
| 33 | "Author.FirstName": { required: "Proszê podaæ imiê autora." },
|
|---|
| 34 | "Author.LastName": { required: "Proszê podaæ nazwisko autora." },
|
|---|
| 35 | "Author.EmploymentTypeId": { required: "Proszê wybraæ typ zatrudnienia.",range:"dshvsh" }
|
|---|
| 36 | }
|
|---|
| 37 | });
|
|---|
| 38 | $("#myform").change(function() {
|
|---|
| 39 | $("#myform").valid();
|
|---|
| 40 | });
|
|---|
| 41 | });
|
|---|
| 42 | </script>
|
|---|
| 43 | <h2>Edytuj autora</h2>
|
|---|
| 44 |
|
|---|
| 45 | <%= Html.ValidationSummary("Edycja siê nie powiod³a. Proszê poprawiæ b³êdy i spróbowaæ ponownie.") %>
|
|---|
| 46 |
|
|---|
| 47 | <% using (Html.BeginForm("Edit", "Author", Model.Author, FormMethod.Post, new { id = "myform" }))
|
|---|
| 48 | {%>
|
|---|
| 49 |
|
|---|
| 50 | <fieldset>
|
|---|
| 51 | <legend>Dane autora</legend>
|
|---|
| 52 | <%= Html.Hidden("Author.Id", Model.Author.Id)%>
|
|---|
| 53 | <div class="formitem">
|
|---|
| 54 | <label for="FirstName">Imiê:</label>
|
|---|
| 55 | <%= Html.TextBox("Author.FirstName", Model.Author.FirstName)%>
|
|---|
| 56 | <%= Html.ValidationMessage("Author.FirstName", "*")%>
|
|---|
| 57 | <br />
|
|---|
| 58 | </div>
|
|---|
| 59 | <div class="formitem">
|
|---|
| 60 | <label for="LastName">Nazwisko:</label>
|
|---|
| 61 | <%= Html.TextBox("Author.LastName", Model.Author.LastName)%>
|
|---|
| 62 | <%= Html.ValidationMessage("Author.LastName", "*")%>
|
|---|
| 63 | <br />
|
|---|
| 64 | </div>
|
|---|
| 65 | <div class="formitem">
|
|---|
| 66 | <label for="LastName">Zatrudnienie:</label>
|
|---|
| 67 | <%= Html.DropDownList("Author.EmploymentTypeId", ViewData.Model.EmploymentTypeList, "-- proszê wybraæ --") %>
|
|---|
| 68 | <%= Html.ValidationMessage("Author.EmploymentTypeId", "*")%>
|
|---|
| 69 | <br />
|
|---|
| 70 | </div>
|
|---|
| 71 | <div>
|
|---|
| 72 | <input type="submit" value="Aktualizuj" />
|
|---|
| 73 | </div>
|
|---|
| 74 | </fieldset>
|
|---|
| 75 |
|
|---|
| 76 | <% } %>
|
|---|
| 77 |
|
|---|
| 78 | <div>
|
|---|
| 79 | <%=Html.ActionLink("Powrót do listy autorów", "Index") %>
|
|---|
| 80 | <%=Html.ClientSideValidation<AuthorValidation>("Author")%>
|
|---|
| 81 | </div>
|
|---|
| 82 | </asp:Content> |
|---|