コード例 #1
0
ファイル: Notenbogen.cs プロジェクト: FOSBOS/diNo
        // schreibt eine Schnittkonstellation ins Grid
        private void InsertSchnitt(int startCol, int startRow, BerechneteNote b)
        {
            if (b != null)
              {
            if (b.SchnittSchulaufgaben != null)
            {
              var cell = dataGridNoten.Rows[startRow].Cells[startCol];
              cell.Value = b.SchnittSchulaufgaben;
            }

            if (b.SchnittMuendlich != null)
            {
              dataGridNoten.Rows[startRow + 1].Cells[startCol].Value = b.SchnittMuendlich;
            }

            if (b.JahresfortgangMitKomma != null)
            {
              dataGridNoten.Rows[startRow + 1].Cells[startCol + 1].Value = b.JahresfortgangMitKomma;
              if ((b.ErstesHalbjahr && Zugriff.Instance.aktZeitpunkt <= 2) || (!b.ErstesHalbjahr && Zugriff.Instance.aktZeitpunkt == 3))
              {
            SetBackgroundColor((double)b.JahresfortgangMitKomma, dataGridNoten.Rows[startRow + 1].Cells[startCol + 1]);
              }
            }

            if (b.JahresfortgangGanzzahlig != null)
            {
              dataGridNoten.Rows[startRow].Cells[startCol + 1].Value = b.JahresfortgangGanzzahlig;
              if ((b.ErstesHalbjahr && Zugriff.Instance.aktZeitpunkt <= 2) || (!b.ErstesHalbjahr && Zugriff.Instance.aktZeitpunkt == 3))
              {
            SetBackgroundColor((double)b.JahresfortgangGanzzahlig, dataGridNoten.Rows[startRow].Cells[startCol + 1]);
              }
            }
              }
        }
コード例 #2
0
        /// <summary>
        /// Methode importiert die Zeugnisnoten des Vorjahres.
        /// </summary>
        /// <param name="fileName">Der Dateiname.</param>
        public static void ImportiereNoten(string fileName)
        {
            using (FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read))
              using (StreamReader reader = new StreamReader(stream))
              {
            var schuelerAdapter = new SchuelerTableAdapter();
            var fpaAdapter = new FpANotenTableAdapter();
            Dictionary<string, Kurs> kurse = GetKursverzeichnis();
            kurse.Add("G", GetGeschichteKurs());

            while (!reader.EndOfStream)
            {
              string[] line = reader.ReadLine().Split(SeparatorChar);
              int schuelerId = int.Parse(line[0]);
              var schuelerGefunden = schuelerAdapter.GetDataById(schuelerId);
              if (schuelerGefunden == null || schuelerGefunden.Count == 0)
              {
            continue;
              }

              var schueler = new Schueler(schuelerGefunden[0]);
              if (schueler.getKlasse.Jahrgangsstufe == Jahrgangsstufe.Zwoelf)
              {
            // nur bei Schülern in der zwölften Klasse wird irgendetwas importiert
            if (line.Length == 5)
            {
              //notenzeile
              string nachname = line[1];
              string fachKuerzel = line[2];
              string lehrerKuerzel = line[3];

              if (string.IsNullOrEmpty(line[4])) // was das heißt ist aber auch fraglich. keine Note?
              {
                continue;
              }

              byte zeugnisnote = byte.Parse(line[4]);

              if (schueler.getKlasse.Jahrgangsstufe == Jahrgangsstufe.Zwoelf)
              {
                schueler.MeldeAn(kurse[fachKuerzel.ToUpper()]);
                BerechneteNote bnote = new BerechneteNote(kurse[fachKuerzel.ToUpper()].Id, schueler.Id);
                bnote.ErstesHalbjahr = false;
                bnote.JahresfortgangGanzzahlig = zeugnisnote;
                bnote.Abschlusszeugnis = zeugnisnote;
                bnote.writeToDB();
              }
            }
            else if (line.Length == 3)
            {
              //FpA-Zeile
              string nachname = line[1];
              int gesamterfolg = int.Parse(line[2]);
              fpaAdapter.Insert(schuelerId, "", null, null, null, null, gesamterfolg, null, null);
            }
            else
              throw new InvalidOperationException("Diese Zeile hat " + line.Length + " Spalten. Das ist mir unbekannt");
              }
            }
              }

              TrageFehlendeSchülerInDummykurseEin();
        }
