refactoring

This commit is contained in:
Paul Schneider 2017-02-11 15:46:26 +01:00
commit 8e658d2bb4
21 changed files with 135 additions and 29 deletions

View file

@ -0,0 +1,60 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
namespace Yavsc.Models.Workflow
{
using YavscLib;
using Yavsc.Models.Billing;
using Yavsc.Models.Relationship;
/// <summary>
/// Query, for a date, with a given perfomer, at this given place.
/// </summary>
public class BookQuery : NominativeServiceCommand<RendezVous>, IBaseTrackedEntity
{
/// <summary>
/// The command identifier
/// </summary>
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long Id { get; set; }
[Display(Name = "Event date")]
public DateTime EventDate
{
get;
set;
}
public Location Location
{
get;
set;
}
public LocationType LocationType
{
set;
get;
}
public string Reason { get; set; }
public BookQuery()
{
}
public BookQuery(string activityCode, Location eventLocation, DateTime eventDate)
{
Location = eventLocation;
EventDate = eventDate;
ActivityCode = activityCode;
}
[Required]
public string ActivityCode { get; set; }
[ForeignKey("ActivityCode"),JsonIgnore]
public virtual Activity Context  { get; set ; }
}
}

View file

@ -0,0 +1,18 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Yavsc.Models.Workflow.Profiles
{
using Models.Workflow;
using YavscLib;
public class FormationSettings : ISpecializationSettings
{
public virtual List<CoWorking> CoWorking { get; set; }
[Key]
public string UserId
{
get; set;
}
}
}

View file

@ -0,0 +1,38 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Yavsc.Models.Market;
namespace Yavsc.Models.Workflow
{
using Models.Relationship;
/// <summary>
/// A date, between two persons
/// </summary>
public class RendezVous: Service {
// Haut les mains.
/// <summary>
/// Event date
/// </summary>
/// <returns></returns>
[Required(),Display(Name="EventDate")]
public DateTime EventDate { get; set; }
/// <summary>
/// Location identifier
/// </summary>
/// <returns></returns>
[Required]
public long LocationId { get; set; }
/// <summary>
/// A Location for this event
/// </summary>
/// <returns></returns>
[Required(ErrorMessage="SpecifyPlace"),Display(Name="Location"),ForeignKey("LocationId")]
public Location Location { get; set; }
}
}