public ResourceWindow(Resource res_) : base(Gtk.WindowType.Toplevel) { this.Build (); if (res_ != null ) { _res = res_; _update = true; FillDetails(); } else { _res = new Resource(); } }
public ResourceTreeNode(Resource r) { res = r; }
private void LoadResources() { view.NodeStore = Store; view.AppendColumn("Név", new CellRendererText(), "text", 0); MySqlConnection conn = new MySqlConnection(Globals.ConnectionString); MySqlCommand cmd = new MySqlCommand("select * from resources", conn); conn.Open(); MySqlDataReader rdr = cmd.ExecuteReader(); while (rdr.Read()) { Resource res = new Resource(); res.Id = rdr.GetInt32(rdr.GetOrdinal("r_id")); res.Name = rdr.GetString(rdr.GetOrdinal("r_name")); res.Active = rdr.GetBoolean(rdr.GetOrdinal("r_active")); Store.AddNode( new ResourceTreeNode(res) ); } conn.Close(); }