public InvalidEventStatusException(EventAttendantsStatus attendStatus)
     : base(string.Format(MESSAGE + ": {0} ", attendStatus.ToString()))
 {
 }
Exemple #2
0
 //Get User's Status
 public APIResponse Get(Guid eventId, Guid userId)
 {
     try
     {
         using (UserFacade facade = new UserFacade())
         {
             EventAttendantsStatus status   = facade.RetrieveUsersEventStatus(userId, eventId);
             APIResponse           response = new APIResponse(APIResponse.ReponseStatus.success, new { Status = status.ToString() });
             return(response);
         }
     }
     catch (Exception ex)
     {
         APIResponse response = new APIResponse(APIResponse.ReponseStatus.error, new { Error = ex.Message });
         return(response);
     }
 }
Exemple #3
0
        public IEnumerable <IUser> AttendingByStatus(Guid eventId, EventAttendantsStatus status)
        {
            var query = _dbms.Cypher.Match("(user:User)-[rel]->(evt:Event)")
                        .Where((ScheduledEvent evt) => evt.ID.ToString() == eventId.ToString())
                        .AndWhere((EventRelationship rel) => rel.AttendStatus == status || status.ToString() == EventAttendantsStatus.All.ToString())
                        .Return(user => user.As <User>())
                        .Results;

            return(query);

            throw new NotImplementedException();
        }
Exemple #4
0
        public IEnumerable <IEvent> RetrieveAllEventsByStatus(Guid usrId, EventAttendantsStatus status)
        {
            var query = _dbms.Cypher.Match("(user:User)-[rel:EVENTOWNER]->(evt:Event)")
                        .Where((User user) => user.ID.ToString() == usrId.ToString())
                        .AndWhere((ScheduledEvent evt) => evt.Active == true)
                        .AndWhere((EventRelationship rel) => rel.AttendStatus.ToString() == status.ToString() || status.ToString() == EventAttendantsStatus.All.ToString())
                        .Return(evt => evt.As <ScheduledEvent>())
                        .Union()
                        .Match("(user:User)-[rel:GUEST]->(evt:Event)")
                        .Where((User user) => user.ID.ToString() == usrId.ToString())
                        .AndWhere((ScheduledEvent evt) => evt.Active == true)
                        .AndWhere((EventRelationship rel) => rel.AttendStatus.ToString() == status.ToString() || status.ToString() == EventAttendantsStatus.All.ToString())
                        .Return(evt => evt.As <ScheduledEvent>())
                        .Results;

            return(query);
        }