public ActionResult Notification(IEventEntity eventEntity, bool seen)
 {
     if (eventEntity is Comment)
     {
         return GetCommentNotificationPartialView(eventEntity as Comment, seen);
     }
     else if (eventEntity is Answer)
     {
         return GetAnswerNotificationPartialView(eventEntity as Answer, seen);
     }
     else if (eventEntity is AnswerLike)
     {
         return GetAnswerLikedNotificationPartialView(eventEntity as AnswerLike, seen);
     }
     else if (eventEntity is QuestionDetail)
     {
         return GetQuestionAskedNotificationPartialView(eventEntity as QuestionDetail, seen);
     }
     else if (eventEntity is Relationship)
     {
         return GetRelationshipNotificationPartialView(eventEntity as Relationship, seen);
     }
     else
     {
         return null;
     }
 }
Exemple #2
0
        /// <summary>
        /// Si la fecha del evento ya paso lo indica y si no ha pasado también.
        /// </summary>
        /// <param name="eventEntity">Evento</param>
        /// <returns></returns>
        public string CreateMessage(IEventEntity eventEntity, ITimeFormat timeFormat)
        {
            TimeSpan timeDifference = DateTimeUtilities.GetTimeDifferencDateToDateActual(eventEntity.DateStart, new DateTime());

            return(string.Format("{0} ocurrió hace {1}", eventEntity.Title, timeFormat.GetTimeFormat(timeDifference)));
        }