Beispiel #1
0
        public async Task <bool> UpdatePersonBiography(PersonBiography entity)
        {
            string query = @"
                    UPDATE [PersonBiography]
                       SET [PersonId] = @PersonId
                          ,[BiographyText] = @BiographyText
                          ,[DateCreated] = @DateCreated
                          ,[DateModified] = @DateModified
                          ,[IsActive] = @IsActive
                     WHERE Id = @Id";

            return(await Execute(query, new DynamicParameters(entity)) > 0);
        }
Beispiel #2
0
        public async Task <string> CreatePersonBiography(PersonBiography entity)
        {
            string query = @"
                   INSERT INTO [PersonBiography]
                       ([Id]
                       ,[PersonId]
                       ,[BiographyText]
                       ,[DateCreated]
                       ,[DateModified]
                       ,[IsActive])
                   OUTPUT INSERTED.Id
                   VALUES
                       (@Id
                       ,@PersonId
                       ,@BiographyText
                       ,@DateCreated
                       ,@DateModified
                       ,@IsActive)";

            return(await QueryFoD <string>(query, new DynamicParameters(entity)));
        }
Beispiel #3
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);
        }
Beispiel #4
0
 public async Task <bool> UpdatePersonBiography(PersonBiography entity)
 {
     return(await _repo.UpdatePersonBiography(entity));
 }
Beispiel #5
0
 public async Task <string> SetPersonBiography(PersonBiography entity)
 {
     return(await _repo.CreatePersonBiography(entity));
 }