Example #1
0
        public void DodajStudenta(Student student, String przedmiot)
        {
            Ocena ocena = new Ocena();

            ocena.przedmiot = przedmioty.Find(p => p.nazwa == przedmiot);
            student.oceny.Add(ocena);
        }
Example #2
0
        protected void Przedmiot_Click(Object sender, EventArgs e)
        {
            LinkButton button = sender as LinkButton;

            ocena = Login.user.oceny.Find(o => o.przedmiot.nazwa == button.Text);
            Response.Redirect("Student.aspx");
        }
Example #3
0
        protected void add_Click(object sender, EventArgs e)
        {
            Ocena ocena = new Ocena();

            ocena.przedmiot = przedmiot;
            String stu      = listbox.SelectedItem.ToString();
            String imie     = stu.Remove(stu.IndexOf(" "));
            String nazwisko = stu.Remove(0, stu.IndexOf(" ") + 1);

            foreach (Student st in students)
            {
                if (st.imie == imie && st.nazwisko == nazwisko)
                {
                    st.oceny.Add(ocena);
                }
            }
            Server.Transfer("Teacher.aspx", false);
        }
Example #4
0
        public void Init()
        {
            wykladowcy = new List <Wykladowca>();

            Wykladowca wykladowca = new Wykladowca();

            wykladowca.nazwisko = "Kowalski";
            wykladowca.imie     = "Adam";
            wykladowca.email    = "*****@*****.**";
            wykladowca.haslo    = "admin";

            Przedmiot przedmiot = new Przedmiot();

            przedmiot.nazwa = "Programowanie obiektowe";

            wykladowca.przedmioty.Add(przedmiot);
            wykladowcy.Add(wykladowca);

            students = new List <Student>();

            Student student = new Student();

            student.nr_indeksu = 11023;
            student.email      = "*****@*****.**";
            student.imie       = "Jan";
            student.nazwisko   = "Nowak";
            student.haslo      = "1234";

            Ocena ocena = new Ocena();

            ocena.przedmiot = przedmiot;
            ocena.points    = 0;

            student.oceny.Add(ocena);

            students.Add(student);

            student.nr_indeksu = 11024;
            student            = new Student();
            student.email      = "*****@*****.**";
            student.imie       = "Ania";
            student.nazwisko   = "Knap";
            student.haslo      = "1111";

            ocena           = new Ocena();
            ocena.przedmiot = przedmiot;
            ocena.points    = 0;

            student.oceny.Add(ocena);

            students.Add(student);

            student.nr_indeksu = 11026;
            student            = new Student();
            student.email      = "*****@*****.**";
            student.imie       = "Karol";
            student.nazwisko   = "Nowak";
            student.haslo      = "2222";

            students.Add(student);
        }