예제 #1
0
        private static Nomination LoadQuarterlyAwardsNominationFromSurveyExport(Row row, int rowNumber)
        {
            var isAnonymousNominator            = row[10] != @"Display My Name (Recommended)";
            var nominatorName                   = PersonName.CreateForNominator(row[9], isAnonymousNominator);
            var nomineeName                     = PersonName.Create(row[12]);
            var awardType                       = AwardType.FindByAwardName(row[13]);
            var nomineeOfficeLocation           = OfficeLocation.FindByName(row[15]);
            var hasContinuouslyImproving        = !string.IsNullOrWhiteSpace(row[16]);
            var hasDrivingInnovation            = !string.IsNullOrWhiteSpace(row[17]);
            var hasDelightingCustomers          = !string.IsNullOrWhiteSpace(row[18]);
            var hasBehavingWithIntegrity        = !string.IsNullOrWhiteSpace(row[19]);
            var hasDeliveringMeaningfulOutcomes = !string.IsNullOrWhiteSpace(row[20]);
            var hasStreamingGood                = !string.IsNullOrWhiteSpace(row[21]);
            var writeUp        = NominationWriteUp.Create(nomineeName, row[22]);
            var writeUpSummary = NominationWriteUpSummary.Create(row[24]);

            var companyValues = GetCompanyValues(hasContinuouslyImproving, hasDrivingInnovation, hasDelightingCustomers,
                                                 hasBehavingWithIntegrity, hasDeliveringMeaningfulOutcomes, hasStreamingGood);

            var nominee = Person.Create(nomineeName, nomineeOfficeLocation, nomineeName.DerivedEmailAddress);

            var nomination = new Nomination(rowNumber, NomineeVotingIdentifier.Unknown, nominee, awardType,
                                            nominatorName, companyValues, writeUp, writeUpSummary);

            return(nomination);
        }
예제 #2
0
 internal Nomination(int id, NomineeVotingIdentifier votingIdentifier, Person nominee,
                     AwardType nomineeAwardType, PersonName nominatorName, IEnumerable <CompanyValue> companyValues,
                     NominationWriteUp writeUp, NominationWriteUpSummary writeUpSummary)
     : base(id)
 {
     VotingIdentifier = votingIdentifier;
     Nominee          = nominee ?? throw new ArgumentNullException(nameof(nominee));
     AwardType        = nomineeAwardType ?? throw new ArgumentNullException(nameof(nomineeAwardType));
     NominatorName    = nominatorName ?? throw new ArgumentNullException(nameof(nominatorName));
     CompanyValues    = companyValues?.ToList() ?? new List <CompanyValue>();
     WriteUp          = writeUp;
     WriteUpSummary   = writeUpSummary;
 }
예제 #3
0
        internal Nomination ToNomination()
        {
            var nominee = Person.Create(PersonName.Create(NomineeName),
                                        OfficeLocation.FindByName(NomineeOfficeLocation),
                                        EmailAddress.Create(NomineeEmailAddress));

            var companyValues = (CompanyValues ?? Enumerable.Empty <string>())
                                .Select(CompanyValue.FindByValue)
                                .ToList();

            return(new Nomination(Id,
                                  NomineeVotingIdentifier.Unknown,
                                  nominee,
                                  ValueObjects.AwardType.FindByAwardName(AwardType),
                                  PersonName.CreateForNominator(NominatorName, IsNominatorAnonymous),
                                  companyValues,
                                  NominationWriteUp.Create(nominee.Name, WriteUp),
                                  NominationWriteUpSummary.Create(WriteUpSummary)));
        }