예제 #1
0
        // GET
        public ActionResult CreateApp()
        {
            var newApplication = new CreateAppVM();
            newApplication.ApplicationInfo = new Resume();
            newApplication.CreatePositionsList(_rops.ReturnListOfPositions());
            newApplication.CreateStateList(_rops.ReturnListOfStates());
            newApplication.CreateDegreesList();

            Experience newExp = new Experience();
            newApplication.ApplicationInfo.Experiences.Add(newExp);
            EducationInfo newEdu = new EducationInfo();
            newApplication.ApplicationInfo.Education.Add(newEdu);

            newApplication.ApplicationInfo.AppId = _rops.HighestAppIDNum() + 1;

            return View(newApplication);
        }
예제 #2
0
        public List<Resume> GetAllResumes()
        {
            AppsList = new List<Resume>();
            XDocument xDoc = XDocument.Load(RootPath + "Resumes.xml");
            var applications = xDoc.Descendants("resumes");

            foreach (var app in applications.Descendants("resume"))
            {
                Resume resume = new Resume();

                resume.AppId = int.Parse(app.Element("AppID").Value);

                foreach (var info in app.Descendants("ContactInfo"))
                {
                    resume.ApplicantContactInfo.FirstName = info.Element("FirstName").Value;
                    resume.ApplicantContactInfo.LastName = info.Element("LastName").Value;
                    resume.ApplicantContactInfo.MiddleInitial = info.Element("MiddleInitial").Value;
                    resume.ApplicantContactInfo.Prefix = info.Element("Prefix").Value;
                    resume.ApplicantContactInfo.Suffix = info.Element("Suffix").Value;
                    resume.ApplicantContactInfo.Email = info.Element("Email").Value;
                    resume.ApplicantContactInfo.PhoneNumber = info.Element("PhoneNumber").Value;
                }

                foreach (var address in app.Descendants("Address"))
                {
                    resume.ApplicantContactInfo.Address.AddressLine1 = address.Element("AddressLine1").Value;
                    resume.ApplicantContactInfo.Address.AddressLine2 = address.Element("AddressLine2").Value;
                    resume.ApplicantContactInfo.Address.City = address.Element("City").Value;
                    resume.ApplicantContactInfo.Address.State = address.Element("State").Value;
                    resume.ApplicantContactInfo.Address.Zipcode = address.Element("Zipcode").Value;
                }

                foreach (var pos in app.Descendants("Position"))
                {
                    resume.Position.PositionId = int.Parse(pos.Element("PositionID").Value);
                    resume.Position.PositionName = pos.Element("PositionName").Value;
                    resume.Position.Description = pos.Element("Description").Value;
                    resume.Position.PostedDate = DateTime.Parse(pos.Element("PostedDate").Value);
                    //resume.Position.ClosingDate = DateTime.Parse(pos.Element("ClosingDate").Value);
                }

                foreach (var exp in app.Descendants("Experience"))
                {
                    Experience experience = new Experience();
                    List<Experience> experiences = new List<Experience>();

                    experience.Company = exp.Element("Company").Value;
                    experience.Title = exp.Element("Title").Value;
                    experience.StartDate = DateTime.Parse(exp.Element("StartDate").Value);
                    experience.EndDate = DateTime.Parse(exp.Element("EndDate").Value);

                    foreach (var address in exp.Descendants("Location"))
                    {
                        experience.Location.City = address.Element("City").Value;
                        experience.Location.State = address.Element("State").Value;
                    }
                    experience.Description = exp.Element("Description").Value;
                    experience.SupervisorName = exp.Element("SupervisorName").Value;
                    experience.SupervisorPhone = exp.Element("SupervisorPhone").Value;
                    experience.SupervisorEmail = exp.Element("SupervisorEmail").Value;

                    experiences.Add(experience);

                    resume.Experiences = experiences;
                }

                foreach (var edu in app.Descendants("Education"))
                {

                    EducationInfo education = new EducationInfo();
                    List<EducationInfo> educations = new List<EducationInfo>();

                    education.Degree.DegreeAbbr = edu.Element("Degree").Value;
                    education.Institution = edu.Element("Institution").Value;

                    foreach (var address in edu.Elements("Location"))
                    {
                        education.Location.City = address.Element("City").Value;
                        education.Location.State = address.Element("State").Value;
                    }

                    education.StartDate = DateTime.Parse(edu.Element("StartDate").Value);
                    education.GraduationDate = DateTime.Parse(edu.Element("GraduationDate").Value);
                    education.GPA = decimal.Parse(edu.Element("GPA").Value);
                    education.Concentration = edu.Element("Concentration").Value;

                    educations.Add(education);

                    resume.Education = educations;

                }

                resume.DesiredSalary = int.Parse(app.Element("DesiredSalary").Value);
                resume.AppDate = DateTime.Parse(app.Element("AppDate").Value);

                AppsList.Add(resume);
            }

            return AppsList;
        }