-
Notifications
You must be signed in to change notification settings - Fork 0
/
OffreEmploi.cs
165 lines (152 loc) · 4.65 KB
/
OffreEmploi.cs
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Runtime.Serialization;
namespace DAL
{
[DataContract(IsReference = true)]
[KnownType(typeof(Recruteur))]
[KnownType(typeof(Condidat))]
public partial class OffreEmploi
{
#region Primitive Properties
[DataMember]
public virtual int IdOffre
{
get;
set;
}
[DataMember]
public virtual int CIN
{
get { return _cIN; }
set
{
if (_cIN != value)
{
if (Recruteur != null && Recruteur.CIN != value)
{
Recruteur = null;
}
_cIN = value;
}
}
}
private int _cIN;
[DataMember]
public virtual string TitreOffre
{
get;
set;
}
[DataMember]
public virtual string Description
{
get;
set;
}
#endregion
#region Navigation Properties
[DataMember]
public virtual Recruteur Recruteur
{
get { return _recruteur; }
set
{
if (!ReferenceEquals(_recruteur, value))
{
var previousValue = _recruteur;
_recruteur = value;
FixupRecruteur(previousValue);
}
}
}
private Recruteur _recruteur;
[DataMember]
public virtual ICollection<Condidat> Condidat
{
get
{
if (_condidat == null)
{
var newCollection = new FixupCollection<Condidat>();
newCollection.CollectionChanged += FixupCondidat;
_condidat = newCollection;
}
return _condidat;
}
set
{
if (!ReferenceEquals(_condidat, value))
{
var previousValue = _condidat as FixupCollection<Condidat>;
if (previousValue != null)
{
previousValue.CollectionChanged -= FixupCondidat;
}
_condidat = value;
var newValue = value as FixupCollection<Condidat>;
if (newValue != null)
{
newValue.CollectionChanged += FixupCondidat;
}
}
}
}
private ICollection<Condidat> _condidat;
#endregion
#region Association Fixup
private void FixupRecruteur(Recruteur previousValue)
{
if (previousValue != null && previousValue.OffreEmploi.Contains(this))
{
previousValue.OffreEmploi.Remove(this);
}
if (Recruteur != null)
{
if (!Recruteur.OffreEmploi.Contains(this))
{
Recruteur.OffreEmploi.Add(this);
}
if (CIN != Recruteur.CIN)
{
CIN = Recruteur.CIN;
}
}
}
private void FixupCondidat(object sender, NotifyCollectionChangedEventArgs e)
{
if (e.NewItems != null)
{
foreach (Condidat item in e.NewItems)
{
if (!item.OffreEmploi.Contains(this))
{
item.OffreEmploi.Add(this);
}
}
}
if (e.OldItems != null)
{
foreach (Condidat item in e.OldItems)
{
if (item.OffreEmploi.Contains(this))
{
item.OffreEmploi.Remove(this);
}
}
}
}
#endregion
}
}