y"> Рис.10
є невізуальними компонентом
AbtAppBldrPart subclass: # HotelBDCore
instanceVariableNames: 'bd':'':''
init
bd: = OrderedCollection new.
bd
^ bd
bd: anObject
bd: = anObject.signalEvent: # bd with: anObject.
newUser: user
bd add: user.signalEvent: # bdChanged with: bd;: # justAdded with: (Array with: user)
addRoom: room toUser: user
room isNil ifFalse: [do: [: h | h addRoom: room]. signalEvent: # bdChanged with: bd;: # justAdded with: user asArray.]
removeSelected: selecteditems
selecteditems do: [: el | bd remove: el]. signalEvent: # bdChanged with: bd.
findFSName: FNameSet with: SNameSet
| str |
(FNameSet notNil) & (SNameSet notNil): [^ (bd select: [: user | (user FName = FNameSet) & (user SName = SNameSet)]) asArray]. p>
(FNameSet notNil) & (SNameSet isNil): [^ (bd select: [: user | user FName = FNameSet]) asArray].
(FNameSet isNil) & (SNameSet notNil): [^ (bd select: [: user | user SName = SNameSet]) asArray].
(FNameSet isNil) & (SNameSet isNil): [^ (str: = ( Невірні параметри пошуку ) ) asArray].
findSex: sexSet
| str |
(sexSet notNil): [^ (bd select: [: user | (user sex = sexSet)]) asArray];
ifFalse: [^ (str: = ( Невірні параметри пошуку )) asArray].
findType: typeSet
| str |
(typeSet notNil): [^ (bd select: [: user | ((user haveRoom: typeSet) = true)]) asArray];
ifFalse: [^ (str: = ( Невірні параметри пошуку )) asArray].
findFSNameSexType: FNameSet with: SNameSet with: sexSet with: typeSet
| str |
(FNameSet notNil) & (SNameSet notNil) & (sexSet notNil) & (typeSet notNil): [^ (bd select: [: user | (user FName = FNameSet) & ( user SName = SNameSet) & (user sex = sexSet) & ((user haveRoom: typeSet) = true)]) asArray].
ifFalse: [^ (str: = ( Невірні параметри пошуку )) asArray].
.4 Клас В«Hotel...