Exemplo n.º 1
0
        protected void BtModificarEmpleado_Click(object sender, EventArgs e)
        {
            try
            {
                if (DDLEmpleado.SelectedValue.Equals("0"))
                {
                    throw new Exception("Seleccione un empleado");
                }
                if (DDLGrupo.SelectedValue.Equals("0"))
                {
                    throw new Exception("Seleccione un grupo");
                }
                if (DDLCrearRelojes.SelectedValue.Equals("0"))
                {
                    throw new Exception("Seleccione un biometrico");
                }


                String      vErrorSuccess = "";
                biometricos vBiometrico   = new biometricos(DDLCrearRelojes.SelectedValue);
                Int32       vRelojReturn  = vBiometrico.ModificarGrupoUsuarioBiometrico(Convert.ToInt32(DDLEmpleado.SelectedValue), Convert.ToInt32(DDLGrupo.SelectedValue), ref vErrorSuccess);

                if (vRelojReturn == 1)
                {
                    Mensaje("Usuario modificado con exito", WarningType.Success);
                }
                else
                {
                    Mensaje("Fallo la modificacion en el Biometrico", WarningType.Danger);
                }
                LimpiarModificacionBiometrico();
            }
            catch (Exception Ex) { Mensaje(Ex.Message, WarningType.Danger); }
        }
        protected void BtnGuardarCambio_Click(object sender, EventArgs e)
        {
            try
            {
                if (TxCrearNoEmpleado.Text.Equals(""))
                {
                    throw new Exception("Por favor ingrese un codigo de empleado");
                }
                if (TxCrearNombre.Text.Equals(""))
                {
                    throw new Exception("Por favor ingrese el nombre del empleado");
                }

                if (DDLCrearRelojes.SelectedValue.Equals("0"))
                {
                    throw new Exception("Seleccione un Biometrico para la insercion.");
                }

                String      vErrorSuccess = "";
                biometricos vRelojes      = new biometricos(DDLCrearRelojes.SelectedValue);
                Int32       vRelojReturn  = vRelojes.CrearUsuarioBiometrico(TxCrearNoEmpleado.Text, TxCrearNombre.Text, Convert.ToInt32(DDLCrearRole.SelectedValue), ref vErrorSuccess);

                if (vRelojReturn == 1)
                {
                    Mensaje("Usuario ingresado con exito", WarningType.Success);
                }
                else
                {
                    Mensaje("Fallo ingreso en Biometrico", WarningType.Danger);
                }
                LimpiarBiometrico();
            }
            catch (Exception Ex) { Mensaje(Ex.Message, WarningType.Danger); }
        }
Exemplo n.º 3
0
        protected void BtnGuardarCambio_Click(object sender, EventArgs e)
        {
            try{
                ValidacionesEmpleado();

                String vQuery = "RSP_IngresarEmpleados 1," + TxCrearNoEmpleado.Text + "," +
                                "'" + TxCrearNombre.Text.ToUpper() + "'," +
                                "'" + DDLCrearArea.SelectedValue + "'," +
                                "'" + DDLCrearCiudad.SelectedValue + "'," +
                                "'" + TxCrearComentarios.Text + "'," +
                                "'" + TxCrearIdentidad.Text + "'," +
                                "'" + TxCrearFechaNacimiento.Text + "'," +
                                "'" + TxCrearDireccion.Text + "'," +
                                "'" + TxCrearEmailEmpresa.Text + "'," +
                                "'" + TxCrearEmailPersonal.Text + "'," +
                                "'" + TxCrearTelefono.Text + "'," +
                                "'" + TxCrearCodigoSAP.Text + "',''," +
                                "'" + DDLTurnos.SelectedValue + "'," +
                                "'" + DDLPuestos.SelectedValue + "'," +
                                DDLJefatura2.SelectedValue + "," +
                                "'" + TxAdUser.Text + "'," +
                                "'" + TxTarjeta.Text + "'";

                Int32 vInformacion = vConexion.ejecutarSql(vQuery);

                if (vInformacion == 1)
                {
                    if (!DDLCrearRelojes.SelectedValue.Equals("0"))
                    {
                        String      vErrorSuccess = "";
                        biometricos vRelojes      = new biometricos(DDLCrearRelojes.SelectedValue);
                        Int32       vRelojReturn  = vRelojes.CrearUsuarioBiometrico(TxCrearNoEmpleado.Text, TxCrearNombre.Text, Convert.ToInt32(DDLCrearRole.SelectedValue), ref vErrorSuccess);

                        if (vRelojReturn == 1)
                        {
                            Mensaje("Usuario ingresado con exito", WarningType.Success);
                        }
                        else
                        {
                            Mensaje("Usuario ingresado con exito, fallo ingreso en Reloj", WarningType.Warning);
                            Mensaje(vErrorSuccess, WarningType.Danger);
                        }
                    }
                    else
                    {
                        Mensaje("Usuario ingresado con exito, falta ingresar en Reloj", WarningType.Warning);
                    }
                    LimpiarIngresoEmpleados();
                }
            }catch (Exception Ex) { Mensaje(Ex.Message, WarningType.Danger); }
        }