コード例 #3
0
ファイル: Notenbogen.cs プロジェクト: TheTypoMaster/diNo
 // schreibt eine Schnittkonstellation ins Grid
 private void InsertSchnitt(int startCol, int startRow, BerechneteNote b)
 {
     if (b != null)
     {
     if (b.SchnittSchulaufgaben != null)
         dataGridNoten.Rows[startRow].Cells[startCol].Value = b.SchnittSchulaufgaben;
     dataGridNoten.Rows[startRow + 1].Cells[startCol].Value = b.SchnittMuendlich;
     dataGridNoten.Rows[startRow + 1].Cells[startCol + 1].Value = b.JahresfortgangMitKomma;
     dataGridNoten.Rows[startRow].Cells[startCol + 1].Value = b.JahresfortgangGanzzahlig;
     }
 }
コード例 #4
0
 private static void TrageNoteEin(Kurs kurs, byte note, Schueler schueler)
 {
     schueler.MeldeAn(kurs);
       BerechneteNote bnote = new BerechneteNote(kurs.Id, schueler.Id);
       bnote.ErstesHalbjahr = false;
       bnote.JahresfortgangGanzzahlig = note;
       bnote.Abschlusszeugnis = note;
       bnote.writeToDB();
 }
コード例 #5
0
        /// <summary>
        /// Trägt die Noten eines Schülers aus Excel in die Datenbank ein.
        /// </summary>
        private void UebertrageNoten()
        {
            int i = CellConstant.ZeileErsterSchueler;
              int indexAP = CellConstant.APZeileErsterSchueler;

              foreach (int sid in sidList)
              {
            for (Halbjahr hj = Halbjahr.Erstes; hj <= Halbjahr.Zweites; hj++)
            {
              foreach (Notentyp typ in Enum.GetValues(typeof(Notentyp)))
              //new[] { Notentyp.Schulaufgabe, Notentyp.Ex, Notentyp.EchteMuendliche,
              //           Notentyp.Fachreferat, Notentyp.Ersatzprüfung, Notentyp.APSchriftlich, Notentyp.APMuendlich })
              {
            string[] zellen = CellConstant.getLNWZelle(typ, hj, i);
            foreach (string zelle in zellen)
            {
              byte? p = xls.ReadNote(typ, zelle);
              if (p != null)
              {
                Note note = new Note(kurs.Id, sid);
                note.Halbjahr = hj;
                note.Typ = typ;
                note.Zelle = zelle;
                note.Punktwert = (byte)p;
                note.writeToDB();
              }
            }
              }

              BerechneteNote bnote = new BerechneteNote(kurs.Id, sid);
              bnote.ErstesHalbjahr = (hj == Halbjahr.Erstes);
              bnote.SchnittSchulaufgaben = xls.ReadSchnitt(BerechneteNotentyp.SchnittSA, hj, i);
              bnote.SchnittMuendlich = xls.ReadSchnitt(BerechneteNotentyp.Schnittmuendlich, hj, i);
              bnote.JahresfortgangMitKomma = xls.ReadSchnitt(BerechneteNotentyp.JahresfortgangMitNKS, hj, i);
              bnote.JahresfortgangGanzzahlig = xls.ReadSchnittGanzzahlig(BerechneteNotentyp.Jahresfortgang, hj, i);
              bnote.PruefungGesamt = xls.ReadSchnitt(BerechneteNotentyp.APGesamt, hj, indexAP);
              bnote.SchnittFortgangUndPruefung = xls.ReadSchnitt(BerechneteNotentyp.EndnoteMitNKS, hj, indexAP);
              bnote.Abschlusszeugnis = xls.ReadSchnittGanzzahlig(BerechneteNotentyp.Abschlusszeugnis, hj, indexAP);
              // Erst wenn JF feststeht, wird diese Schnittkonstellation gespeichert
              if (bnote.JahresfortgangGanzzahlig != null)
            bnote.writeToDB();
            }
            i += 2;
            indexAP++;
              }
        }