private void But_Login_Click(object sender, EventArgs e) { if (Txt_Usuarios.Text != "usuario" && Txt_Usuarios.TextLength > 2) { if (Txt_Contraseña.Text != "contrasnia") { UserModel user = new UserModel(); var validLogin = user.LoginUser(Txt_Usuarios.Text, Txt_Contraseña.Text); if (validLogin == true) { Sistema_Principal mainMenu = new Sistema_Principal(); MessageBox.Show("Bienvenido " + UserLoginCache.Nombre); mainMenu.Show(); mainMenu.FormClosed += Logout; this.Hide(); } else { msgError("Está Incorrecto El Usuario o La Contraseña Insertada.\nPorFavor Vuelva a Intentarlo."); Txt_Contraseña.Text = "Contraseña"; Txt_Contraseña.UseSystemPasswordChar = false; Txt_Usuarios.Focus(); } } else { msgError("Por favor ingrese su contraseña."); } } else { msgError("Por favor ingrese su nombre de usuario."); } }
private void timer1_Tick(object sender, EventArgs e) { if (contador <= 100) { progressBar1.Value = contador; contador = contador + 1; progressBar1.BackColor = Color.BlueViolet; if (contador == 10) { Lbl_Leyendas.Text = "..Cargando Fuentes Del Sistema"; } if (contador == 30) { Lbl_Leyendas.Text = "..Cargando Formularios"; } if (contador == 50) { Lbl_Leyendas.Text = "..Cargando Formularios"; } if (contador == 70) { Lbl_Leyendas.Text = "..Cargando La Base De Datos"; } if (contador == 100) { Lbl_Leyendas.Text = "..¡Bienvenido Al Sistema!..."; } } else { timer1.Enabled = false; this.Hide(); Sistema_Principal frm = new Sistema_Principal(); frm.Show(); } }