private Dictionary <int, int> GenerateScoreByFeature(Feedback feedback) { Dictionary <int, int> ScoreByFeature = new Dictionary <int, int>(); ScoresServices scoreService = new ScoresServices(); foreach (Feature feature in new FeaturesServices().GetAllRecords()) { int score = scoreService.GetScoreValueByFeedbackAndFeature(feedback.Id, feature.Id); if (score != 0) { ScoreByFeature.Add(feature.Id, score); } } return(ScoreByFeature); }
private Dictionary <int, List <int> > GenerateScoreAverageByFeature(int type_id) { Dictionary <int, List <int> > ScoreByFeature = new Dictionary <int, List <int> >(); ScoresServices scoreService = new ScoresServices(); foreach (Feature feature in new FeaturesServices().GetFeaturesByType(type_id)) { List <int> score = scoreService.GetScoresByFeature(feature.Id); if (score != null) { ScoreByFeature.Add(feature.Id, score); } } return(ScoreByFeature); }
public JsonResult GetOptionsList() { List <object> options = new List <object>(); ScoresServices scoreService = new ScoresServices(); foreach (var option in scoreService.GetAllOptionsForDropDownList()) { options.Add( new { optionValue = option.Key, optionDisplay = option.Value, }); } return(Json(options)); }
private void InsertScoresByFeature(FormCollection collection, int feedback_id) { ScoresServices scoreService = new ScoresServices(); foreach (Feature feature in new FeaturesServices().GetAllRecords()) { string featureInFeedback = collection[feature.Id.ToString()]; if (featureInFeedback != "" && featureInFeedback != null) { Score score = new Score(); score.Feedback_Id = feedback_id; score.Value = Int32.Parse(featureInFeedback); score.Feature_Id = feature.Id; score.CreationDate = DateTime.Now; scoreService.Add(score); } } }