public bool SaveContact(Models.Contact contact) { try { using (DB_CVContext db = new DB_CVContext()) { ContactMe contactMe = new ContactMe() { CvId = contact.CvId, Name = contact.Name, Email = contact.Email, Title = contact.Subject, Detail = contact.Body, Sended = false }; db.ContactMe.Add(contactMe); db.SaveChanges(); } } catch { return(false); } return(true); }
public Models.Formation GetFormation(int value) { Models.Formation formation = null; using (DB_CVContext db = new DB_CVContext()) { formation = new Models.Formation() { Educations = (from d in db.Educations.Where(x => x.CvId == value).OrderByDescending(x => x.InitialDate) select new Models.Education() { Logo = d.Logo.DocumentContents, SchoolName = d.SchoolName, WebSite = d.Website, DegreeLevel = d.DegreeLevel.DegreeLevelDescription, DegreeName = d.DegreeName, DegreeStatus = d.DegreeStatus.DegreeStatusDescription, Duration = "(" + d.InitialDate.ToString("MMM yyyy").ToUpper() + " - " + (d.FinalDate.HasValue ? d.FinalDate.Value.ToString("MMM yyyy").ToUpper() : "---") + ")", Detail = d.Detail }).ToList(), Courses = (from d in db.Courses.Where(x => x.CvId == value) select new Models.Course() { Logo = d.Logo.DocumentContents, CourseName = d.CourseName, TypeCourse = d.CourseType.CourseTypeDescription, Detail = d.Detail }).ToList() }; return(formation); } }
public Models.Curriculum GetCurriculum(int value) { Models.Curriculum curriculum = null; using (DB_CVContext db = new DB_CVContext()) { curriculum = (from d in db.Curriculums.Where(x => x.CvId == value) select new Models.Curriculum() { Id = d.CvId, Name = (string.IsNullOrEmpty(d.Name01) ? "" : d.Name01) + " " + (string.IsNullOrEmpty(d.Lastname01) ? "" : d.Lastname01), Title01 = d.Title01, Title02 = d.Title02 }).FirstOrDefault(); } return(curriculum); }
public Models.Document GetDocument(int value) { Models.Document document = null; using (DB_CVContext db = new DB_CVContext()) { document = (from d in db.Curriculums.Where(x => x.CvId == value) select new Models.Document() { Id = d.Document.DocumentId, Contents = d.Document.DocumentContents, ContentType = d.Document.DocumentContentType, Name = d.Document.DocumentName }).FirstOrDefault(); } return(document); }
public List <Models.Experience> GetExperiences(int value) { List <Models.Experience> experiences = new List <Models.Experience>(); using (DB_CVContext db = new DB_CVContext()) { experiences = (from d in db.WorkExperiences.Where(x => x.CvId == value).OrderByDescending(x => x.InitialDate) select new Models.Experience() { Logo = d.Logo.DocumentContents, CompanyName = d.CompanyName, WebSite = d.Website, Bussiness = d.Business, JobTitle = d.JobTitle, Duration = "(" + d.InitialDate.ToString("MMM yyyy").ToUpper() + " - " + (d.FinalDate.HasValue ? d.FinalDate.Value.ToString("MMM yyyy").ToUpper() : "Actual") + ")", Detail = d.Detail }).ToList(); } return(experiences); }
public Models.Skills GetSkills(int value) { Models.Skills skills = null; using (DB_CVContext db = new DB_CVContext()) { skills = new Models.Skills() { Technologies = (from d in db.Skills.Where(x => x.CvId == value && x.SkillTypeId == 3) select new Models.Programming() { Name = d.SkillName, Percentage = d.Percentage.HasValue ? d.Percentage.Value : 0 }).ToList(), Tools = (from d in db.Skills.Where(x => x.CvId == value && x.SkillTypeId == 2) select new Models.Abilities() { Name = d.SkillName }).ToList(), Abilities = (from d in db.Skills.Where(x => x.CvId == value && x.SkillTypeId == 4) select new Models.Abilities() { Name = d.SkillName }).ToList(), Languages = (from d in db.Skills.Where(x => x.CvId == value && x.SkillTypeId == 1) select new Models.Languages() { Logo = d.Logo.DocumentContents, Name = d.SkillName, Detail = d.Detail }).ToList(), }; return(skills); } }
public Models.AboutMe GetAboutMe(int value) { Models.AboutMe aboutMe = null; using (DB_CVContext db = new DB_CVContext()) { aboutMe = (from d in db.Curriculums.Where(x => x.CvId == value) select new Models.AboutMe() { Photo = d.Photo.DocumentContents, Summary = d.Summary, Name = d.Name01 + " " + d.Lastname01, PersonalInformation = (d.Gender ? d.Nationality.Nacionalty.Replace("/a", "") : d.Nationality.Nacionalty.Replace("o/a", "a")) + ", " + Utilities.GetAge(d.Birthname).ToString() + " años, " + (d.Gender ? d.MaritalStatus.MaritalStatusDescription.Replace("/a", "") : d.MaritalStatus.MaritalStatusDescription.Replace("o/a", "a")), Strengths = d.Strengths, Linkedin = d.ContactInformation.Website, Location = d.ContactInformation.City + ", " + d.ContactInformation.FederalState.FederalStateName + " - " + d.ContactInformation.FederalState.Country.CountryName, Email = d.ContactInformation.Email }).FirstOrDefault(); } return(aboutMe); }