Exemplo n.º 1
0
 private void Login_Resize(object sender, EventArgs e)
 {
     ControlUtils.centrar(pnlLogin, gbLogin);
     ControlUtils.centrar(pnlErrorLogin, lblError);
 }
Exemplo n.º 2
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            string nombres, apellidos, usuario, correo, password, confirmPass;
            int    idNivel;

            nombres     = txtNombres.Text;
            apellidos   = txtApellidos.Text;
            usuario     = txtUsuario.Text;
            correo      = txtEmail.Text;
            password    = txtPassword.Text;
            confirmPass = txtConfirmPass.Text;
            idNivel     = int.Parse(cmbNivel.SelectedValue.ToString());

            if (string.IsNullOrEmpty(nombres))
            {
                emptyFields = true;
            }
            else if (string.IsNullOrEmpty(apellidos))
            {
                emptyFields = true;
            }
            else if (string.IsNullOrEmpty(usuario))
            {
                emptyFields = true;
            }
            else if (string.IsNullOrEmpty(correo))
            {
                emptyFields = true;
            }
            else if (string.IsNullOrEmpty(password))
            {
                emptyFields = true;
            }
            else if (string.IsNullOrEmpty(confirmPass))
            {
                emptyFields = true;
            }
            else
            {
                if (password.Equals(confirmPass))
                {
                    passMatch = true;
                }

                emptyFields = false;
            }

            if (emptyFields)
            {
                MessageBox.Show("Debe llenar todos los campos");
            }
            else
            {
                if (passMatch)
                {
                    usuarios.insertUsuario(nombres, apellidos, correo, usuario, password, idNivel);

                    Control pnlContent = ParentForm.Controls.Find("pnlContent", true)[0];
                    ControlUtils.abrirFormEnPanel(pnlContent, new Usuarios());
                    Close();
                }
                else
                {
                    MessageBox.Show("Las contraseñas no coinciden");
                }
            }
        }
Exemplo n.º 3
0
 private void pictureBox2_Click(object sender, EventArgs e)
 {
     ControlUtils.openMdi(ParentForm, new Login());
     Close();
 }
Exemplo n.º 4
0
        private void btnGuardarEmpleado_Click(object sender, EventArgs e)
        {
            string nombres, apellidos, dui, email, direccion, tel1, tel2, fechaContrato;
            int    idPuesto, idDpto;
            double salario;

            if (string.IsNullOrEmpty(txtNombres.Text))
            {
                emptyFields = true;
            }
            else if (string.IsNullOrEmpty(txtApellidos.Text))
            {
                emptyFields = true;
            }
            else if (string.IsNullOrEmpty(txtApellidos.Text))
            {
                emptyFields = true;
            }
            else if (string.IsNullOrEmpty(txtDUI.Text))
            {
                emptyFields = true;
            }
            else if (string.IsNullOrEmpty(txtEmail.Text))
            {
                emptyFields = true;
            }
            else if (string.IsNullOrEmpty(txtDireccion.Text))
            {
                emptyFields = true;
            }
            else if (string.IsNullOrEmpty(txtTelefono1.Text))
            {
                emptyFields = true;
            }
            else if (string.IsNullOrEmpty(txtTelefono2.Text))
            {
                emptyFields = true;
            }
            else if (txtSalario.Value == 0)
            {
                emptyFields = true;
            }
            else
            {
                emptyFields = false;
            }

            if (emptyFields)
            {
                MessageBox.Show("Debe llenar todos los campos");
            }
            else
            {
                nombres       = txtNombres.Text;
                apellidos     = txtApellidos.Text;
                dui           = txtDUI.Text;
                email         = txtEmail.Text;
                direccion     = txtDireccion.Text;
                tel1          = txtTelefono1.Text;
                tel2          = txtTelefono2.Text;
                idPuesto      = int.Parse(cmbPuesto.SelectedValue.ToString());
                idDpto        = int.Parse(cmbDepartamento.SelectedValue.ToString());
                fechaContrato = txtFechaContrato.Text;
                salario       = double.Parse(txtSalario.Text);

                empleados.insertEmpleado(nombres, apellidos, dui, email, tel1, tel2, direccion, idDpto, idPuesto, salario);

                Control pnlContent = ParentForm.Controls.Find("pnlContent", true)[0];
                ControlUtils.abrirFormEnPanel(pnlContent, new Empleados());
                Close();
            }
        }
Exemplo n.º 5
0
 private void btnUsuarios_Click(object sender, EventArgs e)
 {
     ControlUtils.abrirFormEnPanel(pnlContent, new Usuarios());
 }
Exemplo n.º 6
0
 private void btnEvaluaciones_Click(object sender, EventArgs e)
 {
     ControlUtils.abrirFormEnPanel(pnlContent, new Evaluaciones());
 }
Exemplo n.º 7
0
 private void btnVacantes_Click(object sender, EventArgs e)
 {
     ControlUtils.abrirFormEnPanel(pnlContent, new Vacantes());
 }
Exemplo n.º 8
0
 private void Home_Load(object sender, EventArgs e)
 {
     ControlUtils.abrirFormEnPanel(pnlContent, new Recientes());
 }
Exemplo n.º 9
0
 private void Home_Resize(object sender, EventArgs e)
 {
     ControlUtils.centrar(pnlTitulo, lblTitulo);
 }