public PredavacNode(Predavac a) { ime = a.ime; prezime = a.prezime; adresa = a.adresa; OIB = a.OIB; } // Konstruktor koji sprema iz klase Predavac a u nodove
public static void Dodaj(Predavac a) { SqliteCommand c = DB.con.CreateCommand(); c.CommandText = String.Format(@"INSERT INTO Predavac (ime, prezime, adresa, OIB, polje_IDucionice) VALUES ('{0}', '{1}', '{2}', '{3}', '{4}')", a.ime, a.prezime, a.adresa, a.OIB, a.polje_IDucionice); c.ExecuteNonQuery(); c.Dispose(); } // Ubacujemo u bazu Predavaca
public ZauzmiTerminWindow(Predavac _predavac, Ucionica _ucionica) : base(Gtk.WindowType.Toplevel) { this.Build(); this._predavac = _predavac; this._ucionica = _ucionica; provjera_polja_predavac_ucionice(); for (int i = 0; i < 15; ++i) { for (int j = 0; j < 5; ++j) { pomocno_polje[i, j] = false; } } } // Konstruktor
public static Predavac Dohvati_Predavaca(string OIB) { SqliteCommand c = DB.con.CreateCommand(); c.CommandText = String.Format(@"SELECT ID, ime, prezime, adresa, OIB, polje_IDucionice FROM Predavac WHERE OIB = {0};", OIB); SqliteDataReader reader = c.ExecuteReader(); while (reader.Read()) { Predavac temp = new Predavac(reader.GetInt32(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(4), reader.GetString(5)); c.Dispose(); return(temp); } c.Dispose(); return(null); } // Dohvaćamo iz baze predavaca po argumentima IME, PREZIME, OIB
public static List <Predavac> DohvatiSve_Predavace() { var lista = new List <Predavac>(); SqliteCommand c = DB.con.CreateCommand(); c.CommandText = String.Format(@"SELECT ID, ime, prezime, adresa, OIB, polje_IDucionice FROM Predavac;"); SqliteDataReader reader = c.ExecuteReader(); while (reader.Read()) { Predavac temp = new Predavac(reader.GetInt32(0), reader.GetString(1), reader.GetString(2), reader.GetString(3), reader.GetString(4), reader.GetString(5)); // Dodati za unos u polje lista.Add(temp); } c.Dispose(); return(lista); }
public static void dodaj_predavaca(Predavac a) { predavaci_lista.Add(a); } // Dodajemo predavaca u listu
public void Add(Predavac a) { this.AddNode(new PredavacNode(a)); } // Dodajemo predavaca