コード例 #1
0
ファイル: VotingCardHelper.cs プロジェクト: longtduc/sh
        public static VotingCardDto ToVotingCardDto(VotingCard votingCard)
        {
            var votingCardDto = new VotingCardDto()
            {
                Id                 = votingCard.Id,
                IsInvalid          = votingCard.IsInvalid,
                AmtAlreadyVoted    = votingCard.AmtAlreadyVoted,
                IsVoted            = votingCard.IsVoted,
                NumberOfCandidates = votingCard.NumberOfCandidates,
                ShareHolderId      = votingCard.ShareHolderId,
                NumberOfShares     = votingCard.NumberOfShares,
                VotingCardType     = votingCard.VotingCardType,
                VotingCardLines    = new List <VotingCardLineDto>()
            };

            foreach (var item in votingCard.VotingCardLines)
            {
                var lineDto = new VotingCardLineDto()
                {
                    Id            = item.Id,
                    CandidateId   = item.CandidateId,
                    CandidateName = item.CandidateName,
                    VotingAmt     = item.VotingAmt,
                    VotingCardId  = item.VotingCardId
                };
                votingCardDto.VotingCardLines.Add(lineDto);
            }

            return(votingCardDto);
        }
コード例 #2
0
ファイル: ShareHolder.cs プロジェクト: longtduc/sh
        public void AddVotingCard(VotingCard votingCard)
        {
            if (votingCard == null)
            {
                throw new ArgumentNullException();
            }

            VotingCards.Add(votingCard);
        }