Utilitaires.cs 581 B

1234567891011121314151617181920212223
  1. using DAL;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Web;
  6. namespace AppliWebANA.Models {
  7. public static class Utilitaires {
  8. public static string UtilisateurCourant {
  9. get { return (string) HttpContext.Current.Session[nameof( UtilisateurCourant )]; }
  10. set { HttpContext.Current.Session[nameof( UtilisateurCourant )] = value; }
  11. }
  12. public readonly static Dictionary<short, Titre> Titres;
  13. static Utilitaires() {
  14. using( var dc = new AnnuaireEntities() ) {
  15. Titres = dc.Titres.ToDictionary( titre => titre.Id );
  16. }
  17. }
  18. }
  19. }