示例#1
0
        private void button4_Click(object sender, EventArgs e)
        {
            loginad lg = new loginad();

            lg.Show();
            this.Hide();
        }
示例#2
0
        private void button2_Click(object sender, EventArgs e)
        {
            loginad acceso = new loginad();

            acceso.Show();
            this.Hide();
        }
示例#3
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            Progreso           = Progreso + 1;
            progressBar1.Value = Progreso;
            label1.Text        = Progreso + "%";

            if (Progreso == 100)
            {
                loginad lg = new loginad();
                lg.Show();
                this.Hide();
                timer1.Enabled = false;
            }
        }
        private void button2_Click_1(object sender, EventArgs e)
        {
            if (ValidarCampoVacio(textBox16, "Id_Usuario") && ValidarCampoVacio(textBox15, "Nombre") && ValidarCampoVacio(textBox14, "Apellido") && ValidarCampoVacio(textBox12, "Telefono") && validarEmail(textBox13) && ValidarCampoVacio(textBox9, "Direccion") && ValidarCampoVacio(textBox11, "Salario") && ValidarCampoVacio(textBox18, "Usuario"))

            {
                Usuarios ObjUsuarios = new Usuarios();
                try
                {
                    ObjUsuarios.Id_Usuario = long.Parse(textBox16.Text);
                    ObjUsuarios.Nombre     = textBox15.Text;
                    ObjUsuarios.Apellido   = textBox14.Text;
                    ObjUsuarios.Email      = textBox13.Text;
                    ObjUsuarios.Telefono   = long.Parse(textBox12.Text);
                    ObjUsuarios.Direccion  = textBox9.Text;
                    ObjUsuarios.Salario    = long.Parse(textBox11.Text);


                    ObjUsuarios.Contraseña    = textBox17.Text;
                    ObjUsuarios.Usuario       = textBox18.Text;
                    ObjUsuarios.TipoDeUsuario = Convert.ToInt32(comboBox1.Text);


                    bool respuestaSQL = ObjUsuarios.InsertUsuarios();

                    if (respuestaSQL == true)
                    {
                        MessageBox.Show("Los Datos Del Nuevo Usuario Fueron Insertados Correctamente");
                        textBox16.Text = ""; textBox15.Text = ""; textBox14.Text = ""; textBox13.Text = ""; textBox12.Text = ""; textBox9.Text = ""; textBox11.Text = ""; textBox17.Text = ""; textBox18.Text = "";
                        loginad acceso = new loginad();
                        acceso.Show();
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show(ObjUsuarios.Mensaje);
                    }
                }
                catch (Exception Ex)
                {
                    MessageBox.Show("ERROR!: " + Ex.Message + " " + ObjUsuarios.Mensaje);
                }
            }
        }