yavsc/Yavsc.Server/Models/Workflow/Activity.cs

101 lines
2.8 KiB
C#
Raw Normal View History

2017-01-31 13:19:12 +01:00
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
2017-01-31 13:19:12 +01:00
using Newtonsoft.Json;
2017-01-31 13:19:12 +01:00
namespace Yavsc.Models.Workflow
{
2017-05-02 13:10:23 +02:00
using Yavsc.Models.Market;
2017-05-27 16:22:58 +02:00
using Yavsc;
2017-02-02 15:13:32 +01:00
public class Activity : IBaseTrackedEntity, IActivity
{
2017-02-02 15:13:32 +01:00
[StringLength(512), Required, Key]
2017-03-10 11:57:25 +01:00
[Display(Name = "Code")]
2017-02-02 15:13:32 +01:00
public string Code { get; set; }
/// <summary>
///
/// </summary>
/// <returns></returns>
2017-02-02 15:13:32 +01:00
[StringLength(512), Required()]
2017-03-10 11:57:25 +01:00
[Display(Name = "Nom")]
2017-02-02 15:13:32 +01:00
public string Name { get; set; }
[StringLength(512)]
2017-03-10 11:57:25 +01:00
[Display(Name = "Code du parent")]
public string ParentCode { get; set; }
2017-02-02 15:13:32 +01:00
[ForeignKey("ParentCode"), JsonIgnore]
2017-03-10 11:57:25 +01:00
[Display(Name = "Activité parent")]
public virtual Activity Parent { get; set; }
2017-02-02 15:13:32 +01:00
[InverseProperty("Parent"), JsonIgnore]
2017-03-10 11:57:25 +01:00
[Display(Name = "Activités filles")]
public virtual List<Activity> Children { get; set; }
2017-03-10 11:57:25 +01:00
[Display(Name = "Description")]
2017-02-02 15:13:32 +01:00
public string Description { get; set; }
2017-03-10 11:57:25 +01:00
[Display(Name = "Photo")]
2017-02-02 15:13:32 +01:00
public string Photo { get; set; }
2017-02-02 15:13:32 +01:00
[InverseProperty("Context")]
2017-03-10 11:57:25 +01:00
[DisplayAttribute(Name = "Services liés")]
public List<Service> Services { get; set; }
2017-02-02 15:13:32 +01:00
/// <summary>
/// Moderation settings
/// </summary>
/// <returns></returns>
2017-03-10 11:57:25 +01:00
[DisplayAttribute(Name = "Groupe de modération")]
2017-02-02 15:13:32 +01:00
public string ModeratorGroupName { get; set; }
/// <summary>
/// indice de recherche de cette activité
/// rendu par le système.
/// Valide entre 0 et 100,
/// Il démarre à 0.
/// </summary>
2017-03-10 11:57:25 +01:00
[Range(0, 100)][DisplayAttribute(Name = "Indice d'exposition")]
[DisplayFormatAttribute(DataFormatString="{0}%")]
2017-02-02 15:13:32 +01:00
public int Rate { get; set; }
2017-03-10 11:57:25 +01:00
[DisplayAttribute(Name = "Classe de paramétrage")]
2017-02-02 15:13:32 +01:00
public string SettingsClassName { get; set; }
2017-01-24 10:43:42 +01:00
[InverseProperty("Context")]
2017-03-10 11:57:25 +01:00
[Display(Name="Formulaires de commande")]
2017-01-24 10:43:42 +01:00
public virtual List<CommandForm> Forms { get; set; }
2017-01-31 13:19:12 +01:00
2017-03-10 11:57:25 +01:00
[Display(Name="Date de création")]
2017-01-31 13:19:12 +01:00
public DateTime DateCreated
{
2017-02-02 15:13:32 +01:00
get; set;
2017-01-31 13:19:12 +01:00
}
2017-03-10 11:57:25 +01:00
[Display(Name="Createur")]
2017-01-31 13:19:12 +01:00
public string UserCreated
{
2017-02-02 15:13:32 +01:00
get; set;
2017-01-31 13:19:12 +01:00
}
2017-03-10 11:57:25 +01:00
[Display(Name="Date de dernière modification")]
2017-01-31 13:19:12 +01:00
public DateTime DateModified
{
2017-02-02 15:13:32 +01:00
get; set;
2017-01-31 13:19:12 +01:00
}
2017-03-10 11:57:25 +01:00
[Display(Name="Utilisateur ayant modifié le dernier")]
2017-01-31 13:19:12 +01:00
public string UserModified
{
2017-02-02 15:13:32 +01:00
get; set;
2017-01-31 13:19:12 +01:00
}
2017-02-20 15:53:25 +01:00
2017-03-10 11:57:25 +01:00
[Display(Name="Caché")]
2017-02-20 15:53:25 +01:00
public bool Hidden { get; set; }
}
}