Пример #1
0
        private Cat UpdateUpperSection(IScoreCard scoreCard, List <Die> dice)
        {
            int commonValue;

            int[] values = new int [5];

            for (int i = 0; i < values.Count(); i++)
            {
                values[i] = dice[i].Value;
            }

            commonValue = values.GroupBy(v => v)
                          .OrderByDescending(g => g.Count())
                          .First()
                          .Key;

            var iterableCats = scoreCard.GetCategories();

            foreach (Category c in iterableCats)
            {
                if ((c.UpperValue == commonValue) && !scoreCard.IsUsed(c.CatType))
                {
                    return(c.CatType);
                }
            }

            return(Cat.NoCategory);
        }
Пример #2
0
        public IList <IScoreCard> GetScoreCard(string employeeId, string competencyId, out IList <CodeMessage> messages)
        {
            using (new OperationContextScope((IContextChannel)_smsEndPointClient.InnerChannel))
            {
                if (ServiceHeaders != null)
                {
                    OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = Utility.SetMessageProperty(ServiceHeaders);
                }
            }

            SmsService.GetScoreCardResponse response = _smsEndPointClient.getScoreCard(new SmsService.getScoreCardRequest()
            {
                employeeId = long.Parse(employeeId), competencyId = long.Parse(competencyId)
            });

            IList <IScoreCard> listReturn = new List <IScoreCard>();

            if (Utility.ResolveCodeMessage(DataIntegrationMapper.ToGenericResponse(response), out messages))
            {
                foreach (SmsService.scoreCardViewDto scoreCard in response.scoreCards)
                {
                    IScoreCard scoreCardEntity = Helper.Translator.BaseToEntity <ScoreCard>(DataIntegrationMapper.ToServiceLookup <SmsService.scoreCardViewDto>(scoreCard));
                    scoreCardEntity.CompetencyGroupId          = scoreCard.competencyGroupId.ToString();
                    scoreCardEntity.CompetencyGroupIdSpecified = scoreCard.competencyGroupIdSpecified;
                    scoreCardEntity.CompetencyId                        = scoreCard.competencyId.ToString();
                    scoreCardEntity.CompetencyIdSpecified               = scoreCard.competencyIdSpecified;
                    scoreCardEntity.EmployeeId                          = scoreCard.employeeId.ToString();
                    scoreCardEntity.EmployeeIdSpecified                 = scoreCard.employeeIdSpecified;
                    scoreCardEntity.ScoreLevel                          = scoreCard.scoreLevel.ToString();
                    scoreCardEntity.ScoreLevelSpecified                 = scoreCard.scoreLevelSpecified;
                    scoreCardEntity.TechnologyKnowledgeGroupId          = scoreCard.technologyKnowledgeGroupId.ToString();
                    scoreCardEntity.TechnologyKnowledgeGroupIdSpecified = scoreCard.technologyKnowledgeDetailIdSpecified;
                    scoreCardEntity.TechnologyKnowlegeDetailId          = scoreCard.technologyKnowledgeDetailId.ToString();
                    scoreCardEntity.TechnologyKnowlegeDetailIdSpecified = scoreCard.technologyKnowledgeDetailIdSpecified;
                    scoreCardEntity.Year          = scoreCard.year.ToString();
                    scoreCardEntity.YearSpecified = scoreCard.yearSpecified;

                    if (scoreCard.personIdSpecified)
                    {
                        scoreCardEntity.PersonId     = scoreCard.personId.ToString();
                        scoreCardEntity.PersonObject = new Person()
                        {
                            PersonId  = scoreCard.personId.ToString(),
                            FirstName = scoreCard.firstName,
                            LastName  = scoreCard.lastName
                        };
                    }

                    listReturn.Add(scoreCardEntity);
                }
            }

            return(listReturn);
        }
Пример #3
0
 public Bowling(string playerName)
 {
     _playerScores = new ScoreCard(playerName);
 }