Annee.cs 814 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using System;
  2. using System.ComponentModel.DataAnnotations;
  3. using System.Linq;
  4. namespace CD67.FicheCollege.Entity
  5. {
  6. /// <summary>
  7. /// Classe d'extension de celle d'Entity, nécessaire pour y associer les Metadata
  8. /// </summary>
  9. [MetadataType(typeof(Annee_Metadata))]
  10. public partial class Annee
  11. {
  12. public Annee flat()
  13. {
  14. return new Annee()
  15. {
  16. Id = Id,
  17. Libelle = Libelle
  18. };
  19. }
  20. public string AnneePrecLib
  21. {
  22. get
  23. {
  24. return this.AnneeRentree - 1 + "-" + this.AnneeRentree;
  25. }
  26. }
  27. }
  28. /// <summary>
  29. /// Classe contenant les DataAnnotations pour chaque champ
  30. /// </summary>
  31. public class Annee_Metadata
  32. {
  33. }
  34. }