Exemple #1
0
        // GET: AppAccount/Details/5
        public ActionResult Details(string id)
        {
            var user    = _userManager.Users.FirstOrDefault(u => u.Id == id);
            var adapter = new UserAdapterModel(user);

            if (user.DepartmentId.HasValue)
            {
                adapter.Departments = new List <DepartmentModel> {
                    _departmentRepository.GetById(user.DepartmentId.Value)
                }
            }
            ;

            if (user.OfficeBuildingId.HasValue)
            {
                adapter.Buildings = new List <Building> {
                    _buildingRepository.GetById(user.OfficeBuildingId.Value)
                };
                if (user.OfficeRoomId.HasValue)
                {
                    adapter.Rooms = new List <Room> {
                        _roomRepository.GetById(user.OfficeRoomId.Value)
                    }
                }
                ;
            }
            if (user.TechnicalGroupId.HasValue)
            {
                adapter.TechnicalGroups = new List <TechnicalGroup> {
                    _technicalGroupRepository.GetById(user.TechnicalGroupId.Value)
                };
                if (user.SubTechnicalGroupId.HasValue)
                {
                    adapter.SubTechnicalGroups = new List <SubTechnicalGroup> {
                        _subTechnicalGroupRepository.GetById(user.SubTechnicalGroupId.Value)
                    }
                }
                ;
            }

            return(View(adapter));
        }
Exemple #2
0
 // GET: TechnicalGroup/Details/5
 public ActionResult Details(int id)
 {
     return(View(_technicalGroupRepository.GetById(id)));
 }