public decimal CalculateReting() { comment.FeedbackQuestions = comment.SelectFeedbackQuestions(); comment.FeedbackQuestions.Find(a => a.QuestionId == 8).RatingValue = ASPxRatingRent.Value; comment.FeedbackQuestions.Find(a => a.QuestionId == 9).RatingValue = ASPxRatingAmenities.Value; comment.FeedbackQuestions.Find(a => a.QuestionId == 10).RatingValue = ASPxRatingcondition.Value; comment.FeedbackQuestions.Find(a => a.QuestionId == 11).RatingValue = ASPxRatingBackYard.Value; comment.FeedbackQuestions.Find(a => a.QuestionId == 12).RatingValue = ASPxRatingResponsiveOfLandlord.Value; comment.FeedbackQuestions.Find(a => a.QuestionId == 13).RatingValue = ASPxRatingLocation.Value; comment.FeedbackQuestions.Find(a => a.QuestionId == 14).RatingValue = ASPxRatingFairnessOfLandlord.Value; comment.FeedbackQuestions.Find(a => a.QuestionId == 15).RatingValue = ASPxRatingGoodLandlord.Value; string AccessCode = Utility.GetQueryStringValueByKey(Request, "AccessCode"); Guid.Parse(AccessCode); //Get automatic ratings //Todo: The below code has to be rewritten to get the correct rating values. comment.FeedbackQuestions.Find(a => a.QuestionId == 16).RatingValue = comment.GetAutomaticRentRatingByLandlord(Guid.Parse(AccessCode)); comment.FeedbackQuestions.Find(a => a.QuestionId == 17).RatingValue = comment.GetAutomaticAmenitiesRatingByLandlord(Guid.Parse(AccessCode)); decimal ratevalue = 0; //Rating system for the Students by other roommates ratevalue = comment.CalculateLandlordFeedback(Guid.Parse(AccessCode)); return(ratevalue); }