-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCV.cs
141 lines (129 loc) · 4.33 KB
/
CV.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
using Helper;
using System;
using System.Collections.Generic;
namespace EntityNamespace
{
public class CV
{
public string Speciality { get; set; }
public string School { get; set; } // the school graduated from
public int Score { get; set; } // the score he or she was admitted to university with
public List<string> Skills { get; set; } = new List<string>();
public Dictionary<string, Dictionary<string, string>> CompaniesWorked { get; set; } = new Dictionary<string, Dictionary<string, string>>();
public Dictionary<string, string> Languages { get; set; } = new Dictionary<string, string>();
public bool HasHonorsDiploma { get; set; }
public string Gitlink { get; set; }
public string Linkedin { get; set; }
public override string ToString()
{
string cv = string.Empty;
cv += $" Speciality {Speciality}\n";
cv += $" School {School}\n";
cv += $" Score {Score}\n";
cv += $"\n Skills ";
if (Skills == null)
{
cv += "None";
}
else
{
bool first = true;
foreach (var skill in Skills)
{
if (first)
{
cv += $"{skill}\n";
first = false;
}
else
{
cv += $" {skill}\n";
}
}
}
cv += $"\n Companies ";
if (CompaniesWorked == null)
{
cv += "None";
}
else
{
bool first = true;
foreach (var company in CompaniesWorked)
{
if (first)
{
cv += $"{company.Key}\n";
first = false;
}
else
{
cv += $"\n {company.Key}\n";
}
foreach (var date in company.Value)
{
DateTime startTime;
DateTime endTime;
var a = DateTime.TryParse(date.Key, out startTime);
var b = DateTime.TryParse(date.Value, out endTime);
var experience = endTime - startTime;
float years = (float)(experience.TotalDays / 365);
string result = years.ToString("f1");
cv += $" Start Date : {date.Key}\n";
cv += $" Finish Date : {date.Value}\n";
cv += $" Experience : {result} years\n";
}
}
}
cv += $"\n Languages ";
if (Languages == null)
{
cv += "None";
}
else
{
bool first = true;
foreach (var language in Languages)
{
if (first)
{
cv += $"{language.Key} - {language.Value}\n";
first = false;
}
else
{
cv += $" {language.Key} - {language.Value}\n";
}
}
}
cv += "\n Has Honor Diploma ";
if (HasHonorsDiploma)
{
cv += "Yes\n";
}
else
{
cv += "No\n";
}
cv += $" Git Link ";
if (string.IsNullOrEmpty(Gitlink))
{
cv += "-\n";
}
else
{
cv += $"{Gitlink}\n";
}
cv += $" Linkedin ";
if (string.IsNullOrEmpty(Linkedin))
{
cv += "-\n";
}
else
{
cv += $"{Linkedin}\n";
}
return cv;
}
}
}