Esempio n. 1
0
        // GET: Companies/Details/5
        public IActionResult Details(int?id)
        {
            var companyId = (int)id;
            var company   = _companyRepository.Get(companyId);

            if (company != null)
            {
                var employees = _companyEmployeeRepository.GetQueryable()
                                .Include(item => item.Employee)
                                .Where(cm => cm.CompanyId == id)
                                .ToList();

                var locations = _companyLocationRepository.GetQueryable()
                                .Include(item => item.Location)
                                .Where(cm => cm.CompanyId == id)
                                .ToList();

                var viewCompanyViewModel = new ViewCompanyViewModel
                {
                    Company          = company,
                    CompanyEmployees = employees,
                    CompanyLocations = locations
                };

                return(View(viewCompanyViewModel));
            }

            return(NotFound());
        }
Esempio n. 2
0
 public ViewCompany()
 {
     InitializeComponent();
     _VCVM            = new ViewCompanyViewModel();
     this.DataContext = _VCVM;
 }