/// <summary> /// liefert zum angegeben Notentyp und Halbjahr die Spalte im Excelsheet. Zusammen mit der Zeile (=obere Zeile) /// des Schülers wird die Zelle generiert. /// </summary> /// <param name="zeile">Zeilennummer des Schülers im Notenbogen.</param> /// <param name="zeileAP">Zeilennummer des Schülers im Abschlussprüfungsbogen.</param> public static string[] getLNWZelle(Notentyp typ, Halbjahr hj, int zeile, int zeileAP) { string[] s = new string[] { }; if (hj == Halbjahr.Erstes) { zeile++; // die meisten Noten stehen unten switch (typ) { case Notentyp.Schulaufgabe: s = new[] { "D", "E", "F" }; zeile--; break; case Notentyp.Ex: s = new[] { "D", "E", "F", "G" }; break; case Notentyp.EchteMuendliche: s = new[] { "H", "I", "J" }; break; case Notentyp.Fachreferat: s = new[] { "L" }; break; case Notentyp.Ersatzprüfung: s = new[] { "K" }; break; } } if (hj == Halbjahr.Zweites) { zeile++; switch (typ) { case Notentyp.Schulaufgabe: s = new[] { "P", "Q", "R" }; zeile--; break; case Notentyp.Ex: s = new[] { "P", "Q", "R", "S" }; break; case Notentyp.EchteMuendliche: s = new[] { "T", "U", "V" }; break; case Notentyp.Fachreferat: s = new[] { "X" }; break; case Notentyp.Ersatzprüfung: s = new[] { "W" }; break; case Notentyp.APSchriftlich: s = new[] { "E" }; break; case Notentyp.APMuendlich: s = new[] { "F" }; break; } } int nimmZeile = (typ == Notentyp.APMuendlich || typ == Notentyp.APSchriftlich) ? zeileAP : zeile; for (int i = 0; i < s.Length; i++) s[i] = s[i] + nimmZeile; // Zeilennummer an jede Spalte anhängen return s; // ggf. eine leere Liste, falls diese Kombi nicht zulässig ist }
public int getNotenanzahl(Notentyp typ) { return noten[(int)Halbjahr.Erstes, (int)typ].Count + noten[(int)Halbjahr.Zweites, (int)typ].Count; }
public int getNotenanzahl(Halbjahr hj, Notentyp typ) { return noten[(int)hj, (int)typ].Count; }
/// <summary> /// Liefert alle Noten eines Schülers in einem Fach von diesem Typ /// </summary> public IList<int> getNoten(Halbjahr hj,Notentyp typ) { return noten[(int)hj,(int)typ]; // klappt der Cast immer??? }
public byte? ReadNote(Notentyp typ, string zelle) { string v; if (typ == Notentyp.APMuendlich || typ == Notentyp.APSchriftlich) v = ReadValue(AP, zelle); else v = ReadValue(notenbogen, zelle); return !string.IsNullOrEmpty(v) ? Convert.ToByte(v, CultureInfo.CurrentUICulture) : (byte?)null; }