using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Web.DynamicData; using Aspnet.Samples.DynamicData; namespace TicketCenter_Data { // Attach the DailySaleMetadata to the DailySale class [MetadataType(typeof(EventMetadata))] [Security(Role = "Users", Action = "Details")] [Security(Role = "Users", Action = "List")] public partial class Event { } [TableName("Event")] public class EventMetadata { //Override the display name [DisplayName("Event Name")] public object EventName { get; set; } [DisplayName("Event Date")] [DefaultValue("mm-dd-yyyy")] [DisplayFormat(DataFormatString = "{0:MM-dd-yyyy}")] public object EventDate { get; set; } [DisplayName("Event Location")] public object EventLocation { get; set; } [DisplayName("Event Price")] [DisplayFormat(DataFormatString = "{0:c}")] public object EventPrice { get; set; } [DisplayName("Total Tickets Issued")] public object TotalTicketsIssued { get; set; } } }