Ejemplo n.º 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);
        }
Ejemplo n.º 2
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)));
        }