public HttpResponseMessage UpdateMember(ConsumerMember member)
        {
            var modelValidation = member.Validate(this.AccountSession, ValidationMode.Update);

            if (modelValidation.IsValid)
            {
                try
                {
                    // update settings
                    var consumer = this.Uow.ConsumerMembers.UpdateMember(member);

                    // get updated entity
                    var results = this.Uow.ConsumerMembers.FindById(member.Id);

                    return(CreateSuccessResponse(new { success = true, results = results }, HttpStatusCode.OK));
                }
                catch (Exception ex)
                {
                    // log exception
                    Logger.Error(string.Format("Exception detected attempting to update consumer for Id {0} via user {1}", member.Id, this.AccountSession.MemberId), ex);

                    return(CreateErrorResponse(ex));
                }
            }

            // invalid parameters, generate response
            return(CreateInvalidResponse(modelValidation));
        }
Ejemplo n.º 2
0
        public void UpdateIdentity(ConsumerMember member)
        {
            var identity = this.Identities.Where(item => item.UserId == member.Id).FirstOrDefault();

            if (identity != null)
            {
                identity.PortfolioId = member.PortfolioId;
                identity.PortfolioIds.Clear();
                identity.PortfolioIds.AddRange(member.PortfolioIds);
            }
        }
Ejemplo n.º 3
0
 public void ConsumerPortfolioCreated(ConsumerMember member, ConsumerPortfolio consumerPortfolio)
 {
     // update the consumer hub identity
     this.ConsumerHub.UpdateIdentity(member);
 }
Ejemplo n.º 4
0
 public void ConsumerMemberCreated(ConsumerMember member)
 {
     // send out mail notifications
     this.Mailer.ConsumerMemberCreated(member);
 }
Ejemplo n.º 5
0
        private void SendUpdatedReponse(Response response, ProviderPortfolio providerPortfolio, ConsumerPortfolio consumerPortfolio, ConsumerMember consumerMember = null)
        {
            // notify all interested consumers that the response has been updated
            this.ConsumerHub.ResponseUpdated(response, consumerPortfolio, providerPortfolio);

            // notify all interested providers that the response has been updated
            this.ProviderHub.ResponseUpdated(response, consumerPortfolio, providerPortfolio);
        }
Ejemplo n.º 6
0
        public void ResponseUpdatedAsUserAccepted(Response response, ProviderPortfolio providerPortfolio, ConsumerPortfolio consumerPortfolio, ConsumerMember consumerMember)
        {
            // notify all interested parties that the response has been set to accepted
            SendUpdatedReponse(response, providerPortfolio, consumerPortfolio, consumerMember);

            // send out mail notifications
            this.Mailer.ResponseUpdatedAsUserAccepted(response, consumerPortfolio, providerPortfolio);
        }
Ejemplo n.º 7
0
 public void ConsumerMemberCreated(ConsumerMember member)
 {
 }