Esempio n. 1
0
        /// <summary>
        /// Indique si User participe au projet projId
        /// </summary>
        /// <param name="user"></param>
        /// <param name="projId"></param>
        /// <returns></returns>
        public static bool ParticipeA(this IUserProfile user, int projId)
        {
            CovCakeData data = CovCake.DataProvider;                                                    // new CovCakeData();

            IAbonnementProjet abo = data.AbonnementProjetDataAccess.GetAbonnement(user.UserId, projId); //data.AbonnementProjetDataAccess.GetAllAbonnementsOf(user.UserId).Where(a => a.ProjetId == proj.IdProjet);

            return(abo != null);
        }
Esempio n. 2
0
        /// <summary>
        /// Obtient le nombre de nouveau messages reçus
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public static int GetNewMessageCount(this IUserProfile user)
        {
            CovCakeData data  = CovCake.DataProvider;
            int         count = user.MessagesRecus.GetAllReceiverUnreadedMessages().Count();

            if (count > 1)
            {
                count--;
            }
            return(count);
        }
Esempio n. 3
0
        /// <summary>
        /// Obtient tout les projets ou user et mateuser participent
        /// </summary>
        /// <param name="user"></param>
        /// <param name="mateUserId"></param>
        /// <returns></returns>
        public static IQueryable <IProjet> GetSharedProjects(this IUserProfile user, Guid mateUserId)
        {
            CovCakeData data = CovCake.DataProvider;

            return(data.AbonnementProjetDataAccess.GetAllSharedProjects(user.UserId, mateUserId));
        }