Example #1
0
// GET: EmployeeController/Create
        public ActionResult Create()
        {
            var department      = _departmentrepo.FindAll();
            var departmentItems = department.Select(q => new SelectListItem
            {
                Text  = q.Name,
                Value = q.Id.ToString()
            });
            var relationshiptype      = _relationshiptyperepo.FindAll();
            var relationshiptypeItems = relationshiptype.Select(q => new SelectListItem {
                Text  = q.Name,
                Value = q.Id.ToString()
            });
            var qualification      = _qualificationrepo.FindAll();
            var qualificationItems = qualification.Select(q => new SelectListItem
            {
                Text  = q.Name,
                Value = q.Id.ToString()
            });
            var model = new EmployeeVM
            {
                Departments       = departmentItems,
                RelationshipTypes = relationshiptypeItems,
                Qualifications    = qualificationItems
            };

            return(View(model));
        }
Example #2
0
        // GET: RelationshipTypeController
        public ActionResult Index()
        {
            var RelationshipTypes = _repo.FindAll().ToList();
            var model             = _mapper.Map <List <RelationshipType>, List <RelationshipTypeVM> >(RelationshipTypes);

            return(View(model));
        }