Пример #1
0
        public static List <MediaViewModel> GetByTagLibelle(IEnumerable <string> tagsLibelle)
        {
            switch (Parametres.TagOperator)
            {
            case TagOperator.AND:
                return(TagomatiqueCache.GetElements(media => media.Tags.Select(tag => tag.Libelle).All(tagLibelle => tagsLibelle.Contains(tagLibelle)), GetAllFromDB));

            case TagOperator.OR:
                return(TagomatiqueCache.GetElements(media => media.Tags.Select(tag => tag.Libelle).Any(tagLibelle => tagsLibelle.Contains(tagLibelle)), GetAllFromDB));

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Пример #2
0
        protected override void insert()
        {
            if (FK_ID_Media.HasValue && !FK_ID_Chapitre.HasValue)
            {
                ID_Tag = AbstractDatabase.DataBase.AjouterTagForMedia(FK_ID_Media.Value, Libelle);
            }
            else if (!FK_ID_Media.HasValue && FK_ID_Chapitre.HasValue)
            {
                ID_Tag = AbstractDatabase.DataBase.AjouterTagForChapitre(FK_ID_Chapitre.Value, Libelle);
            }
            else
            {
                throw new Exception("Tag non assigné");
            }

            TagomatiqueCache.MarkAsDirty <TagViewModel>();
        }
 public static DossierViewModel GetByProperties(string nom, string chemin)
 {
     return(TagomatiqueCache.GetElement(d => d.Nom == nom && d.Chemin == chemin, GetAllFromDB));
 }
 public static DossierViewModel GetByKey(Guid idDossier)
 {
     return(TagomatiqueCache.GetElement(d => d.ID_Dossier == idDossier, GetAllFromDB));
 }
Пример #5
0
 public static MediaViewModel GetByProperties(string nom, string relativeUrl)
 {
     return(TagomatiqueCache.GetElement(m => m.Nom == nom && m.RelativeURL == relativeUrl, GetAllFromDB));
 }
        protected override void insert()
        {
            ID_Chapitre = AbstractDatabase.DataBase.AjouterChapitre(FK_ID_Media, Description, Debut.ToString("hh':'mm':'ss'.'ms"), Fin.ToString("hh':'mm':'ss'.'ms"));

            TagomatiqueCache.MarkAsDirty <SignetViewModel>();
        }
 public static ChapitreViewModel GetByKey(Guid idChapitre)
 {
     return(TagomatiqueCache.GetElement(c => c.ID_Chapitre == idChapitre, GetAllFromDB));
 }
Пример #8
0
 public static List <TagViewModel> GetByChapitreKey(Guid idChapitre)
 {
     return(TagomatiqueCache.GetElements(t => t.FK_ID_Chapitre == idChapitre, GetAllFromDB));
 }
Пример #9
0
 public static List <SignetViewModel> GetByMediaKey(Guid idMedia)
 {
     return(TagomatiqueCache.GetElements(s => s.FK_ID_Media == idMedia, GetAllFromDB));
 }
Пример #10
0
 public static SignetViewModel GetByKey(Guid idSignet)
 {
     return(TagomatiqueCache.GetElement(s => s.ID_Signet == idSignet, GetAllFromDB));
 }
Пример #11
0
        protected override void delete()
        {
            AbstractDatabase.DataBase.SupprimerMedia(ID_Media);

            TagomatiqueCache.MarkAsDirty <MediaViewModel>();
        }
Пример #12
0
        protected override void insert()
        {
            ID_Media = AbstractDatabase.DataBase.AjouterMedia(Nom, RelativeURL, FK_ID_Dossier);

            TagomatiqueCache.MarkAsDirty <MediaViewModel>();
        }
Пример #13
0
 public static List <MediaViewModel> GetByDossierKey(Guid idDossier)
 {
     return(TagomatiqueCache.GetElements(m => m.FK_ID_Dossier == idDossier, GetAllFromDB));
 }
Пример #14
0
        protected override void delete()
        {
            AbstractDatabase.DataBase.SupprimerTag(ID_Tag);

            TagomatiqueCache.MarkAsDirty <TagViewModel>();
        }
Пример #15
0
        protected override void insert()
        {
            ID_Signet = AbstractDatabase.DataBase.AjouterSignet(FK_ID_Media, Libelle, Duree.ToString("hh':'mm':'ss'.'ms"));

            TagomatiqueCache.MarkAsDirty <SignetViewModel>();
        }
Пример #16
0
 public static TagViewModel GetByKey(Guid idTag)
 {
     return(TagomatiqueCache.GetElement(t => t.ID_Tag == idTag, GetAllFromDB));
 }
        protected override void insert()
        {
            ID_Dossier = AbstractDatabase.DataBase.AjouterDossier(Nom, Chemin);

            TagomatiqueCache.MarkAsDirty <DossierViewModel>();
        }
 public static List <ChapitreViewModel> GetAll()
 {
     return(TagomatiqueCache.GetAll(GetAllFromDB));
 }
        protected override void delete()
        {
            AbstractDatabase.DataBase.SupprimerDossier(ID_Dossier);

            TagomatiqueCache.MarkAsDirty <DossierViewModel>();
        }
 public static List <ChapitreViewModel> GetByMediaKey(Guid idMedia)
 {
     return(TagomatiqueCache.GetElements(c => c.FK_ID_Media == idMedia, GetAllFromDB));
 }
 public static List <DossierViewModel> GetAll()
 {
     return(TagomatiqueCache.GetAll(GetAllFromDB));
 }
        protected override void delete()
        {
            AbstractDatabase.DataBase.SupprimerSignet(ID_Chapitre);

            TagomatiqueCache.MarkAsDirty <SignetViewModel>();
        }
Пример #23
0
 public static MediaViewModel GetByKey(Guid idMedia)
 {
     return(TagomatiqueCache.GetElement(m => m.ID_Media == idMedia, GetAllFromDB));
 }