Esempio n. 1
0
        public IActionResult Details(int personId)
        {
            var person = GetPersonForDetails(personId);

            ViewData["Title"] = person.Title + " " + person.Forename + " " + person.Surname;
            if (string.IsNullOrWhiteSpace(person.TenantCode))
            {
                person.Tenant = _personApiClient.GetTenantByTenantCode(person.TenantCode).Result;
                // person.Tenant.Property.PropertyDetailView = _propertyFacadeApiClient.GetPropertyDetailView(person.Tenant.Property.PropertyCode).Result;
            }
            if (person.ApplicationId.HasValue)
            {
                person.VblApplication = _personApiClient.GetVblApplication(person.ApplicationId.Value).Result;
            }
            if (person.MainContactPersonId.HasValue)
            {
                var householdMembers = _personApiClient.GetPersonByMainContactId(person.MainContactPersonId.Value).Result?.Where(x => x.Id != x.MainContactPersonId).ToList();
                person.HouseholdMembers.AddRange(householdMembers);
            }
            return(View(person));
        }