mirror of
https://github.com/rudollee/LearningMVC.git
synced 2026-08-11 16:32:55 +00:00
Ch. 22 Templated Helper Methods
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace HelperMethods.Models
|
||||
{
|
||||
[DisplayName("New Person")]
|
||||
public partial class PersonMetadata
|
||||
{
|
||||
[HiddenInput(DisplayValue = false)]
|
||||
public int PersonId { get; set; }
|
||||
|
||||
[Display(Name ="First")]
|
||||
public string FirstName { get; set; }
|
||||
|
||||
[Display(Name = "Last")]
|
||||
public string LastName { get; set; }
|
||||
|
||||
[Display(Name = "Birth Date")]
|
||||
[DataType(DataType.Date)]
|
||||
public DateTime BirthDate { get; set; }
|
||||
|
||||
[Display(Name = "Approved")]
|
||||
public bool IsApproved { get; set; }
|
||||
|
||||
[UIHint("Enum")]
|
||||
public Role Role { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,16 +2,31 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace HelperMethods.Models
|
||||
{
|
||||
public class Person
|
||||
[DisplayName("New Person")]
|
||||
public partial class Person
|
||||
{
|
||||
[HiddenInput(DisplayValue = false)]
|
||||
public int PersonId { get; set; }
|
||||
|
||||
[Display(Name ="First")]
|
||||
public string FirstName { get; set; }
|
||||
|
||||
[Display(Name ="Last")]
|
||||
public string LastName { get; set; }
|
||||
|
||||
[Display(Name = "Birth Date")]
|
||||
[DataType(DataType.Date)]
|
||||
public DateTime BirthDate { get; set; }
|
||||
|
||||
public Address HomeAddress { get; set; }
|
||||
|
||||
[Display(Name ="Approved")]
|
||||
public bool IsApproved { get; set; }
|
||||
public Role Role { get; set; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user