yavsc/Yavsc/Model/Booking/BookQuery.cs

37 lines
974 B
C#
Raw Normal View History

2016-05-17 18:22:18 +02:00
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
2016-06-14 03:37:57 +02:00
using Yavsc.Models.Billing;
2016-05-17 18:22:18 +02:00
namespace Yavsc.Models.Booking
{
/// <summary>
/// Query, for a date, with a given perfomer, at this given place.
/// </summary>
2016-06-14 03:37:57 +02:00
public class BookQuery : NominativeServiceCommand {
/// <summary>
/// The command identifier
/// </summary>
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long Id {get; set; }
2016-07-27 13:06:00 +02:00
[Display(Name="Event date")]
2016-06-14 03:37:57 +02:00
public DateTime EventDate{get; set; }
2016-05-17 18:22:18 +02:00
public Location Location { get; set; }
2016-06-14 03:37:57 +02:00
public BookQuery()
{
}
public BookQuery(Location eventLocation, DateTime eventDate)
{
Location = eventLocation;
EventDate = eventDate;
}
2016-09-05 00:25:29 +02:00
public string GetDescription() {
return $"{Location?.Address} {EventDate.ToString()}";
}
2016-05-17 18:22:18 +02:00
}
}