-
Notifications
You must be signed in to change notification settings - Fork 0
/
Company.cs
289 lines (260 loc) · 10.2 KB
/
Company.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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
using Job_Application_Database.Enum;
using Job_Application_Database.Singleton;
using Newtonsoft.Json;
using System;
namespace Job_Application_Database.Classes
{
/// <summary>
/// Company Implimentation of BaseInfo
/// </summary>
[JsonObject(MemberSerialization.OptIn)]
public class Company : BaseInfo
{
/// <summary>
/// ID For Each Company
/// </summary>
public static int Comp_ID = 0;
/// <summary>
/// Reference To The Job
/// </summary>
private Job _job;
/// <summary>
/// Reference To The Rep
/// </summary>
private Rep _rep;
/// <summary>
/// Reference To The JobBoard
/// </summary>
private JobBoard _bor;
/// <summary>
/// The Name Of The Company
/// </summary>
[JsonProperty("Name")]
public override string Name { get; set; }
/// <summary>
/// String Extra Implementation Used For Website
/// </summary>
public override string Extra { get; set; }
/// <summary>
/// The Website Of The Company
/// </summary>
[JsonProperty("Web")]
public string WebSite
{
get
{
return Extra;
}
set
{
Extra = value;
}
}
/// <summary>
/// The Rep Of The Company
/// Also Sets RepID
/// </summary>
public Rep Rep
{
get
{
return _rep;
}
set
{
_rep = value;
RepID = value.ID;
}
}
/// <summary>
/// The Rep ID Used For Saving File
/// </summary>
[JsonProperty("Rep")]
public int RepID { get; private set; }
/// <summary>
/// The Job Of The Company
/// Also Sets JobID
/// </summary>
public Job Job
{
get
{
return _job;
}
set
{
_job = value;
JobID = value.ID;
}
}
/// <summary>
/// The Job ID Used For Saving File
/// </summary>
[JsonProperty("Job")]
public int JobID { get; private set; }
/// <summary>
/// The JobBoard Of The Company
/// Also Sets JobBoardID
/// </summary>
public JobBoard Board
{
get
{
return _bor;
}
set
{
_bor = value;
BoardID = value.ID;
}
}
/// <summary>
/// The JobBoard ID Used For Saving
/// </summary>
[JsonProperty("Board")]
public int BoardID { get; private set; }
/// <summary>
/// The Position Type Of The Company
/// </summary>
[JsonProperty("Position")]
public PositionType Position { get; set; }
/// <summary>
/// The Application Status Of The Company
/// </summary>
[JsonProperty("Status")]
public ApplicationStatus Status { get; set; }
/// <summary>
/// The Application Date Of The Company
/// </summary>
[JsonProperty("AppDate")]
public DateTime AppDate { get; set; }
/// <summary>
/// The Location Of The Company
/// </summary>
[JsonProperty("Location")]
public string Location { get; set; }
/// <summary>
/// The Notes Of The Company
/// </summary>
[JsonProperty("Notes")]
public string Notes { get; set; }
/// <summary>
/// Default Constructor
/// </summary>
public Company() : this("New Company", "") { }
/// <summary>
/// String, String Constructor
/// </summary>
/// <param name="name">The Name Of Company</param>
/// <param name="website">The Website Of Company</param>
public Company(string name, string website)
: this(name, website, 0) { }
/// <summary>
/// String, String, Int Constructor
/// </summary>
/// <param name="name">The Name Of Company</param>
/// <param name="website">The Website Of Company</param>
/// <param name="rep">The ID Of The Rep</param>
public Company(string name, string website, int rep)
: this(name, website, rep, 0) { }
/// <summary>
/// String, String, Int, Int Constructor
/// </summary>
/// <param name="name">The Name Of Company</param>
/// <param name="website">The Website Of Company</param>
/// <param name="rep">The ID Of The Rep</param>
/// <param name="job">The ID Of The Job</param>
public Company(string name, string website, int rep, int job)
: this(name, website, rep, job, 0) { }
/// <summary>
/// String, String, Int, Int, Int Constructor
/// </summary>
/// <param name="name">The Name Of Company</param>
/// <param name="website">The Website Of Company</param>
/// <param name="rep">The ID Of The Rep</param>
/// <param name="job">The ID Of The Job</param>
/// <param name="board">The ID Of The JobBoard</param>
public Company(string name, string website, int rep, int job, int board)
: this(name, website, rep, job, board, ApplicationStatus.Applied) { }
/// <summary>
/// String, String, Int, Int, Int, ApplicationStatus Constructor
/// </summary>
/// <param name="name">The Name Of Company</param>
/// <param name="website">The Website Of Company</param>
/// <param name="rep">The ID Of The Rep</param>
/// <param name="job">The ID Of The Job</param>
/// <param name="board">The ID Of The JobBoard</param>
/// <param name="status">The Application Status Of The Job</param>
public Company(string name, string website, int rep, int job, int board, ApplicationStatus status)
: this(name, website, rep, job, board, status, DateTime.Today) { }
/// <summary>
/// String, String, Int, Int, Int, ApplicationStatus, DateTime Constructor
/// </summary>
/// <param name="name">The Name Of Company</param>
/// <param name="website">The Website Of Company</param>
/// <param name="rep">The ID Of The Rep</param>
/// <param name="job">The ID Of The Job</param>
/// <param name="board">The ID Of The JobBoard</param>
/// <param name="status">The Application Status Of The Job</param>
/// <param name="appDate">The Time Of Application</param>
public Company(string name, string website, int rep, int job, int board, ApplicationStatus status, DateTime appDate)
: this(name, website, rep, job, board, status, appDate, "") { }
/// <summary>
/// String, String, Int, Int, Int, ApplicationStatus, DateTime, String Constructor
/// </summary>
/// <param name="name">The Name Of Company</param>
/// <param name="website">The Website Of Company</param>
/// <param name="rep">The ID Of The Rep</param>
/// <param name="job">The ID Of The Job</param>
/// <param name="board">The ID Of The JobBoard</param>
/// <param name="status">The Application Status Of The Job</param>
/// <param name="appDate">The Time Of Application</param>
/// <param name="location">The Location Of The Company</param>
public Company(string name, string website, int rep, int job, int board, ApplicationStatus status, DateTime appDate, string location)
: this(name, website, rep, job, board, status, appDate, location, PositionType.Full) { }
/// <summary>
/// String, String, Int, Int, Int, ApplicationStatus, DateTime, String, PositionType Constructor
/// </summary>
/// <param name="name">The Name Of Company</param>
/// <param name="website">The Website Of Company</param>
/// <param name="rep">The ID Of The Rep</param>
/// <param name="job">The ID Of The Job</param>
/// <param name="board">The ID Of The JobBoard</param>
/// <param name="status">The Application Status Of The Job</param>
/// <param name="appDate">The Time Of Application</param>
/// <param name="location">The Location Of The Company</param>
/// <param name="type">The Postition Type Of The Job</param>
public Company(string name, string website, int rep, int job, int board, ApplicationStatus status, DateTime appDate, string location, PositionType type)
: this(name, website, rep, job, board, status, appDate, location, type, "") { }
/// <summary>
/// String, String, Int, Int, Int, ApplicationStatus, DateTime, String, PositionType, String Constructor
/// </summary>
/// <param name="name">The Name Of Company</param>
/// <param name="website">The Website Of Company</param>
/// <param name="rep">The ID Of The Rep</param>
/// <param name="job">The ID Of The Job</param>
/// <param name="board">The ID Of The JobBoard</param>
/// <param name="status">The Application Status Of The Job</param>
/// <param name="appDate">The Time Of Application</param>
/// <param name="location">The Location Of The Company</param>
/// <param name="type">The Postition Type Of The Job</param>
/// <param name="notes">The Notes Of The Company</param>
public Company(string name, string website, int repid, int jobid, int boardid, ApplicationStatus status, DateTime appDate, string location, PositionType type, string notes)
{
Name = name;
WebSite = website;
RepID = repid;
Rep = Reps.Instance.ObjectAt(RepID) as Rep;
JobID = jobid;
Job = Jobs.Instance.ObjectAt(JobID) as Job;
BoardID = boardid;
Board = JobBoards.Instance.ObjectAt(BoardID) as JobBoard;
Status = status;
AppDate = appDate;
Location = location;
Position = type;
Notes = notes;
ID = Comp_ID++;
}
}
}