public void BindData() { totalScore = 0; List <Sort> sorts = topicBll.GetTopiciSort(); List <ExamSort> temp_sort = new List <ExamSort>(); foreach (var item in sorts) { int maxNumber = topicBll.GetNumberOfTopicBySort(item.SortId.ToString()); ExamSort examSort = new ExamSort() { SortId = item.SortId, SortName = item.SortName, TopicSortScore = item.TopicSortScore, TopicSortNumber = item.TopicSortNumber, CanUseNumber = maxNumber }; temp_sort.Add(examSort); totalScore += int.Parse((examSort.TopicSortNumber * examSort.TopicSortScore).ToString()); } examSorts = temp_sort; }