Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }