yavsc/Yavsc/Models/Workflow/Activity.cs

102 lines
2.7 KiB
C#

8 years ago
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
8 years ago
using Newtonsoft.Json;
8 years ago
namespace Yavsc.Models.Workflow
{
8 years ago
using Market;
using YavscLib;
public class Activity : IBaseTrackedEntity, IActivity
{
8 years ago
[StringLength(512), Required, Key]
[Display(Name = "Code")]
8 years ago
public string Code { get; set; }
/// <summary>
///
/// </summary>
/// <returns></returns>
8 years ago
[StringLength(512), Required()]
[Display(Name = "Nom")]
8 years ago
public string Name { get; set; }
[StringLength(512)]
[Display(Name = "Code du parent")]
public string ParentCode { get; set; }
8 years ago
[ForeignKey("ParentCode"), JsonIgnore]
[Display(Name = "Activité parent")]
public virtual Activity Parent { get; set; }
8 years ago
[InverseProperty("Parent"), JsonIgnore]
[Display(Name = "Activités filles")]
public virtual List<Activity> Children { get; set; }
[Display(Name = "Description")]
8 years ago
public string Description { get; set; }
[Display(Name = "Photo")]
8 years ago
public string Photo { get; set; }
8 years ago
[InverseProperty("Context")]
[DisplayAttribute(Name = "Services liés")]
public List<Service> Services { get; set; }
8 years ago
/// <summary>
/// Moderation settings
/// </summary>
/// <returns></returns>
[DisplayAttribute(Name = "Groupe de modération")]
8 years ago
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>
[Range(0, 100)][DisplayAttribute(Name = "Indice d'exposition")]
[DisplayFormatAttribute(DataFormatString="{0}%")]
8 years ago
public int Rate { get; set; }
[DisplayAttribute(Name = "Classe de paramétrage")]
8 years ago
public string SettingsClassName { get; set; }
[InverseProperty("Context")]
[Display(Name="Formulaires de commande")]
public virtual List<CommandForm> Forms { get; set; }
8 years ago
[Display(Name="Date de création")]
8 years ago
public DateTime DateCreated
{
8 years ago
get; set;
8 years ago
}
[Display(Name="Createur")]
8 years ago
public string UserCreated
{
8 years ago
get; set;
8 years ago
}
[Display(Name="Date de dernière modification")]
8 years ago
public DateTime DateModified
{
8 years ago
get; set;
8 years ago
}
[Display(Name="Utilisateur ayant modifié le dernier")]
8 years ago
public string UserModified
{
8 years ago
get; set;
8 years ago
}
8 years ago
[Display(Name="Caché")]
8 years ago
public bool Hidden { get; set; }
}
}