private void BtnAceptar_Click(object sender, EventArgs e) { //Verificar usuario ingresado. if (txtCorreo.Text != "" && txtClave.Text != "") { try { Persistencia pd = new Persistencia(); DataTable ds = pd.BuscarDatos("usuarios"); for (int j = 0; j < ds.Rows.Count; j++) { string user = ds.Rows[j][0].ToString(); string pass = ds.Rows[j][4].ToString(); if (txtCorreo.Text.Equals(user) && txtClave.Text.Equals(pass)) { MenuInicial mi = new MenuInicial(); mi.Show(); this.Close(); } } } catch (Exception) { MessageBox.Show("Debe generar antes un usuario."); } } else { MessageBox.Show("Debe ingresar los datos"); } }
private void Button2_Click(object sender, EventArgs e) { MenuInicial menu = new MenuInicial(); menu.Show(); this.Hide(); }
private void Bt_atras_Click_1(object sender, EventArgs e) { MenuInicial menu = new MenuInicial(); menu.Show(); this.Hide(); }
//============== // === TIMER === //============== private void timer1_Tick(object sender, EventArgs e) { if (loadingBar.Value < 100) { loadingBar.Value += 2; lblPorcento.Text = loadingBar.Value.ToString() + "%"; if (loadingBar.Value == 30) { BackgroundImage = Resources.load2; } else if (loadingBar.Value == 60) { BackgroundImage = Resources.load3; } } else { timer1.Enabled = false; Hide(); MenuInicial menuInicial = new MenuInicial(); menuInicial.Show(); } }
//Click a la ficha private void piece_Click(object sender, EventArgs e) { if (!tengoTurno)//si no tengo turno no hago nada { //MessageBox.Show("Quiero macareno, que no tienes el turno."); return; } Activetile = sender as ShowPiece; //Si es la ficha de mi groupBox if ((PlayerGroupBoxes.ElementAt(myPosition).Controls.Contains(Activetile)) && !pClick) { ListPiecePanelCompare = new List <ShowPiece>(); pClick = true; //La añade a la lista para luego compararla ListPiecePanelCompare.Add(Activetile); } //Si es del panel, y se ha hecho click pimero en el groupBox else if ((pnlTable.Controls.Contains(Activetile)) && pClick) { //La añade a la lista para luego compararla ListPiecePanelCompare.Add(Activetile); //Si hay una ficha en la mesa, muestra el menú para elegir dónde se quiere iniciar el juego:iqda o derecha if (pnlTable.Controls.Count == 1) { MenuInicial.Show(pnlTable, ListPiecePanelCompare[1].Location.X, ListPiecePanelCompare[1].Location.Y); } else { if (ColocarfichaJuego()) { //si colocamos la ficha correctamente, la enviamos a los demas //jugadores la ficha PieceData ficha = new PieceData(ListPiecePanelCompare[0].valorFicha, 0, 0, this.myPosition); PieceData ficha_anterior = new PieceData((ListPiecePanelCompare[1] as ShowPiece).getValue(), 0, 0, this.myPosition);; ficha.Rotacion = ListPiecePanelCompare[0].GetRotaciones(); ficha.Ubicacion = ListPiecePanelCompare[0].Ubicación; ficha.PosX = ListPiecePanelCompare[0].Location.X; ficha.PosY = ListPiecePanelCompare[0].Location.Y; DecrementPlayerAvailablePieces(this.myPosition); //Manda al dispatcher la ficha puesta en el panel dispatcher.RequestPutPiecePlayer(ficha, ficha_anterior); //Si ponemos una ficha en un lado, se suma uno a esa posición, para controlar cuando llegue al borde // countPiece(ficha.Ubicacion); // lblCount.Text = FichasTotalIzq.ToString(); } } pClick = false; } else { MessageBox.Show("¡ Seleccione Primero Una Ficha del Jugador !"); } Activetile = null; }