示例#1
0
 public void SaveQuestionRating(long questionID, int selectedRating)
 {
     //int selcetedRating = int.Parse(rdoRating.SelectedValue);
     QuestionsManager questionManager = new QuestionsManager();
     Questions question = questionManager.Get(questionID);
     if (question != null)
     {
         question.RateTotal += selectedRating;
         question.RateCount++;
         question.Rating = (float)question.RateTotal / (float)question.RateCount;
         questionManager.SaveOrUpdate(question);
     }
 }