Beispiel #1
0
        public WidokStudenta(Student s)
        {
            this.ID              = (sbyte)s.Id_student;
            this.Imie            = s.Imie;
            this.Nazwisko        = s.Nazwisko;
            this.Email           = s.Email;
            this.NrAlbumu        = s.NrAlbumu;
            this.DataRozpoczecia = s.DataRozpoczecia;
            this.Grupa           = RepoGrupy.PobierzGrupeOId(s.IdGrupy);
            this.Oceny           = RepoOceny.PobierzOcenyStudenta((sbyte)s.Id_student);
            var Kursy = this.Oceny.Select(ocena => RepoKursy.PobierzKursID(ocena.Id_kurs)).ToArray();
            var wagi  = Kursy.Select(kurs => (double)(RepoPrzedmioty.PobierzPrzedmiot(kurs.Id_przedmiot).ECTS)).ToArray();
            var oceny = Oceny.Select(ocena => double.Parse(ocena.Wartosc, CultureInfo.InvariantCulture)).ToArray();

            this.Osiagniecia = new List <WidokOsiagniecia>();
            List <Osiagniecia> osiagniecia = RepoOsiagniecia.PobierzOsiagnieciaStudenta((sbyte)s.Id_student);

            foreach (Osiagniecia o in osiagniecia)
            {
                Osiagniecia.Add(new WidokOsiagniecia(o));
            }

            this.Przedmioty = new List <WidokPrzedmiotu>();
            this.Srednia    = oceny.Sum() * wagi.Sum() / wagi.Sum();
            this.Punkty     = this.Srednia * 10 + (this.Osiagniecia.Select(osiagniecie => (int)osiagniecie.Punkty).ToArray()).Sum();
            if (this.Punkty > 60)
            {
                this.Stypendium = "Tak";
            }
            else
            {
                this.Stypendium = "Nie";
            }
        }
 public WidokProwadzacego(Prowadzacy p)
 {
     this.Imie       = p.Imie;
     this.Nazwisko   = p.Nazwisko;
     this.Tytul      = p.Tytul;
     this.Email      = p.Email;
     this.przedmioty = RepoPrzedmioty.PobierzPrzedmiotyProwadzacego(p.Id_prowadzacy);
 }
Beispiel #3
0
        public ListaPrzedmiotow()
        {
            var przedmioty = RepoPrzedmioty.PobierzWszystkiePrzedmioty();

            foreach (var p in przedmioty)
            {
                Przedmioty.Add(new WidokPrzedmiotu(p));
            }
        }
Beispiel #4
0
        public ListaKursow()
        {
            var mojekursy  = RepoKursy.PobierzWszystkieMojeKursy();
            var przedmioty = RepoPrzedmioty.PobierzWszystkiePrzedmioty();
            var grupy      = RepoGrupy.PobierzWszystkieGrupy();
            var studenci   = RepoStudenci.PobierzWszyscyStudenci();

            foreach (var p in mojekursy)
            {
                var przedmiot = przedmioty.Where(P => P.Id_przedmiot == p.Id_przedmiot).Last();
                var grupay    = grupy.Where(g => g.Id_kurs == p.Id_kurs).ToList();
                foreach (var g in grupay)
                {
                    Kursy.Add(new WidokKursu(p.Id_kurs, przedmiot.Nazwa, g.Nazwa, g.Rok, studenci.Where(s => s.IdGrupy == g.Id_grupa).ToList()));
                }
            }
        }