Esempio n. 1
0
        private static void AppendJobText(StringBuilder sb, JobViewHtml job, bool hideRecentEmployers)
        {
            // Don't include the dates, titles or employers for the last 2 jobs.

            if (!string.IsNullOrEmpty(job.Title))
            {
                string yearRange = job.GetYearRange();
                if (!string.IsNullOrEmpty(yearRange))
                {
                    sb.Append(yearRange);
                    sb.Append(" ");
                }

                if (!string.IsNullOrEmpty(job.Title))
                {
                    sb.Append(job.Title);
                    sb.Append(", ");
                }
            }

            if (!string.IsNullOrEmpty(job.Employer) && (!hideRecentEmployers || !job.IsRecentJob))
            {
                sb.Append(job.Employer);
            }

            if (sb.Length > 0)
            {
                sb.Append(HtmlLineBreak);
            }

            sb.Append(job.Description);
            sb.Append(HtmlLineBreak);
        }
Esempio n. 2
0
        public static JobViewHtml[] GetJobViews(IResume resume)
        {
            var jobs = resume.Jobs;

            var views = new JobViewHtml[(jobs == null ? 0 : jobs.Count)];

            if (jobs != null)
            {
                var previousJob = resume.PreviousJob;

                for (int index = 0; index < views.Length; index++)
                {
                    var job = jobs[index];
                    views[index] = new JobViewHtml(job, (job.Dates != null && job.Dates.End == null) || job == previousJob);
                }
            }

            return(views);
        }
Esempio n. 3
0
        public ResumeViewHtml(IResume resume)
        {
            if (resume == null)
            {
                throw new ArgumentNullException("resume");
            }

            _objective    = HtmlUtil.LineBreaksToHtml(resume.Objective);
            _summary      = HtmlUtil.LineBreaksToHtml(resume.Summary);
            _skills       = HtmlUtil.LineBreaksToHtml(resume.Skills);
            _professional = HtmlUtil.LineBreaksToHtml(resume.Professional);
            _interests    = HtmlUtil.LineBreaksToHtml(resume.Interests);
            _referees     = HtmlUtil.LineBreaksToHtml(resume.Referees);
            _citizenship  = HtmlUtil.LineBreaksToHtml(resume.Citizenship);
            _affiliations = HtmlUtil.LineBreaksToHtml(resume.Affiliations);
            _other        = HtmlUtil.LineBreaksToHtml(resume.Other);

            _jobs = JobViewHtml.GetJobViews(resume);

            if (resume.Schools == null)
            {
                _schools = new SchoolViewHtml[0];
            }
            else
            {
                _schools = new SchoolViewHtml[resume.Schools.Count];

                for (int index = 0; index < _schools.Length; index++)
                {
                    _schools[index] = new SchoolViewHtml(resume.Schools[index]);
                }
            }

            if (resume.Courses == null)
            {
                _courses = new string[0];
            }
            else
            {
                _courses = new string[resume.Courses.Count];

                for (int index = 0; index < _courses.Length; index++)
                {
                    _courses[index] = HtmlUtil.LineBreaksToHtml(resume.Courses[index]);
                }
            }

            if (resume.Awards == null)
            {
                _awards = new string[0];
            }
            else
            {
                _awards = new string[resume.Awards.Count];

                for (int index = 0; index < _awards.Length; index++)
                {
                    _awards[index] = HtmlUtil.LineBreaksToHtml(resume.Awards[index]);
                }
            }
        }