Exemplo n.º 1
0
        protected override Collection <Material> Read(SqlDataReader reader)
        {
            Collection <Material> materialy = new Collection <Material>();

            PredmetTable  predmetTable  = new PredmetTable();
            UzivatelTable uzivatelTable = new UzivatelTable();


            while (reader.Read())
            {
                int      i        = -1;
                Material material = new Material();

                material.MId      = reader.GetInt32(++i);
                material.Typ      = reader.GetString(++i);
                material.Dokument = reader.GetString(++i);
                material.Datum    = reader.GetDateTime(++i);
                material.Okruh    = reader.GetString(++i);
                material.Overeny  = reader.GetInt32(++i);

                material.Predmet  = predmetTable.SelectByID(reader.GetInt32(++i));
                material.Uzivatel = uzivatelTable.SelectByID(reader.GetInt32(++i));

                materialy.Add(material);
            }

            return(materialy);
        }
Exemplo n.º 2
0
        private void FillComboBox()
        {
            PredmetTable         PredmetTable = new learningStore.tables.PredmetTable();
            Collection <Predmet> predmety     = PredmetTable.Select();

            predmetComboBox.DataSource    = predmety;
            predmetComboBox.DisplayMember = "Nazev";
            predmetComboBox.ValueMember   = "PId";

            UzivatelTable         UzivatelTable = new UzivatelTable();
            Collection <Uzivatel> uzivatele     = UzivatelTable.SelectStudents();

            uzivatelComboBox.DataSource    = uzivatele;
            uzivatelComboBox.DisplayMember = "Login";
            uzivatelComboBox.ValueMember   = "UzId";
        }
Exemplo n.º 3
0
        protected override Collection <Hodnoceni> Read(SqlDataReader reader)
        {
            Collection <Hodnoceni> hodnoceni = new Collection <Hodnoceni>();

            UzivatelTable uzivatelTable = new UzivatelTable();
            PredmetTable  predmetTable  = new PredmetTable();

            while (reader.Read())
            {
                int i = -1;

                Hodnoceni h = new Hodnoceni();
                h.Ohodnoceni = reader.GetInt32(++i);
                h.Popis      = reader.GetString(++i);
                h.Datum      = reader.GetDateTime(++i);
                h.Predmet    = predmetTable.SelectByID(reader.GetInt32(++i));
                h.Uzivatel   = uzivatelTable.SelectByID(reader.GetInt32(++i));

                hodnoceni.Add(h);
            }

            return(hodnoceni);
        }