예제 #1
0
        private void beditar_Click(object sender, EventArgs e)
        {
            frmregistroUsuario regempleado = new frmregistroUsuario();
            string updateRegistro = ("UPDATE MAREGISTROPERSONAL set vnombre = '" + txtnombre.Text + "', vapellido = '" + txtapellido.Text + "', vtipo = '" + cmbtipousuario.Text + "', vusuario = '" + txtusuario.Text + "', vcontrasenia = '" + txtpassword.Text +"' WHERE iidregistro = '" + txtidempleado.Text + "'");
            dllConexion.dllConexion.inserta(updateRegistro);
            MessageBox.Show("El empleado " + txtnombre.Text + " se actualizo correctamente");

            txtidempleado.ResetText();
            txtnombre.ResetText();
            txtapellido.ResetText();
            cmbtipousuario.ResetText();
            txtusuario.ResetText();
            txtpassword.ResetText();
        }
예제 #2
0
        private void baceptarPelicula_Click(object sender, EventArgs e)
        {
            frmregistroUsuario regempleado = new frmregistroUsuario();

            regempleado.txtidempleado .Text = this.grdbuscarempleado.CurrentRow.Cells[0].Value.ToString();
            regempleado.txtnombre.Text = this.grdbuscarempleado.CurrentRow.Cells[1].Value.ToString();
            regempleado.txtapellido.Text = this.grdbuscarempleado.CurrentRow.Cells[2].Value.ToString();
            regempleado.cmbtipousuario.Text = this.grdbuscarempleado.CurrentRow.Cells[3].Value.ToString();
            regempleado.txtusuario.Text = this.grdbuscarempleado.CurrentRow.Cells[4].Value.ToString();
            regempleado.txtpassword.Text = this.grdbuscarempleado.CurrentRow.Cells[5].Value.ToString();

            regempleado.bguardar.Enabled = false;
            regempleado.beditar.Enabled = true;
            regempleado.beliminar.Enabled = true;
            this.Hide();
            regempleado.ShowDialog();
        }
예제 #3
0
        private void beliminar_Click(object sender, EventArgs e)
        {
            frmregistroUsuario regempleado = new frmregistroUsuario();
            String delete = "Delete from MAREGISTROPERSONAL WHERE IIDREGISTRO ='" + txtidempleado.Text + "'";
            dllConexion.dllConexion.inserta(delete);
            MessageBox.Show("El empleado " + txtnombre.Text + " se eliminó correctamente");
            txtidempleado.ResetText();
            txtnombre.ResetText();
            txtapellido.ResetText();
            cmbtipousuario.ResetText();
            txtusuario.ResetText();
            txtpassword.ResetText();

            regempleado.bguardar.Enabled = true;
            regempleado.beditar.Enabled = false;
            regempleado.beliminar.Enabled = false;
            regempleado.button1.Enabled = false;
        }
예제 #4
0
        private void baceptarEmpleado_Click(object sender, EventArgs e)
        {
            //Boton que nos perimitira realizar una eliminacion o edicion de campos, luego de haber realizado una busqueda en la BD
            frmregistroUsuario regempleado = new frmregistroUsuario();

               //Seleccionamos todos los campos que se encuentran en el DataGridView para ser enviados a los campos de la busqueda de empleados
            regempleado.txtidempleado .Text = this.grdbuscarempleado.CurrentRow.Cells[0].Value.ToString();
            regempleado.txtnombre.Text = this.grdbuscarempleado.CurrentRow.Cells[1].Value.ToString();
            regempleado.txtapellido.Text = this.grdbuscarempleado.CurrentRow.Cells[2].Value.ToString();
            regempleado.cmbtipousuario.Text = this.grdbuscarempleado.CurrentRow.Cells[3].Value.ToString();
            regempleado.txtusuario.Text = this.grdbuscarempleado.CurrentRow.Cells[4].Value.ToString();
            regempleado.txtpassword.Text = this.grdbuscarempleado.CurrentRow.Cells[5].Value.ToString();

            regempleado.bguardar.Enabled = false;
            regempleado.beditar.Enabled = true;
            regempleado.beliminar.Enabled = true;
            this.Hide();
            regempleado.ShowDialog();
        }
예제 #5
0
        private void beditar_Click(object sender, EventArgs e)
        {
            frmregistroUsuario regempleado = new frmregistroUsuario();
            //Query para realizar una modificacion sobre un empleado
            string updateRegistro = ("UPDATE MAREGISTROPERSONAL set vnombre = '" + txtnombre.Text + "', vapellido = '" + txtapellido.Text + "', vtipo = '" + cmbtipousuario.Text + "', vusuario = '" + txtusuario.Text + "', vcontrasenia = '" + txtpassword.Text +"' WHERE iidregistro = '" + txtidempleado.Text + "'");
            dllConexion.dllConexion.inserta(updateRegistro);
            MessageBox.Show("El empleado " + txtnombre.Text + " se actualizo correctamente");

            //Limpiamos todas las cajas de texto
            txtidempleado.ResetText();
            txtnombre.ResetText();
            txtapellido.ResetText();
            cmbtipousuario.ResetText();
            txtusuario.ResetText();
            txtpassword.ResetText();

            //Activamos y Desactivamos ciertos botones
            regempleado.bguardar.Enabled = true;
            regempleado.beditar.Enabled = false;
            regempleado.beliminar.Enabled = false;
            regempleado.brefrescar.Enabled = false;
        }
예제 #6
0
 private void registroUsuarioToolStripMenuItem_Click(object sender, EventArgs e)
 {
     frmregistroUsuario form = new frmregistroUsuario();
     form.Show();
 }
예제 #7
0
        private void beliminar_Click(object sender, EventArgs e)
        {
            if (txtnombre.Text.Length == 0 && txtapellido.Text.Length == 0 && cmbtipousuario.Text.Length == 0 && txtusuario.Text.Length == 0 && txtpassword.Text.Length == 0)
            {

                MessageBox.Show("Debe ingresar todos los datos solicitados");
            }
            else
            {
                frmregistroUsuario regempleado = new frmregistroUsuario();
                //Realizamos una eliminacion por medio del codigo del empleado.
                String delete = "Delete from MAREGISTROPERSONAL WHERE IIDREGISTRO ='" + txtidempleado.Text + "'";
                dllConexion.dllConexion.inserta(delete);
                MessageBox.Show("El empleado " + txtnombre.Text + " se eliminó correctamente");

                //Limpiamos todas las cajas de Texto
                txtidempleado.ResetText();
                txtnombre.ResetText();
                txtapellido.ResetText();
                cmbtipousuario.ResetText();
                txtusuario.ResetText();
                txtpassword.ResetText();

                regempleado.bguardar.Enabled = true;
                regempleado.beditar.Enabled = false;
                regempleado.beliminar.Enabled = false;
                regempleado.brefrescar.Enabled = false;

            }
        }