/// <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 }
// erzeugt einen grammatikalisch korrekten Satz, je nach Anzahl der LNWs // Leerzeichen werden vorne und hinten angefügt. protected string toText(int z, string adjektiv="", string substantiv="", Halbjahr hj=Halbjahr.Ohne) { string res = (hj==Halbjahr.Zweites) ? "Im 2. Halbjahr" : "Es"; if (adjektiv!="") { if (z==0) adjektiv+="n "; // mündlichen else adjektiv +=" "; // mündliche } if (substantiv!="") { if (z==1) substantiv+=" "; // Note else substantiv +="n "; // Noten } if (z==0) res += " sind keine "+adjektiv+substantiv; else if (z==1) res += " ist nur eine "+adjektiv+substantiv; else res += " sind nur " + z + " " +adjektiv+substantiv; res += "vorhanden."; return res; }
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??? }
/// <summary> /// Liefert eine druckbare Liste für alle sonstigen Leistungen /// </summary> public IList<string> sonstigeLeistungen(Halbjahr hj) { IList<string> liste = new List<string>(); InsertNoten(liste, getNoten(hj, Notentyp.Kurzarbeit), "K"); InsertNoten(liste, getNoten(hj, Notentyp.Ex), ""); InsertNoten(liste, getNoten(hj, Notentyp.EchteMuendliche), ""); InsertNoten(liste, getNoten(hj, Notentyp.Fachreferat), "F"); InsertNoten(liste, getNoten(hj, Notentyp.Ersatzprüfung), "E"); return liste; }
/// <summary> /// Liefert die Notenschnitte /// </summary> public BerechneteNote getSchnitt(Halbjahr hj) { var s = schnitte[(int)hj]; if (s==null) return new BerechneteNote(kursId,schuelerId); // gibt leere Berechnungstabelle zurück return s; }
private int getAnzahlBenoetigterSpalten(Halbjahr hj, FachSchuelerNoten noten) { return noten.getNoten(hj, Notentyp.EchteMuendliche).Count + noten.getNoten(hj, Notentyp.Ersatzprüfung).Count + noten.getNoten(hj, Notentyp.Ex).Count + noten.getNoten(hj, Notentyp.Fachreferat).Count + noten.getNoten(hj, Notentyp.Kurzarbeit).Count; }
public byte? ReadSchnittGanzzahlig(BerechneteNotentyp typ, Halbjahr hj, int zeile) { string zelle = CellConstant.getSchnittZelle(typ, hj, zeile); if (zelle == null) return null; string v; if (typ == BerechneteNotentyp.Abschlusszeugnis) v = ReadValue(AP, zelle); else v = ReadValue(notenbogen, zelle); return !string.IsNullOrEmpty(v) ? Convert.ToByte(v, CultureInfo.CurrentUICulture) : (byte?)null; }
public decimal? ReadSchnitt(BerechneteNotentyp typ, Halbjahr hj, int zeile) { string zelle = CellConstant.getSchnittZelle(typ, hj, zeile); if (zelle == null) return null; string v; if (typ == BerechneteNotentyp.APGesamt) v = ReadValue(AP, zelle); else v = ReadValue(notenbogen, zelle); return !string.IsNullOrEmpty(v) ? Convert.ToDecimal(v, CultureInfo.CurrentUICulture) : (decimal?)null; }
/// <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> public static string getSchnittZelle(BerechneteNotentyp typ, Halbjahr hj, int zeile) { string s=null; if (hj == Halbjahr.Erstes) { zeile++; // die meisten Noten stehen unten switch (typ) { case BerechneteNotentyp.SchnittSA: s = "M"; break; case BerechneteNotentyp.Schnittmuendlich: s = "N"; break; case BerechneteNotentyp.JahresfortgangMitNKS: s = "O"; break; case BerechneteNotentyp.Jahresfortgang: s = "O"; zeile--; break; } } if (hj == Halbjahr.Zweites) { zeile++; switch (typ) { case BerechneteNotentyp.SchnittSA: s = "Y"; break; case BerechneteNotentyp.Schnittmuendlich: s = "Z"; break; case BerechneteNotentyp.JahresfortgangMitNKS: s = "AA"; break; case BerechneteNotentyp.Jahresfortgang: s = "AA"; zeile--; break; case BerechneteNotentyp.APGesamt: s = "G"; break; case BerechneteNotentyp.Abschlusszeugnis: s ="I"; break; } } if (s != null) s = s + zeile; return s; // ggf. ein null String, falls diese Kombi nicht zulässig ist }
public decimal? ReadSchnitt(BerechneteNotentyp typ, Halbjahr hj, int zeile) { string zelle = CellConstant.getSchnittZelle(typ, hj, zeile); if (zelle == null) return null; string v; if (typ == BerechneteNotentyp.APGesamt || typ == BerechneteNotentyp.EndnoteMitNKS) v = ReadValue(AP, zelle); else v = ReadValue(notenbogen, zelle); var zahlenwert = !string.IsNullOrEmpty(v) ? Convert.ToDecimal(v, CultureInfo.CurrentUICulture) : (decimal?)null; return (zahlenwert >= 0) ? zahlenwert : (decimal?)null; // diese Zeile unterdrückt einen Fehler bei der AP Englisch. // Solange die AP noch nicht vorliegt, berechnet das Excel-Sheet in der Englisch-AP einen negativen Wert }
/// <summary> /// Liefert eine druckbare Liste für die SA /// </summary> public IList<string> SA(Halbjahr hj) { IList<string> liste = new List<string>(); InsertNoten(liste, getNoten(hj, Notentyp.Schulaufgabe), ""); return liste; }