private void traspasosToolStripMenuItem_Click(object sender, EventArgs e) { string tabName = "Traspasos"; Boolean encontrado = false; foreach (TabPage page in Home.TabPages) { string name = page.Name; if (name == tabName) { encontrado = true; Home.SelectTab(tabName); } } if (encontrado == false) { TabPage tpage = new TabPage(tabName); tpage.Name = tabName; Traspasos fc = new Traspasos(); fc.TopLevel = false; fc.Visible = true; fc.MdiParent = this; fc.FormBorderStyle = FormBorderStyle.None; fc.Dock = DockStyle.Fill; Home.TabPages.Add(tpage); int ultimo = (Home.TabPages.Count - 1); Home.TabPages[ultimo].Controls.Add(fc); Home.SelectTab(tabName); } }
private void BtnAgregar_Click(object sender, RoutedEventArgs e) { Traspasos jugador = new Traspasos() { Jugador = txtBoxJugador.Text, Precio = txtBoxPrecio.Text, Equipo_Entrada = txtBoxEntrada.Text, Equipo_Salida = txtBoxSalida.Text }; using (SQLiteConnection conexion = new SQLiteConnection(App.databasePath)) { conexion.CreateTable <Traspasos>(); conexion.Insert(jugador); } Close(); }