public void Update(ConsumerMember member)
        {
            // update all values
            this.Email     = member.Email.Scrub();
            this.FirstName = member.FirstName.Scrub();
            this.LastName  = member.LastName.Scrub();
            this.Phone     = member.Phone.Scrub();

            // update the address
            this.Address.Update(member.Address);
        }
        private ConsumerMember GetConsumerMember(Response response, ConsumerMember consumerMember)
        {
            var member = new ConsumerMember();

            if (response.Current.IsAccepted && consumerMember != null)
            {
                // only return specific properties
                member.FirstName = consumerMember.FirstName;
                member.LastName  = consumerMember.LastName;
                member.Email     = consumerMember.Email;
                member.Phone     = consumerMember.Phone;
            }

            return(member);
        }
        public bool HasChanged(ConsumerMember member)
        {
            if (this.Address.HasChanged(member.Address))
            {
                return(true);
            }

            if (this.Email != member.Email.Scrub() ||
                this.FirstName != member.FirstName.Scrub() ||
                this.LastName != member.LastName.Scrub() ||
                this.Phone != member.Phone.Scrub())
            {
                return(true);
            }

            return(false);
        }
        public ProviderResponseScheme(Response response, ProviderPortfolio providerPortfolio, ConsumerPortfolio consumerPortfolio, ConsumerMember consumerMember = null)
        {
            this.Id = response.Id;
            this.ConsumerPortfolioId = response.ConsumerPortfolioId;
            this.ProviderPortfolioId = response.ProviderPortfolioId;

            this.Distance    = response.Distance;
            this.Quote       = response.Quote;
            this.DepositDue  = response.DepositDue;
            this.DepositPaid = response.DepositPaid;
            this.BalanceDue  = response.BalanceDue;
            this.BalancePaid = response.BalancePaid;

            this.Agreement = response.Agreement;
            this.Alternate = response.Alternate;

            this.Created = response.Created;
            this.Current = response.Current;
            this.Pending = response.Pending;

            this.Member     = GetConsumerMember(response, consumerMember);                                           // only show if winning bidder
            this.Principal  = (response.Current.IsAccepted ? consumerPortfolio.Principal : new ConsumerPrincipal()); // only show if winning bidder
            this.Preference = consumerPortfolio.Preference.Clone();
            this.Schedule   = consumerPortfolio.Schedule.Clone();
            this.Request    = consumerPortfolio.Request;

            this.CanBecomeAvailable = response.CanBecomeAvailable;
            this.CanBecomePending   = response.CanBecomePending;
            this.CanBecomeDismissed = response.CanBecomeDismissed;
        }
 public void Update(ConsumerMember member)
 {
     this.ConsumerMembers.Save(member);
 }