Yotei _GetSchedule( DateTime date, repeat_info repeatInfo ) { // 削除した予定 if( repeatInfo.exclusive_datetimes != null && repeatInfo.exclusive_datetimes.exclusive_datetime != null ) { foreach( var exclusiveDatetime in repeatInfo.exclusive_datetimes.exclusive_datetime ) { if( date < exclusiveDatetime.start ) { continue; } if( date > exclusiveDatetime.end ) { continue; } return null; } } // 条件に合うか var condition = repeatInfo.condition; if( _HasSchedule( date, condition ) ) { DateTime? startDateTime = null; if( condition.start_timeSpecified ) { startDateTime = date.Date.Add( new TimeSpan( condition.start_time.Hour, condition.start_time.Minute, 0 ) ); } DateTime? endDateTime = null; if( condition.end_timeSpecified ) { endDateTime = date.Date.Add( new TimeSpan( condition.end_time.Hour, condition.end_time.Minute, 0 ) ); } var yotei = new Yotei( startDateTime, endDateTime ); return yotei; } return null; }
void _SetMemberLocation( Yotei yotei, members members ) { // todo:ID順にソートする foreach( var member in members.member ) { // ユーザー情報 if( member.Item is MemberTypeUser ) { var user = (MemberTypeUser)member.Item; foreach( var userAttr in user.AnyAttr ) { yotei.Members.Add( userAttr.Value ); } } // 施設情報 if( member.Item is MemberTypeFacility ) { var facility = (MemberTypeFacility)member.Item; foreach( var facilityAttr in facility.AnyAttr ) { yotei.Facilitys.Add( facilityAttr.Value ); } } } }