events refactoring

This commit is contained in:
Paul Schneider 2016-09-17 03:36:34 +02:00
commit d11fed8d32
13 changed files with 98 additions and 89 deletions

View file

@ -18,29 +18,22 @@ namespace Yavsc.Models.Booking
[Display(Name="Event date")]
public DateTime EventDate{
get
{ return ((RendezVous)Bill[0]).EventDate; }
set { ((RendezVous)Bill[0]).EventDate = value; }
get;
set;
}
public Location Location {
get
{ return ((RendezVous)Bill[0]).Location; }
set { ((RendezVous)Bill[0]).Location = value; }}
get;
set;
}
public BookQuery()
{
this.Bill.Add(new RendezVous());
}
public BookQuery(Location eventLocation, DateTime eventDate)
{
this.Bill.Add(new RendezVous{
Location = eventLocation,
EventDate = eventDate
});
}
public string GetDescription() {
return $"{Location?.Address} {EventDate.ToString()}";
Location = eventLocation;
EventDate = eventDate;
}
}
}