-
Notifications
You must be signed in to change notification settings - Fork 1
/
Person.j
73 lines (63 loc) · 1.53 KB
/
Person.j
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
@import <Foundation/CPObject.j>
@implementation Person : CPObject
{
int index @accessors;
CPString name @accessors;
CPString surname @accessors;
CPString companyName @accessors;
CPString tags @accessors;
CPString fiscalID @accessors;
CPString VAT @accessors;
CPMutableArray addresses @accessors;
CPMutableArray phones @accessors;
CPMutableArray emails @accessors;
BOOL isCompany @accessors;
BOOL privacy @accessors;
}
- (id)init
{
if (self = [super init])
{
name=@"";
surname=@"";
isCompany=NO;
addresses=[[CPMutableArray alloc] init];
phones=[[CPMutableArray alloc] init];
emails=[[CPMutableArray alloc] init];
}
return self;
}
- (CPString) fullName
{
return (self.isCompany?self.companyName:(self.surname+@" "+self.name));
}
- (void) copyTo:(Person) aPerson
{
aPerson.name=name;
aPerson.surname=surname;
aPerson.companyName=companyName;
aPerson.tags=tags;
aPerson.fiscalID=fiscalID;
aPerson.VAT=VAT;
aPerson.addresses=addresses;
aPerson.phones=phones;
aPerson.emails=emails;
aPerson.isCompany=isCompany;
aPerson.privacy=privacy;
}
@end
@implementation DictionaryEntry : CPObject
{
CPString key @accessors;
CPString value @accessors;
}
- (id)initWithValue:(CPString)aValue forKey:(CPString)aKey
{
if (self = [super init])
{
key=aKey;
value=aValue;
}
return self;
}
@end