protected void btnEnvíoInformación_Click(object sender, EventArgs e) { UsuarioServiceClient servUsuario = new UsuarioServiceClient(); long registrar; try { long consultaUsuario = servUsuario.ConsultarExistencia(txtUserName.Text); if (consultaUsuario != 0) { MessageBox.Show("El usuario digitado ya se encuentra registrado en el sistema", "Registrar Usuario"); } else { registrar = servUsuario.RecuperarContrasena(txtUserName.Text); MessageBox.Show("El usuario ha sido creado satisfactoriamente", "Registrar Usuario"); } } catch (Exception ex) { Response.Redirect("~/About.aspx"); } finally { servUsuario.Close(); Response.Redirect("~/Autenticacion/frmRegistrarUsuario.aspx"); } //usuario.Usuario = txtUserName.Text;// //Response.Write("<script type='text/javascript'> alert('La contraseña ha sido enviada a su correo electrónico') </script>"); }
protected void btnConsulta_Click(object sender, EventArgs e) { UsuarioServiceClient servUsuario = new UsuarioServiceClient(); long consultaUsuario = servUsuario.ConsultarExistencia(txtNombreUsuario.Text); if (consultaUsuario != 0) { MessageBox.Show("El usuario digitado ya se encuentra registrado en el sistema", "Registrar Usuario"); DatosPersonales.Visible = false; txtContrasena.Enabled = true; txtConfirmarContrasena.Enabled = true; txtEmail.Enabled = true; txtNombreUsuario.Enabled = true; btnCrearUsuario.Visible = false; btnConsulta.Visible = true; } else { DatosPersonales.Visible = true; txtContrasena.Enabled = false; txtConfirmarContrasena.Enabled = false; txtEmail.Enabled = false; txtNombreUsuario.Enabled = false; btnCrearUsuario.Visible = true; lblContra.Text = txtContrasena.Text; btnConsulta.Visible = false; } }
protected void btnEnviar_Click(object sender, EventArgs e) { UsuarioServiceClient servUsuario = new UsuarioServiceClient(); long datosUsuario; try { long consultaUsuario = servUsuario.ConsultarExistencia(txtNombreUsuario.Text); if (consultaUsuario == 0) { MessageBox.Show("El usuario digitado no se encuentra registrado en el sistema", "Olvido Contraseña"); } else { datosUsuario = servUsuario.RecuperarContrasena(txtNombreUsuario.Text); MessageBox.Show("La contraseña ha sido enviada a su correo electronico", "Olvido Contraseña"); } } catch (Exception ex) { Response.Redirect("~/About.aspx"); } finally { servUsuario.Close(); Response.Redirect("~/Default.aspx"); } }
protected void btnEnvíoInformación_Click(object sender, EventArgs e) { UsuarioServiceClient servUsuario = new UsuarioServiceClient (); long registrar; try { long consultaUsuario = servUsuario.ConsultarExistencia(txtUserName.Text); if (consultaUsuario != 0) { MessageBox.Show("El usuario digitado ya se encuentra registrado en el sistema", "Registrar Usuario"); } else { registrar = servUsuario.RecuperarContrasena(txtUserName.Text); MessageBox.Show("El usuario ha sido creado satisfactoriamente", "Registrar Usuario"); } } catch (Exception ex) { Response.Redirect("~/About.aspx"); } finally { servUsuario.Close(); Response.Redirect("~/Autenticacion/frmRegistrarUsuario.aspx"); } //usuario.Usuario = txtUserName.Text;// //Response.Write("<script type='text/javascript'> alert('La contraseña ha sido enviada a su correo electrónico') </script>"); }
protected void btnCrearUsuario_Click(object sender, EventArgs e) { UsuarioServiceClient servUsuario = new UsuarioServiceClient(); UsuarioBE usuario = new UsuarioBE(); long registrar; try { long consultaUsuario = servUsuario.ConsultarExistencia(txtNombreUsuario.Text); if(consultaUsuario!=0) { MessageBox.Show("El usuario digitado ya se encuentra registrado en el sistema", "Registrar Usuario"); } else { usuario.Usuario = txtNombreUsuario.Text; usuario.Contrasena_1 = lblContra.Text; usuario.Correo = txtEmail.Text; usuario.Cedula = txtCedula.Text; usuario.Nombre = txtNombre.Text; usuario.Apellido = txtApellidos.Text; usuario.Direccion = txtDireccion.Text; usuario.Telefono = txtTelefono.Text; usuario.Genero = lstGenero.SelectedItem.Text; usuario.Fecha_Nacim = lstDia.SelectedValue + "," + lstMes.SelectedValue + "," + lstAno.SelectedValue; PerfilBE pp = new PerfilBE(); pp.Id_Perfil = lstCargo.SelectedValue; usuario.Perfil= pp; registrar = servUsuario.RegistrarUsuario(usuario); MessageBox.Show("El usuario ha sido creado satisfactoriamente", "Registrar Usuario"); } } catch (Exception ex) { Response.Redirect("~/About.aspx"); } finally { servUsuario.Close(); Response.Redirect("~/Autenticacion/frmRegistrarUsuario.aspx"); } }
protected void btnCrearUsuario_Click(object sender, EventArgs e) { UsuarioServiceClient servUsuario = new UsuarioServiceClient(); UsuarioBE usuario = new UsuarioBE(); long registrar; try { long consultaUsuario = servUsuario.ConsultarExistencia(txtNombreUsuario.Text); if (consultaUsuario != 0) { MessageBox.Show("El usuario digitado ya se encuentra registrado en el sistema", "Registrar Usuario"); } else { usuario.Usuario = txtNombreUsuario.Text; usuario.Contrasena_1 = lblContra.Text; usuario.Correo = txtEmail.Text; usuario.Cedula = txtCedula.Text; usuario.Nombre = txtNombre.Text; usuario.Apellido = txtApellidos.Text; usuario.Direccion = txtDireccion.Text; usuario.Telefono = txtTelefono.Text; usuario.Genero = lstGenero.SelectedItem.Text; usuario.Fecha_Nacim = lstDia.SelectedValue + "," + lstMes.SelectedValue + "," + lstAno.SelectedValue; PerfilBE pp = new PerfilBE(); pp.Id_Perfil = lstCargo.SelectedValue; usuario.Perfil = pp; registrar = servUsuario.RegistrarUsuario(usuario); MessageBox.Show("El usuario ha sido creado satisfactoriamente", "Registrar Usuario"); } } catch (Exception ex) { Response.Redirect("~/About.aspx"); } finally { servUsuario.Close(); Response.Redirect("~/Autenticacion/frmRegistrarUsuario.aspx"); } }