예제 #1
0
        public NewJobViewModel()
        {
            JobData jobData = JobData.GetInstance();

            foreach (Employer field in jobData.Employers.ToList())
            {
                Employer.Add(new SelectListItem {
                    Value = field.ID.ToString(),
                    Text  = field.Value
                });
            }

            foreach (Location field in jobData.Locations.ToList())
            {
                //use the add method effectively
                Locations.Add(new SelectListItem {
                    Value = field.ID.ToString(),
                    Text  = field.Value
                });
            }

            foreach (CoreCompetency field in jobData.CoreCompetencies.ToList())
            {
                CoreCompetencies.Add(new SelectListItem
                {
                    Value = field.ID.ToString(),
                    Text  = field.Value
                });
            }

            foreach (PositionType field in jobData.PositionTypes.ToList())
            {
                PositionTypes.Add(new SelectListItem
                {
                    Value = field.ID.ToString(),
                    Text  = field.Value
                });
            }

            // TODO #4 - populate the other List<SelectListItem>
            // collections needed in the view
            //create a
            //public addsomething(string value){
            //Employers.Find}
        }