Ejemplo n.º 1
0
        public IActionResult Details(string propertyCode, int personId)
        {
            var propertyDetail     = _propertyFacadeApiClient.GetPropertyDetails(propertyCode).Result;
            var propertyDetailView = _propertyFacadeApiClient.GetPropertyDetailView(propertyCode).Result;

            propertyDetail.AssetId  = propertyDetailView?.AssetId ?? 0;
            propertyDetail.Id       = propertyDetailView?.Id ?? 0;
            propertyDetail.PersonId = personId;
            propertyDetail.Person   = _personApiClient.GetPerson(personId).Result;
            return(View(propertyDetail));
        }
Ejemplo n.º 2
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));
        }