// The department details method is used to display the name budget and a list of the departments employees with their full names for the specefic department
        // GET: Department/Details/5
        public ActionResult Details(int id)
        {
            DepartmentEmployeesViewModel viewModel = new DepartmentEmployeesViewModel(id, _config.GetConnectionString("DefaultConnection"));

            Department department = GetDepartmentById(id);

            viewModel.department = department;

            return(View(viewModel));
        }
Пример #2
0
        // GET: DepartmentEmployees
        public ActionResult GetEmployeesForDepartment(int departmentId)
        {
            var model = new DepartmentEmployeesViewModel {
                DepartmentId = departmentId
            };

            model.Employees = employeeService.GetAllUsers().Select(u => new UserTypeViewModel
            {
                Id           = u.Id,
                Name         = u.Name,
                LastName     = u.LastName,
                UserTypeName = SetUserType()
            });
            return(View(model));
        }