public ActionResult InsertEducation(Education education) { ZonaFl.Persistence.Entities.AspNetUsers useru = null; ZonaFl.Business.SubSystems.SUser usern = new Business.SubSystems.SUser(); useru = usern.GetCurriculumUserById(new Guid(education.UserId)); List <Persistence.Entities.Education> educations = new List <Persistence.Entities.Education>(); CultureInfo provider = CultureInfo.CurrentCulture; SCountry sco = new SCountry(); if (education.Institution != null) { Persistence.Entities.Education education1 = new ZonaFl.Persistence.Entities.Education() { Institution = education.Institution, Country = sco.FindCountrybyName(education.Country).Id, Title = education.Title, DateIni = DateTime.Parse(education.DateIniE, provider), DateEnd = DateTime.Parse(education.DateEndE, provider), Actually = education.Actually, UserId = education.UserId }; educations.Add(education1); } if (education.Institution2 != null) { Persistence.Entities.Education education2 = new ZonaFl.Persistence.Entities.Education() { Institution = education.Institution2, Country = education.Country2 != null?sco.FindCountrybyName(education.Country2).Id : -1, Title = education.Title2, DateIni = DateTime.Parse(education.DateIni2E), DateEnd = DateTime.Parse(education.DateEnd2E), Actually = education.Actually2, UserId = education.UserId }; educations.Add(education2); } if (education.Institution3 != null) { Persistence.Entities.Education education3 = new ZonaFl.Persistence.Entities.Education() { Institution = education.Institution3, Country = education.Country3 != null?sco.FindCountrybyName(education.Country3).Id : -1, Title = education.Title3, DateIni = DateTime.Parse(education.DateIni3E), DateEnd = DateTime.Parse(education.DateEnd3E), Actually = education.Actually3, UserId = education.UserId }; educations.Add(education3); } bool rta = usern.InsertEducation(educations); return(Json(data: rta)); }
public ActionResult InsertExperienceLab(Experience experience) { ZonaFl.Persistence.Entities.AspNetUsers useru = null; ZonaFl.Business.SubSystems.SUser usern = new Business.SubSystems.SUser(); useru = usern.GetCurriculumUserById(new Guid(experience.UserId)); List <Persistence.Entities.Experience> experiences = new List <Persistence.Entities.Experience>(); if (experience.Company != null) { Persistence.Entities.Experience experiencen1 = new Persistence.Entities.Experience() { Company = experience.Company, CurrentEmploy = experience.CurrentEmploy, DateEnd = DateTime.Parse(experience.DateEnd), DateIni = DateTime.Parse(experience.DateIni), FunctionPosition = experience.FunctionPosition, Position = experience.Position, UserId = experience.UserId }; experiences.Add(experiencen1); } if (experience.Company2 != null) { Persistence.Entities.Experience experiencen2 = new Persistence.Entities.Experience() { Company = experience.Company2, CurrentEmploy = experience.CurrentEmploy2, DateEnd = DateTime.Parse(experience.DateEnd2), DateIni = DateTime.Parse(experience.DateIni2), FunctionPosition = experience.FunctionPosition2, Position = experience.Position2, UserId = experience.UserId }; experiences.Add(experiencen2); } if (experience.Company3 != null) { Persistence.Entities.Experience experiencen3 = new Persistence.Entities.Experience() { Company = experience.Company3, CurrentEmploy = experience.CurrentEmploy3, DateEnd = DateTime.Parse(experience.DateEnd3), DateIni = DateTime.Parse(experience.DateIni3), FunctionPosition = experience.FunctionPosition3, Position = experience.Position3, UserId = experience.UserId }; experiences.Add(experiencen3); } bool rta = usern.InsertExperienceLab(experiences); return(Json(data: rta)); }
public ActionResult InsertCertificationLab(Certification certification) { ZonaFl.Persistence.Entities.AspNetUsers useru = null; ZonaFl.Business.SubSystems.SUser usern = new Business.SubSystems.SUser(); useru = usern.GetCurriculumUserById(new Guid(certification.UserId)); List <Persistence.Entities.Certification> certifications = new List <Persistence.Entities.Certification>(); if (certification.Certificate != null) { Persistence.Entities.Certification certification1 = new ZonaFl.Persistence.Entities.Certification() { Certificate = certification.Certificate, DateCert = DateTime.Parse(certification.DateCert), Otorgante = certification.Otorgante, Description = certification.Description, UserId = certification.UserId, Actually = certification.Actually }; certifications.Add(certification1); } if (certification.Certificate2 != null) { Persistence.Entities.Certification certification2 = new ZonaFl.Persistence.Entities.Certification() { Certificate = certification.Certificate2, DateCert = DateTime.Parse(certification.DateCert2), Otorgante = certification.Otorgante2, Description = certification.Description2, UserId = certification.UserId2, Actually = certification.Actually2 }; certifications.Add(certification2); } if (certification.Certificate3 != null) { Persistence.Entities.Certification certification3 = new ZonaFl.Persistence.Entities.Certification() { Certificate = certification.Certificate3, DateCert = DateTime.Parse(certification.DateCert3), Otorgante = certification.Otorgante3, Description = certification.Description3, UserId = certification.UserId3, Actually = certification.Actually3 }; certifications.Add(certification3); } bool rta = usern.InsertCertifications(certifications); return(Json(data: rta)); }
public ActionResult DetailsById(string id) { ZonaFl.Persistence.Entities.AspNetUsers useru = null; ZonaFl.Business.SubSystems.SUser usern = new Business.SubSystems.SUser(); useru = usern.GetCurriculumUserById(new Guid(id)); if (SessionBag.Current.User == null) { SessionBag.Current.User = useru; } Curriculum curr = new Curriculum(); RegisterBindingModel regbm = new RegisterBindingModel(); regbm.InjectFrom(useru); regbm.Skills = useru.Skills.Select(e => new ZonaFl.Models.Skill().InjectFrom(e)).Cast <ZonaFl.Models.Skill>().ToList(); curr.User = regbm; curr.Experiences = useru.Experiences.Select(e => new ZonaFl.Models.Experience().InjectFrom(e)).Cast <ZonaFl.Models.Experience>().ToList(); curr.Experiences.ForEach(e => e.DateIni = useru.Experiences.Where(t => t.Id == e.Id).FirstOrDefault().DateIni.ToString()); curr.Experiences.ForEach(e => e.DateEnd = useru.Experiences.Where(t => t.Id == e.Id).FirstOrDefault().DateEnd.ToString()); curr.Experiences.ForEach(e => e.DateIni2 = useru.Experiences.Where(t => t.Id == e.Id).FirstOrDefault().DateIni.ToString()); curr.Experiences.ForEach(e => e.DateEnd2 = useru.Experiences.Where(t => t.Id == e.Id).FirstOrDefault().DateEnd.ToString()); curr.Experiences.ForEach(e => e.DateIni3 = useru.Experiences.Where(t => t.Id == e.Id).FirstOrDefault().DateIni.ToString()); curr.Experiences.ForEach(e => e.DateEnd3 = useru.Experiences.Where(t => t.Id == e.Id).FirstOrDefault().DateEnd.ToString()); curr.Certifications = useru.Certifications.Select(e => new ZonaFl.Models.Certification().InjectFrom(e)).Cast <ZonaFl.Models.Certification>().ToList(); curr.Certifications.ForEach(e => e.DateCert = useru.Certifications.Where(t => t.Id == e.Id).FirstOrDefault().DateCert.ToString()); curr.Certifications.ForEach(e => e.DateCert2 = useru.Certifications.Where(t => t.Id == e.Id).FirstOrDefault().DateCert.ToString()); curr.Certifications.ForEach(e => e.DateCert3 = useru.Certifications.Where(t => t.Id == e.Id).FirstOrDefault().DateCert.ToString()); curr.Educations = useru.Educations.Select(e => new ZonaFl.Models.Education().InjectFrom(e)).Cast <ZonaFl.Models.Education>().ToList(); curr.Educations.ForEach(e => e.DateIniE = useru.Educations.Where(t => t.Id == e.Id).FirstOrDefault().DateIni.ToString()); curr.Educations.ForEach(e => e.DateEndE = useru.Educations.Where(t => t.Id == e.Id).FirstOrDefault().DateEnd.ToString()); curr.Educations.ForEach(e => e.DateIni2E = useru.Educations.Where(t => t.Id == e.Id).FirstOrDefault().DateIni.ToString()); curr.Educations.ForEach(e => e.DateEnd2E = useru.Educations.Where(t => t.Id == e.Id).FirstOrDefault().DateEnd.ToString()); curr.Educations.ForEach(e => e.DateIni3E = useru.Educations.Where(t => t.Id == e.Id).FirstOrDefault().DateIni.ToString()); curr.Educations.ForEach(e => e.DateEnd3E = useru.Educations.Where(t => t.Id == e.Id).FirstOrDefault().DateEnd.ToString()); curr.Languages = useru.Languages.Select(e => new ZonaFl.Models.Language().InjectFrom(e)).Cast <ZonaFl.Models.Language>().ToList(); if (useru.Image != null && useru.Image.Contains("fakepath")) { useru.Image = useru.Image.Replace(@"C:\fakepath\", ""); } ViewBag.UserId = id; ViewBag.User = useru.UserName; ViewBag.ImageUser = useru.Image; ViewBag.IdUser = id; return(View("Details", curr)); }
public ActionResult InsertLanguageLab(Language language) { ZonaFl.Persistence.Entities.AspNetUsers useru = null; ZonaFl.Business.SubSystems.SUser usern = new Business.SubSystems.SUser(); useru = usern.GetCurriculumUserById(new Guid(language.UserId)); List <Persistence.Entities.Language> languages = new List <Persistence.Entities.Language>(); if (language.Name != null) { Persistence.Entities.Language language1 = new ZonaFl.Persistence.Entities.Language() { Name = language.Name, LevelLang = language.LevelLang, Certificate = language.Certificate, UserId = language.UserId }; languages.Add(language1); } if (language.Name2 != null) { Persistence.Entities.Language language2 = new ZonaFl.Persistence.Entities.Language() { Name = language.Name2, LevelLang = language.LevelLang2, Certificate = language.Certificate2, UserId = language.UserId }; languages.Add(language2); } if (language.Name3 != null) { Persistence.Entities.Language language3 = new ZonaFl.Persistence.Entities.Language() { Name = language.Name3, LevelLang = language.LevelLang3, Certificate = language.Certificate3, UserId = language.UserId }; languages.Add(language3); } bool rta = usern.InsertLanguages(languages); return(Json(data: rta)); }
public ActionResult EditById(string id) { ZonaFl.Persistence.Entities.AspNetUsers useru = null; ZonaFl.Business.SubSystems.SUser usern = new Business.SubSystems.SUser(); useru = usern.GetCurriculumUserById(new Guid(id)); if (SessionBag.Current.User == null) { SessionBag.Current.User = useru; } Curriculum curr = new Curriculum(); RegisterBindingModel regbm = new RegisterBindingModel(); regbm.InjectFrom(useru); regbm.Skills = useru.Skills.Select(e => new ZonaFl.Models.Skill().InjectFrom(e)).Cast <ZonaFl.Models.Skill>().ToList(); curr.User = regbm; curr.Experiences = useru.Experiences.Select(e => new ZonaFl.Models.Experience().InjectFrom(e)).Cast <ZonaFl.Models.Experience>().ToList(); curr.Certifications = useru.Certifications.Select(e => new ZonaFl.Models.Certification().InjectFrom(e)).Cast <ZonaFl.Models.Certification>().ToList(); curr.Educations = useru.Certifications.Select(e => new ZonaFl.Models.Education().InjectFrom(e)).Cast <ZonaFl.Models.Education>().ToList(); curr.Languages = useru.Certifications.Select(e => new ZonaFl.Models.Language().InjectFrom(e)).Cast <ZonaFl.Models.Language>().ToList(); ZonaFl.Business.SubSystems.SProject userp = new Business.SubSystems.SProject(); // trae las calificacion promedio del usuario por los proyectos int calif = userp.GetCalificationAverageUser(id); //calif = 3; var projects = userp.GetProjectsEndedByUser(id); List <Models.Project> projetsm = new List <Models.Project>(); projetsm = projects.Select(e => new Models.Project().InjectFrom(e)).Cast <Models.Project>().ToList(); projetsm.Select(e => new Models.Project().InjectFrom(usern.GetUserByOffer(e.IdOffer, 0))).Cast <Models.Project>().ToList(); ViewBag.Calification = calif; ViewBag.Commentaries = projetsm; ViewBag.User = useru.UserName; ViewBag.ImageUser = useru.Image; ViewBag.IdUser = id; return(View("Edit", curr)); }