コード例 #1
0
        public static ValuationScoreCardViewModel ToValuationScoreCardViewModel(this ValuationScoreCard scoreCard)
        {
            Requires.NotNull(scoreCard, "scoreCard");

            return(new ValuationScoreCardViewModel
            {
                Id = scoreCard.JournalId,
                Remarks = scoreCard.Remarks,
                Submitted = scoreCard.Submitted,
                Editor = scoreCard.Editor,
                Journal = scoreCard.Journal.ToViewModel(),
                State = scoreCard.State,
                QuestionScores = scoreCard.QuestionScores.Select(ToViewModel).ToList()
            });
        }
コード例 #2
0
        public void UpdateScoreCard(ValuationScoreCard scoreCard, TimeSpan scoreCardLifeTime)
        {
            foreach (var questionScore in scoreCard.QuestionScores)
            {
                questionScore.Score = this.QuestionScores.First(q => q.Id == questionScore.Id).Score;
            }

            scoreCard.Score     = new ValuationScoreCardScore(scoreCard.QuestionScores);
            scoreCard.Remarks   = this.Remarks;
            scoreCard.Submitted = this.Submitted;
            scoreCard.Editor    = this.Editor;

            if (this.Publish)
            {
                scoreCard.State          = ScoreCardState.Published;
                scoreCard.DatePublished  = DateTime.Now;
                scoreCard.DateExpiration = DateTime.Now + scoreCardLifeTime;
            }
        }
コード例 #3
0
 private ValuationJournalPrice CreateNewValuationJournalPrice(ValuationScoreCard scoreCard)
 {
     return(new ValuationJournalPrice {
         ValuationScoreCardId = scoreCard.Id, JournalId = scoreCard.JournalId, UserProfileId = this.Authentication.CurrentUserId
     });
 }