// GET: CV/Details/5 public ActionResult Details(int id) { EducationService ES = new EducationService(); CV c = CVS.GetById(id); CvModel CVVM = new CvModel(); CVVM.candidate = c.candidate; CVVM.departement = c.departement; //List<Education> educs = new List<Education>(); //foreach(var idedu in c.educations) //{ // educs.Add(ES.GetById(idedu.id)); //} CVVM.educations = c.educations; CVVM.experiences = c.experiences.ToList(); CVVM.hobbies = c.hobbies; CVVM.languages = c.languages.ToList(); CVVM.linkedInLink = c.linkedInLink; CVVM.typeofjob = c.typeofjob; return(View(CVVM)); }
static void Main(string[] args) { Experience exp = new Experience { id = 10, from = new DateTime(), to = new DateTime(), poste = "engineer", company = "Vermeg" }; Organisation org = new Organisation { City = "Monastir", Country = "Tunisia", Name = "ISIMM" }; Education educ = new Education { id = 10, from = new DateTime(), to = new DateTime(), organisation = org, }; Address adr = new Address { address = "C5 , C6 N°2 ", city = "Monastir", country = "Tunisia" }; Candidate cand = new Candidate { id = 10, address = adr, age = 24, birthDate = new DateTime(), email = "*****@*****.**", name = "Ala", phone = "50280400", sex = "Male", surname = "Ben khlifa" }; var listedu = new Education[10]; CVService CVS = new CVService(); CV c = CVS.GetById(2); EducationService ES = new EducationService(); listedu = c.educations.ToArray(); Console.WriteLine(ES.GetById(listedu[0].id).title); var listexp = new List <Experience>(); var listlang = new List <Languages>(); //listlang.Add(lang); //listexp.Add(exp); //listedu.Add(educ); CV cv = new CV { candidate = cand, departement = "RH", educations = listedu, experiences = listexp, hobbies = "FootBall", languages = listlang, linkedInLink = "URL", typeofjob = "Engineer" }; Languages lang = new Languages { level = "Native", name = "AR", cv = cv }; //LanguageService LS = new LanguageService(); //LS.Add(lang); //LS.Commit(); //ExperienceService ES = new ExperienceService(); //ES.Add(exp); //ES.Commit(); //EducationService EDS = new EducationService(); //EDS.Add(educ); //EDS.Commit(); //var con = CAS.GetById(2); //Console.WriteLine(con.email); //CAS.Add(cand); //CAS.Commit(); //CVService CVS = new CVService(); //CVS.Add(cv); //CVS.Commit(); Console.ReadKey(); }