示例#1
0
        /// <summary>
        /// Updates the ECA system's social media data with the given updated social media.
        /// </summary>
        /// <param name="updatedSocialMedia">The updated social media.</param>
        public void Update(UpdatedSocialMediaPresence updatedSocialMedia)
        {
            var socialMedia = Context.SocialMedias.Find(updatedSocialMedia.Id);
            ParticipantPersonSevisDTO participant = null;

            if (socialMedia != null && socialMedia.PersonId.HasValue)
            {
                participant = GetParticipantByPersonId((int)socialMedia.PersonId);
            }
            DoUpdate(updatedSocialMedia, socialMedia, participant);
        }
示例#2
0
 private void DoUpdate(UpdatedSocialMediaPresence updatedSocialMedia, SocialMedia modelToUpdate, ParticipantPersonSevisDTO participant)
 {
     Contract.Requires(updatedSocialMedia != null, "The updatedSocialMedia must not be null.");
     throwIfSocialMediaNotFound(modelToUpdate, updatedSocialMedia.Id);
     if (participant != null)
     {
         throwValidationErrorIfParticipantSevisInfoIsLocked(participant);
     }
     modelToUpdate.SocialMediaTypeId = updatedSocialMedia.SocialMediaTypeId;
     modelToUpdate.SocialMediaValue  = updatedSocialMedia.Value;
     updatedSocialMedia.Update.SetHistory(modelToUpdate);
 }
示例#3
0
        /// <summary>
        /// Updates the ECA system's social media data with the given updated social media.
        /// </summary>
        /// <param name="updatedSocialMedia">The updated social media.</param>
        public async Task UpdateAsync(UpdatedSocialMediaPresence updatedSocialMedia)
        {
            var socialMedia = await Context.SocialMedias.FindAsync(updatedSocialMedia.Id);

            ParticipantPersonSevisDTO participant = null;

            if (socialMedia != null && socialMedia.PersonId.HasValue)
            {
                participant = await GetParticipantByPersonIdAsync((int)socialMedia.PersonId);
            }
            DoUpdate(updatedSocialMedia, socialMedia, participant);
        }
示例#4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="updatedSocialMedia"></param>
 /// <returns></returns>
 public Task UpdateAsync(UpdatedSocialMediaPresence updatedSocialMedia)
 {
     Contract.Requires(updatedSocialMedia != null, "The updated social media must not be null.");
     return(Task.FromResult <object>(null));
 }
示例#5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="updatedSocialMedia"></param>
 public void Update(UpdatedSocialMediaPresence updatedSocialMedia)
 {
     Contract.Requires(updatedSocialMedia != null, "The updated social media must not be null.");
 }