// BL.BLimp bl; #region Report Functions public void AddReport(Report report) { try { dal.AddReport(report); //Add a link between report and assessment List <Assessment> possible = (from a in GetAllAassessments() where a.start <= report.time && a.end >= report.time select a).ToList(); Assessment asses; if (possible.Count() == 0) { asses = new Assessment(report); AddAssessment(asses); //GetAllAassessments().Last().reports.Add(report); } else//(possible.Count() == 1) { asses = possible[0]; possible[0].reports.Add(report); } //update Kmeans UpdateAssessment(asses); } catch (Exception ex) { MessageBox.Show(ex.Message); } }