public PrincipalWindow() : base(Gtk.WindowType.Toplevel) { #if DEBUG Console.WriteLine ("En debug"); #endif this.Build (); this.db = new ControladorBaseDatos (); bool correcta = false; try { correcta = this.db.ConfiguracionCorrectaBd; } catch (Exception ex) { correcta = false; } if (!correcta) { //mostrar dialog configuracion basedatosdialog bdd = new basedatosdialog (this); bdd.Run (); this.db = null; this.db = new ControladorBaseDatos (); correcta = false; try { correcta = this.db.ConfiguracionCorrectaBd; } catch (Exception ex) { correcta = false; } if (!correcta) { Gtk.Application.Quit (); } } }
public familiaproductosdialog(Gtk.Window parent) : base("Administrar familia", parent, Gtk.DialogFlags.DestroyWithParent) { this.Build (); this.db = new basedatos(); bool correcta = false; try { correcta = this.db.ConfiguracionCorrecta; } catch (Exception ex) { correcta = false; } if (!correcta) { //mostrar dialog configuracion basedatosdialog bdd = new basedatosdialog(this); bdd.Run(); this.db = null; this.db = new basedatos(); correcta = false; try { correcta = this.db.ConfiguracionCorrecta; } catch (Exception ex) { correcta = false; } if(!correcta) { Application.Quit(); } } Gtk.TreeViewColumn nombre_column = new Gtk.TreeViewColumn(); nombre_column.Title = "Nombre"; Gtk.CellRendererText nombre_cell = new Gtk.CellRendererText(); nombre_column.PackStart(nombre_cell, true); this.familiaplantastreeview.AppendColumn(nombre_column); nombre_column.AddAttribute(nombre_cell, "text", 0); this.familiaplantastreeview.Selection.Changed += OnFamiliasTreeViewSelectionChanged; //cargar emsefor desde la base de datos //this.CargarEmsefor(); GLib.ExceptionManager.UnhandledException += ExcepcionDesconocida; this.Deletable = true; }
protected virtual void OnConexionBaseDatosActivated(object sender, System.EventArgs e) { //mostrar dialog configuracion basedatosdialog bdd = new basedatosdialog(this); bdd.Run(); bdd.Destroy(); this.db = null; this.db = new basedatos(); bool correcta = false; try { correcta = this.db.ConfiguracionCorrecta; } catch (Exception ex) { correcta = false; } if(!correcta) { Gtk.Application.Quit(); } }