Esempio n. 1
0
 protected void BtnCambiarPassword_Click(object sender, EventArgs e)
 {
     try{
         generales vGenerales = new generales();
         if (TxModPassword.Text.Equals(TxModPasswordConfirmar.Text))
         {
             String vPasswordMD5 = vGenerales.MD5Hash(TxModPassword.Text);
             String vQuery       = "RSP_IngresarEmpleados 3," + LbEmpleadoPassword.Text + ",'" + vPasswordMD5 + "'";
             Int32  vInformacion = vConexion.ejecutarSql(vQuery);
             if (vInformacion == 1)
             {
                 Mensaje("Actualizado con Exito!", WarningType.Success);
                 CerrarModal("PasswordModal");
             }
             else
             {
                 Mensaje("No se pudo actualizar la contraseña!", WarningType.Danger);
                 CerrarModal("PasswordModal");
             }
         }
         else
         {
             throw new Exception("Las contraseñas ingresadas no coinciden.");
         }
     }catch (Exception Ex) {
         LbUsuarioMensaje.Text = Ex.Message; UpdateUsuarioMensaje.Update();
     }
 }
Esempio n. 2
0
 void LimpiarModal()
 {
     LbErrorUsuario.Text             = string.Empty;
     TxModPuesto.Text                = string.Empty;
     DivJefe.Visible                 = false;
     DDLEstado.SelectedIndex         = -1;
     DDLCargoModificar.SelectedIndex = -1;
     DDLJefes.SelectedIndex          = -1;
     UpdateUsuarioMensaje.Update();
 }
Esempio n. 3
0
        protected void BtnModificarUsuario_Click(object sender, EventArgs e)
        {
            try{
                if (DDLCargoModificar.SelectedIndex.Equals(0))
                {
                    throw new Exception("Selecciona un cargo para modificar");
                }

                if (DDLEstado.SelectedIndex.Equals(0))
                {
                    throw new Exception("Selecciona un estado para modificar");
                }

                String vJefe  = DDLCargoModificar.SelectedValue == "3" ? DDLJefes.SelectedValue : "";
                String vQuery = "[ACSP_Usuarios] 2" +
                                ",'" + LbUsuarioModificar.Text + "'" +
                                "," + DDLCargoModificar.SelectedValue + "" +
                                ",''" +
                                "," + DDLEstado.SelectedValue + "" +
                                ",'" + vJefe + "'" +
                                ",0" +
                                ",'" + TxModPuesto.Text + "'";

                if (vConexion.ejecutarSql(vQuery).Equals(1))
                {
                    DDLCargoModificar.SelectedIndex = -1;
                    DDLEstado.SelectedIndex         = -1;
                    UpdateUsuariosMain.Update();

                    ObtenerUsuarios();
                    CerrarModal("UsuariosModal");
                    Mensaje("Usuario modificado con Exito!", WarningType.Success);
                }
            }catch (Exception Ex) {
                LbErrorUsuario.Text = Ex.Message;
                UpdateUsuarioMensaje.Update();
            }
        }