Beispiel #1
0
        public Letter(Legislator legislator) : this()
        {
            if (legislator == null)
            {
                return;
            }

            Recipient = legislator;

            RecipientEmail = legislator.Email.IsEmpty
                ? string.Empty
                : legislator.Email.ContactInfo;

            Body = string.Format("Dear {0},{1}{1}",
                                 legislator.FormalAddressTitle(),
                                 Environment.NewLine);
        }
        public static Legislator TranformToLegislator(ILegislator legislitor)
        {
            var newLegislator = new Legislator()
            {
                IdBioguide            = legislitor.IdBioguide,
                Birthday              = legislitor.Birthday,
                Chamber               = legislitor.Chamber,
                ContactSite           = legislitor.ContactSite,
                Email                 = legislitor.Email,
                FacebookId            = legislitor.FacebookId,
                FirstName             = legislitor.FirstName,
                Gender                = legislitor.Gender,
                LastName              = legislitor.LastName,
                MiddleName            = legislitor.MiddleName,
                MissedVotesPercent    = legislitor.MissedVotesPercent,
                OfficeAddress         = legislitor.OfficeAddress,
                OfficeNumber          = legislitor.OfficeNumber,
                Party                 = legislitor.Party,
                Senority              = legislitor.Senority,
                State                 = legislitor.State,
                TermEndDate           = legislitor.TermEndDate,
                TermStartDate         = legislitor.TermStartDate,
                TotalVotes            = legislitor.TotalVotes,
                TwitterId             = legislitor.TwitterId,
                VotesWithPartyPercent = legislitor.VotesWithPartyPercent,
                Website               = legislitor.Website,
                YouTubeId             = legislitor.YouTubeId,

                IdGovTrack    = legislitor.IdGovTrack,
                IdThomas      = legislitor.IdThomas,
                IdVoteSmart   = legislitor.IdVoteSmart,
                IdOpenSecrets = legislitor.IdOpenSecrets
            };

            return(newLegislator);
        }