-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathController.cs
More file actions
366 lines (336 loc) · 20.7 KB
/
Controller.cs
File metadata and controls
366 lines (336 loc) · 20.7 KB
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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
using System;
using System.Collections;
using System.Collections.Generic;
using ApplicationsExceptionNamespace;
using EntityNamespace;
using Helper;
namespace StartNamespace
{
public class Controller
{
public static ArrayList GetUser()
{
int counter = 0;
const int size = 2;
ConsoleColor[] Set = new ConsoleColor[size] { ConsoleColor.Yellow, ConsoleColor.Yellow };
Console.CursorVisible = false;
while (true)
{
Console.Clear();
Console.ResetColor();
for (int i = 0; i < size; i++)
{
if (i == counter)
Set[i] = ConsoleColor.Red;
else
Set[i] = ConsoleColor.Yellow;
}
VisualHelper.ShowHeadlineScriptOnMiddle();
Console.ForegroundColor = Set[0];
VisualHelper.ShowSignInScript();
Console.ForegroundColor = Set[1];
VisualHelper.ShowSignUpScript();
Console.SetCursorPosition(0, 0);
Console.WriteLine("");
ConsoleKeyInfo key = Console.ReadKey();
if (key.Key == ConsoleKey.UpArrow && counter != 0)
{
counter--;
}
else if (key.Key == ConsoleKey.DownArrow && counter != size - 1)
{
counter++;
}
else if (key.Key == ConsoleKey.Enter)
{
Console.Clear();
Console.CursorVisible = true;
if (counter == 0) // Sign In
{
Console.ForegroundColor = ConsoleColor.Yellow;
VisualHelper.ShowSignInHeadline();
try
{
ArrayList arrayList = SignIN.SignIn();
if (arrayList != null)
{
return arrayList;
}
}
catch (DetailedException ex)
{
FileHelper.WriteExceptionToFile(ex);
}
VisualHelper.ShowSignUpHeadline();
}
else if (counter == 1) // Sign Up
{
int counter2 = 0;
const int size2 = 3;
ConsoleColor[] Set2 = new ConsoleColor[size2] { ConsoleColor.Yellow, ConsoleColor.Yellow, ConsoleColor.Yellow };
while (true)
{
Console.CursorVisible = false;
Console.Clear();
Console.ResetColor();
for (int i = 0; i < size2; i++)
{
if (i == counter2)
Set2[i] = ConsoleColor.Red;
else
Set2[i] = ConsoleColor.Yellow;
}
VisualHelper.ShowHeadlineScriptOnMiddle();
Console.ForegroundColor = Set2[0];
VisualHelper.ShowWorkerScript();
Console.ForegroundColor = Set2[1];
VisualHelper.ShowEmployerScript();
Console.ForegroundColor = Set2[2];
VisualHelper.ShowBackScript();
Console.SetCursorPosition(0, 0);
Console.WriteLine("");
ConsoleKeyInfo key2 = Console.ReadKey();
if (key2.Key == ConsoleKey.UpArrow && counter2 != 0)
{
counter2--;
}
else if (key2.Key == ConsoleKey.DownArrow && counter2 != size2 - 1)
{
counter2++;
}
else if (key2.Key == ConsoleKey.Enter)
{
if (counter2 == 2)
break;
Console.Clear();
Console.ForegroundColor = ConsoleColor.Yellow;
VisualHelper.ShowSignUpHeadline();
try
{
Human currentUser = SignUP.SignUp();
if (currentUser != null)
{
ArrayList arrayList = new ArrayList();
if (counter2 == 1) // Is Employer
{
arrayList.Add(true);
Employer employer = new Employer(currentUser);
GlobalData.database.Employers.Add(employer);
}
else // Is Worker
{
arrayList.Add(false);
Worker worker = new Worker(currentUser);
GlobalData.database.Workers.Add(worker);
}
arrayList.Add(currentUser);
return arrayList;
}
}
catch (DetailedException ex)
{
FileHelper.WriteExceptionToFile(ex);
}
VisualHelper.ShowSignUpHeadline();
}
}
}
Console.CursorVisible = false;
}
}
}
public static void StartProgram()
{
Console.Title = "Boss.az";
InitializeObjects();
while (true)
{
try
{
ArrayList arrayList = GetUser();
if (arrayList[0] is List<Vacancy>)
{
Employer currentEmployer = (Employer)arrayList[1];
currentEmployer.Vacancies = (List<Vacancy>)arrayList[0];
currentEmployer.ShowMenu();
}
else if (arrayList[0] is List<CV>)
{
Worker currentWorker = (Worker)arrayList[1];
currentWorker.CVs = (List<CV>)arrayList[0];
currentWorker.ShowMenu();
}
else if ((bool)arrayList[0])
{
Employer currentEmployer = new Employer((Human)arrayList[1]);
currentEmployer.ShowMenu();
}
else
{
Worker currentWorker = new Worker((Human)arrayList[1]);
currentWorker.ShowMenu();
}
}
catch (Exception ex)
{
Warning.Message(ex.Message);
FileHelper.WriteExceptionToFile(ex);
}
}
}
private static void InitializeObjects()
{
CV cv1 = new CV
{
Speciality = "Programmer",
Score = 97,
School = "Landau School",
CompaniesWorked = new Dictionary<string, Dictionary<string, string>>()
{
{"Kapital Bank",
new Dictionary<string, string>()
{
{
DateTime.Now.AddYears(-5).ToLongDateString(),
DateTime.Now.AddYears(-2).AddDays(-234).ToLongDateString()
}
}
},
{"Turan Bank",
new Dictionary<string, string>()
{
{
DateTime.Now.AddYears(-10).AddDays(213).ToLongDateString(),
DateTime.Now.AddYears(-6).AddDays(-234).ToLongDateString()
}
}
},
},
Gitlink = "https://github.com/Drongo-J/Battleship_Cpp",
Linkedin = "-",
HasHonorsDiploma = true,
Languages = new Dictionary<string, string>()
{
{ "English", "A"},
{ "Russian", "B+"}
},
Skills = new List<string>()
{
"C#",
"C++",
"Python"
}
};
CV cv2 = new CV()
{
Speciality = "IT",
Score = 97,
School = "Oxford School",
CompaniesWorked = new Dictionary<string, Dictionary<string, string>>()
{
{"Oxford School",
new Dictionary<string, string>()
{
{
DateTime.Now.AddYears(-10).ToLongDateString(),
DateTime.Now.AddDays(-1).AddDays(-234).ToLongDateString()
}
}
},
},
Gitlink = "https://github.com/Drongo-J/FinalProject_Cpp_OOP",
Linkedin = "https://www.linkedin.com/learning/search?trk=homepage-basic_intent-module-learning",
HasHonorsDiploma = true,
Languages = new Dictionary<string, string>()
{
{ "English", "C"},
{ "Russian", "A+"},
{ "Spanish", "C+"}
},
Skills = new List<string>()
{
"Python"
}
};
CV cv3 = new CV()
{
Speciality = "IT",
Score = 97,
School = "Landau School",
CompaniesWorked = new Dictionary<string, Dictionary<string, string>>()
{
{"Ata Bank",
new Dictionary<string, string>()
{
{
DateTime.Now.AddYears(-6).ToLongDateString(),
DateTime.Now.AddYears(-5).AddDays(-234).ToLongDateString()
}
}
},
{"Beynelxalq Bank",
new Dictionary<string, string>()
{
{
DateTime.Now.AddYears(-4).AddDays(-2).ToLongDateString(),
DateTime.Now.AddYears(-1).AddDays(213).ToLongDateString()
}
}
},
},
Gitlink = "https://github.com/Drongo-J/Product_Stock_Project_Cpp",
Linkedin = "https://www.linkedin.com/pub/dir/+/+?trk=homepage-basic_guest_nav_menu_people",
HasHonorsDiploma = true,
Languages = new Dictionary<string, string>()
{
{ "Spanish", "C"},
{ "Russian", "B"},
{ "English", "A+"}
},
Skills = new List<string>()
{
"Java",
"C++",
"C#",
"Python"
}
};
Worker w1 = new Worker("John", "Johnlu", "john123", "123456", "New-York", "(099) 999 99 99", 25);
w1.CVs.Add(cv1);
w1.CVs.Add(cv3);
Worker w2 = new Worker("Rafig", "Rafigli", "rafig123", "1234abc", "Baku", "(055) 555 55 55", 27);
w2.CVs.Add(cv2);
Vacancy v1 = new Vacancy(600, "Waitress", "Baku", "18-40", "Secondary", "1 year", "17 August, 2022", "23 September, 2022", "Anar", "(070) 286 - 04 - 04", "mirzeyevanar10012@gmail.com", "\n- 8 saatlıq iş rejimi \n- Dəyişən iş qrafiki\n- İş saatında yemək verilir\n- Istirahet gunu heftede 1 defe", "\n- Gülərüzlü olmaq\n- Şirkətin daxili qaydalarına riayət etmək\n- Qonaqlara yüksək səviyyləli xidmət göstərmək\n- Ən azından sifariş qəbul edəcək və xidmət göstərəcək səviyyədə ingilis dili biliyi");
Vacancy v2 = new Vacancy(900, "Site administrator", "Baku", "24 - 50 years", "Higher", "from 3 to 5 years", "July 07, 2022", "August 06, 2022", "Vefa Qaragözlü", "(051) 207 - 23 - 24", "office@mgc.az", "\n- Management of the company's site/sites\n- Entering and updating information on the company's site/sites\n- To monitor the technical support and proper functioning of the existing site\n- Improvement of the existing site\n- Troubleshooting software errors\n- Performing other IT tasks", "\n- Technical higher education (education in the field of IT is desirable)\n- Must know JAVA PHP, Html5, WordPress, SSL, Figma, Cpanel\n- SQL knowledge\n- Web programming and session management\n- Understand processes and methodologies in existing software\n- Ability to analyze and work with pre-written codes");
Vacancy v3 = new Vacancy(1200, "IT Engineer", "Baku", "23 - 35 years", "Higher", "from 1 to 3 years", "June 29, 2022", "July 29, 2022", "Metanet x.", "(070) 707-47-37", "info@dataline.az", "\n- Management of the company's site/sites\n- Entering and updating information on the company's site/sites\n- To monitor the technical support and proper functioning of the existing site\n- Improvement of the existing site\n- Troubleshooting software errors\n- Performing other IT tasks", "\n- High education\n- At least 1 year of work experience in the field of information technologies\n- The ability to apply innovations in one's work\n- Having appropriate knowledge of foreign languages\n- Responsible approach to work, ability to communicate");
Vacancy v4 = new Vacancy(670, "Operator", "Baku", "18 - 24 years", "Higher", "from 1 to 3 years", "July 19, 2022", "August 18, 2022", "Aysel x", "(055) 200-55-77", "info@safari-group.az", "\n- Communication with drivers by phone and social networks\n- Processing complaints and requests and feedback to drivers\n- Respond to all incoming calls in a timely and efficient manner\n- Accurate and correct transmission of information related to the service and provision of technical support\n- Timely and accurate performance of tasks given by management", "\n- Should be fluent in Azerbaijani language\n- Ability to speak fluently and with clear intonation\n- Ability to communicate and listen on the phone\n- Ability to clearly express your opinion and presentatio\n- Fulfilling duties on time\n- Business and goal-oriented, ability to work in a team\n- Keeping data confidential in the work process\n- Neat, punctual, good looking\n- Knowledge of office programs: Word, Excel\n- Work experience in this field is a must");
Vacancy v5 = new Vacancy(950, "Videographer-Photographer", "Baku", "18 - 30 years", "Secondary", "from 1 to 3 years", "July 19, 2022", "August 18, 2022", "Mehtiyeva Fidan", "(012) 594-27-35", "zn@jaluz.az", "\n- Working schedule \n- weekdays from 10:00 to 18:00\n- Making commercials, promo videos\n- Making long and short videos for social networks\n- Ability to work with a team\n- To put forward proposals and initiatives in order to increase the efficiency of the agency's work in the creative field\n- Software knowledge for video editing: Adobe Premiere, After Effects", "\n- Gender: Male\n- Knowing graphic programs\n- Motion animation (preferred)\n- Knowledge of Premiere, Photoshop, After Effects\n- At least 1 year of work experience in the relevant field\n- Creative and innovative thinking\n- Ability to work in a team");
Vacancy v6 = new Vacancy(550, "Seller", "Baku", "20 - 35 years", "Secondary", "from 1 to 3 years", "July 14, 2022", "August 13, 2022", "Yegane x.", "(055) 478-55-13", "profi-yar@mail.ru", "\n- Saleswomen are required for Dalga market, located near Metro Insaatchilar\n- Work experience is a must\n- Working hours 9 hours, once a week off spring from the store\n- Salary between 350-400\n- Contact for more details", "\n- Must have experience in a grocery store");
Vacancy v7 = new Vacancy(600, "Taxi Driver", "Baku", "25 - 50 years", "None", "from 1 to 3 years", "June 29, 2022", "July 29, 2022", "Elçin m", "(055) 950-10-01", "1taximmc@gmail.com", "\n- Our drivers will be given a Toyota Prius car\n- Those who want to join with their own car can also write. We offer them cooperation on favorable terms\n- The income varies between 20-40 manats per day depending on the driver's job\n- In addition, there are weekly and monthly bonuses and gifts\n- The driver is provided with a company number", "\n- Male candidate\n- 25-50 years old\n- BC category driver's license\n- At least 2-3 years of experience as a driver (taxi drivers are preferred)\n- Getting to know the city of Baku normally\n- Responsible, accurate, diligent, eager to win");
Vacancy v8 = new Vacancy(1000, "Front-end Programmer", "Baku", "18 - 40 years", "None", "from 3 to 5 years", "July 19, 2022", "August 18, 2022", "Bilal Sadiqov", "(012) 310-26-27", "hr@optima.az", "\n- Working hours: 5 days a week, from 09:00 to 18:00\n- Workplace: 56 Ahmet Rajabli, Aynali Plaza, 6th floor\n- The salary will be determined according to the knowledge and skills of the candidate\n- Applications are accepted in the form of a CV.", "\n- HTML, CSS\n- Javascript\n- React.js\n- Redux, Redux-toolkit\n- Axios, Rest API, WebSocket\n- Ssss, less");
Vacancy v9 = new Vacancy(870, "Registrar", "Baku", "18 - 50 years", "Secondary", "from 1 to 3 years", "July 19, 2022", "August 18, 2022", "Secda x.", "(055) 310-53-53", "yelloservice1@gmail.com", "\n- Salcano 'Registrar for the Baku depot department of MMC' is required. active vacancy \n- Working schedule: from 09:00 to 17:00\n- Saturday \n- Sunday rest", "\n- Madam\n- Age 18-50\n- Secondary education\n- Handwriting skills are a must\n- Written and oral communication skills in Azerbaijani are a must\n- Punctual\n- Responsible\n- Able to adapt to the collective");
Vacancy v10 = new Vacancy(1500, "IT Engineer", "Baku", "25 - 35 years", "Higher", "from 1 to 3 years", "June 22, 2022", "July 22, 2022", "Rafiq m.", "(051) 232-83-74", "hr@konsis.az", "\n- Konsis company is recruiting an IT specialist with knowledge and experience in this field\n- Office work\n- IT specialist \n- A technical support representative who handles inquiries from product users or other support engineers. Depending on the type of application, this specialist resolves the issue himself or forwards it to colleagues for review\n- Excellent opportunities for professional development and self-realization", "\n- Ability to investigate and analyze system-wide problems\n- Knowledge of network and Windows operating system\n- Solving problems on the spot\n- Prepare technical documentation and report to management\n- Knowledge of Azerbaijani and Russian languages");
Employer e1 = new Employer("Cavid", "Eliyev", "cavid123", "111222333", "Berlin", "(011) 111 11 11", 34);
e1.Vacancies.Add(v1);
e1.Vacancies.Add(v2);
e1.Vacancies.Add(v3);
e1.Vacancies.Add(v4);
e1.Vacancies.Add(v5);
Employer e2 = new Employer("Rza", "Asadli", "rza000", "010101", "London", "(066) 666 66 66", 44);
e2.Vacancies.Add(v6);
e2.Vacancies.Add(v7);
e2.Vacancies.Add(v8);
e2.Vacancies.Add(v9);
e2.Vacancies.Add(v10);
GlobalData.database.Employers.Add(e1);
GlobalData.database.Employers.Add(e2);
GlobalData.database.Workers.Add(w1);
GlobalData.database.Workers.Add(w2);
JsonSerialization.SerializeDatabase(GlobalData.database);
}
}
public static class GlobalData
{
public static Database database = new Database();
};
}