コード例 #1
0
 public InvalidEventStatusException(EventAttendantsStatus attendStatus)
     : base(string.Format(MESSAGE + ": {0} ", attendStatus.ToString()))
 {
 }
コード例 #2
0
ファイル: UsersController.cs プロジェクト: tnunn2/urTribe
 //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);
     }
 }
コード例 #3
0
ファイル: EventRepository.cs プロジェクト: tnunn2/urTribe
        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();
        }
コード例 #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);
        }