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

            if (person != null)
            {
                ViewData["Title"] = person.Title + " " + person.Forename + " " + person.Surname;
                if (string.IsNullOrWhiteSpace(person.TenantCode))
                {
                    person.Tenant = _propertyFacadeApiClient.GetTenantByTenantCode(person.TenantCode).Result;
                    person.Tenant.Property.PropertyDetailView = _propertyFacadeApiClient.GetPropertyDetailView(person.Tenant.Property.PropertyCode).Result;
                }
                if (person.ApplicationId.HasValue)
                {
                    person.VblApplication = _customerApiClient.GetVblApplication(person.ApplicationId.Value).Result;
                }
                if (person.MainContactPersonId.HasValue)
                {
                    var mainPerson = _customerApiClient.GetPerson(person.MainContactPersonId.Value).Result;
                    person.MainContactPerson = mainPerson;
                }
            }
            if (Request.IsAjaxRequest())
            {
                return(PartialView("_Details", person));
            }
            return(View(person));
        }
Ejemplo n.º 2
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));
        }