public static bool CambiarContrasenaCandidato(String cve, String password) { var objCandidato = InformacionPersonalCandidatoService.GetCandidatoById(cve); if (objCandidato != null) { objCandidato.Password = password; return(InformacionPersonalCandidatoService.UpdateCandidato(objCandidato)); } return(false); }
protected void EnviarBtn_Click(object sender, EventArgs e) { var candidato = InformacionPersonalCandidatoService.GetCandidatoByCorreo(Session[StringValues.CorreoSesion].ToString()); if (candidato != null) { if (!candidato.FechaPrivacidadDatos.HasValue) { candidato.FechaPrivacidadDatos = DateTime.Today.Date; } InformacionPersonalCandidatoService.UpdateCandidato(candidato); } }
protected void ActualizarContrasena() { var candidato = InformacionPersonalCandidatoService.GetCandidatoByCorreo(Session[StringValues.CorreoSesion].ToString()); string sCurrentPassword = currentPwdTextBox.Text; if (candidato.Password == sha256(sCurrentPassword)) { if (newPwdTextBox.Text == confirmNewPwdTextBox.Text) { Regex regexNumero = new Regex(@".*\d.*"); Regex regexLetra = new Regex(@".*[a-zA-z].*"); Match matchNumero = regexNumero.Match(newPwdTextBox.Text); Match matchLetra = regexLetra.Match(newPwdTextBox.Text); if (newPwdTextBox.Text.Length >= 6 && matchNumero.Success && matchLetra.Success) { if (candidato != null) { candidato.Password = sha256(newPwdTextBox.Text); if (InformacionPersonalCandidatoService.UpdateCandidato(candidato)) { MasterPage.ShowMessage("Aviso", "Contraseña cambiada con éxito."); } else { MostrarCampos(); } } } else { MasterPage.ShowMessage("Error", "Contraseña debe ser de al menos 6 caracteres y debe contener al menos un número y una letra."); } } else { MasterPage.ShowMessage("Error", "Contraseñas no coinciden."); } } else { MasterPage.ShowMessage("Error", "Contraseña actual incorrecta."); } ResetFields(); }
protected void ActualizarDatosGenerales() { var candidato = InformacionPersonalCandidatoService.GetCandidatoByCorreo(Session[StringValues.CorreoSesion].ToString()); if (candidato != null) { candidato.Nombre = NombresTextBox.Text; candidato.Apellido = ApellidosTextBox.Text; candidato.Direccion = DomicilioTextBox.Text.ToString(); candidato.Nacionalidad = NacionalidadTextBox.Text.ToString(); candidato.RFC = RFCTextBox.Text.ToString(); candidato.Telefono = TelefonoTextBox.Text.ToString(); if (!candidato.FechaPrivacidadDatos.HasValue) { candidato.FechaPrivacidadDatos = DateTime.Today.Date; } if (!InformacionPersonalCandidatoService.UpdateCandidato(candidato)) { MostrarCampos(); } } }
protected void ActualizarDatosGenerales() { string sUserType = Request.QueryString["t"]; string sUserId = Request.QueryString["id"]; if (sUserType.Equals("juez")) { var juez = InformacionPersonalJuezService.GetJuezById(sUserId); if (juez != null) { juez.Nombre = jNombresTextBox.Text; juez.Apellido = jApellidosTextBox.Text; InformacionPersonalJuezService.UpdateJuez(juez); } } else if (sUserType.Equals("candidato")) { var candidato = InformacionPersonalCandidatoService.GetCandidatoById(sUserId); if (candidato != null) { candidato.Nombre = NombresTextBox.Text; candidato.Apellido = ApellidosTextBox.Text; candidato.Direccion = DomicilioTextBox.Text.ToString(); candidato.Nacionalidad = NacionalidadTextBox.Text.ToString(); candidato.RFC = RFCTextBox.Text.ToString(); candidato.Telefono = TelefonoTextBox.Text.ToString(); if (!candidato.FechaPrivacidadDatos.HasValue) { candidato.FechaPrivacidadDatos = DateTime.Today.Date; } InformacionPersonalCandidatoService.UpdateCandidato(candidato); } } }
protected void CambiarContrasena_Click(object sender, EventArgs e) { string sUserType = Request.QueryString["t"]; string sUserId = Request.QueryString["id"]; if (sUserType.Equals("juez")) { var juez = InformacionPersonalJuezService.GetJuezById(sUserId); if (newPwdTextBox.Text == confirmNewPwdTextBox.Text) { Regex regexNumero = new Regex(@".*\d.*"); Regex regexLetra = new Regex(@".*[a-zA-z].*"); Match matchNumero = regexNumero.Match(newPwdTextBox.Text); Match matchLetra = regexLetra.Match(newPwdTextBox.Text); if (newPwdTextBox.Text.Length >= 6 && matchNumero.Success && matchLetra.Success) { if (juez != null) { juez.Password = sha256(newPwdTextBox.Text); if (InformacionPersonalJuezService.UpdateJuez(juez)) { MasterPage.ShowMessage("Aviso", "Contraseña cambiada con éxito."); } else { LoadJudgeInformation(sUserId); } } } else { MasterPage.ShowMessage("Error", "Contraseña debe ser de al menos 6 caracteres y debe contener al menos un número y una letra."); } } else { MasterPage.ShowMessage("Error", "Contraseñas no coinciden."); } } else if (sUserType.Equals("candidato")) { var candidato = InformacionPersonalCandidatoService.GetCandidatoById(sUserId); if (newPwdTextBox.Text == confirmNewPwdTextBox.Text) { Regex regexNumero = new Regex(@".*\d.*"); Regex regexLetra = new Regex(@".*[a-zA-z].*"); Match matchNumero = regexNumero.Match(newPwdTextBox.Text); Match matchLetra = regexLetra.Match(newPwdTextBox.Text); if (newPwdTextBox.Text.Length >= 6 && matchNumero.Success && matchLetra.Success) { if (candidato != null) { candidato.Password = sha256(newPwdTextBox.Text); if (InformacionPersonalCandidatoService.UpdateCandidato(candidato)) { MasterPage.ShowMessage("Aviso", "Contraseña cambiada con éxito."); } else { LoadCandidateInformation(sUserId); } } } else { MasterPage.ShowMessage("Error", "Contraseña debe ser de al menos 6 caracteres y debe contener al menos un número y una letra."); } } else { MasterPage.ShowMessage("Error", "Contraseñas no coinciden."); } } ResetFields(); }