private List <ScoreBranch> GetClassScore(IdentUnit Klasa, List <IdentUnit> lstPrzedmiot) { List <ScoreBranch> ClassScore = new List <ScoreBranch>(); List <SchoolStudent> lstFilteredStudent = new List <SchoolStudent>(); switch (cbSeek.SelectedIndex) { case 0: lstFilteredStudent = lstStudent.Where(x => x.StudentClass.ID == Klasa.ID).Where(x => x.ActivationStatus == true).ToList(); break; case 1: lstFilteredStudent = lstStudent.Where(x => x.StudentClass.ID == Klasa.ID).Where(x => x.ActivationStatus == true).Where(x => x.Student.Name.StartsWith(txtSeek.Text, StringComparison.CurrentCultureIgnoreCase)).ToList(); break; } pbrStudent.Maximum = lstFilteredStudent.Count; pbrStudent.Value = 0; lblStudent.Text = ""; foreach (var FS in lstFilteredStudent.OrderBy(x => x.Student.Name)) { var StudentNode = new ScoreBranch(); StudentNode.Level = 1; StudentNode.Label = FS.Student.Name; StudentNode.Children = GetStudentScore(Klasa, FS.Student.ID, lstPrzedmiot); StudentNode.Children.ForEach(x => StudentNode.Score.AddRange(x.Score)); pbrStudent.Value++; lblStudent.Text = pbrStudent.Value.ToString() + "/" + pbrStudent.Maximum; Refresh(); ClassScore.Add(StudentNode); } return(ClassScore); }
private List <ScoreBranch> GetScoreTree() { List <ScoreBranch> ScoreTree = new List <ScoreBranch>(); pbrKlasa.Maximum = lstKlasa.ToList().Count; pbrKlasa.Value = 0; lblKlasa.Text = ""; //int Index = -1; foreach (var K in lstKlasa) { var lstSubjectByClass = lstPrzedmiot.Where(x => x.Subject.SubjectType != "Z" & x.ClassID == K.ID).OrderBy(x => x.Subject.SubjectPriority).Select(x => new { x.Subject.SubjectID, x.Subject.SubjectName }).Distinct().ToList().Select(x => new IdentUnit { ID = x.SubjectID, Name = x.SubjectName }).ToList(); var ClassNode = new ScoreBranch(); ClassNode.Level = 0; //ClassNode.Index = ++Index; ClassNode.Label = K.Name; ClassNode.Children = GetClassScore(K, lstSubjectByClass); //ClassNode.Children.ForEach(x => ClassNode.Score.AddRange(x.Score)); ClassNode.ScoreCount = ClassNode.Children.Sum(x => x.ScoreCount); pbrKlasa.Value++; lblKlasa.Text = pbrKlasa.Value.ToString() + "/" + pbrKlasa.Maximum; Refresh(); ScoreTree.Add(ClassNode); } return(ScoreTree); }
private List <ScoreBranch> GetStudentScore(IdentUnit Klasa, int StudentID, List <IdentUnit> lstPrzedmiot) { List <ScoreBranch> StudentScore = new List <ScoreBranch>(); foreach (var P in lstPrzedmiot) { var SubjectScore = new ScoreBranch(); SubjectScore.Label = P.Name; SubjectScore.Level = 2; SubjectScore.Score = lstWynik.Where(x => x.StudentID == StudentID).Where(x => x.ScoreSubject.SubjectInfo.Subject.SubjectID == P.ID).Select(x => x).ToList(); StudentScore.Add(SubjectScore); } return(StudentScore); }
private void PrintModelObjectData(ScoreBranch Node, float x, ref float y, List <TableCell> Kolumna, Font PrintFont, float LineHeight, int TabIndent = 0, bool FillBackground = false) { List <string> AspectToPrint = new List <string>(); AspectToPrint.Add(Node.Label); AspectToPrint.Add(Node.ScoreCount.ToString()); AspectToPrint.Add(Node.ScoreList); for (int i = 0; i < AspectToPrint.Count; i++) { PH.DrawText(AspectToPrint[i], PrintFont, i == 0 ? x + TabIndent : x, y, i == 0 ? Kolumna[i].Size - TabIndent : Kolumna[i].Size, LineHeight, i == 1 ? StringAlignment.Center : StringAlignment.Near, Brushes.Black, true, false, FillBackground); x += Kolumna[i].Size; } y += LineHeight; }
private void PrintModelObjectData(ScoreBranch Node, float x, ref float y, List <TableCell> Kolumna, Font PrintFont, float LineHeight, int TabIndent = 0, bool FillBackground = false) { List <string> AspectToPrint = new List <string>(); AspectToPrint.Add(Node.Label); AspectToPrint.Add(Node.ScoreCount.ToString()); AspectToPrint.Add(Node.ScoreAvg.ToString()); AspectToPrint.Add(Node.ScoreMedian.ToString()); AspectToPrint.Add(Node.ScoreMin.ToString()); AspectToPrint.Add(Node.ScoreMax.ToString()); AspectToPrint.Add(Node.ScoreDominant.ToString()); PH.DrawText(Node.Label, PrintFont, x + TabIndent, y, Kolumna[0].Size - TabIndent, LineHeight, 0, Brushes.Black, true, false, FillBackground); x += Kolumna[0].Size; for (int i = 1; i < AspectToPrint.Count; i++) { PH.DrawText(AspectToPrint[i], PrintFont, x, y, Kolumna[i].Size, LineHeight, StringAlignment.Center, Brushes.Black, true, false, FillBackground); x += Kolumna[i].Size; } y += LineHeight; }