public async Task <PersonBiographyViewModel> CreatePartialViewPersonBiography(string personId) { PersonBiographyViewModel biography = new PersonBiographyViewModel(); var bio = await _mgrFcc.GetPersonBiographyByPersonId(personId); biography.PersonBiography = bio ?? new PersonBiography() { Id = Guid.NewGuid().ToString() }; if (bio == null) { return(biography); } foreach (var activity in biography.ActivityTypeLoadingList) { biography.Activities.Add(activity, await _mgrFcc.GetAllPersonActivityByPerson(personId, activity)); } return(biography); }
public async Task <bool> SavePersonBiography(string personId, string biographyText) { bool success = false; var biography = await _mgrFcc.GetPersonBiographyByPersonId(personId); if (biography != null) { biography.BiographyText = biographyText; await _mgrFcc.UpdatePersonBiography(biography); } else { biography = new PersonBiography(); biography.Id = Guid.NewGuid().ToString(); biography.BiographyText = biographyText; biography.PersonId = personId; await _mgrFcc.SetPersonBiography(biography); } return(success); }