protected void btnLoguear_Click(object sender, EventArgs e) { BL_CodigoAleatorio blCodAleatorio = new BL_CodigoAleatorio(); BL_Cliente blCliente = new BL_Cliente(); EN_CodigoAleatorio enCodAleatorio = new EN_CodigoAleatorio(); EN_Cliente enCliente = new EN_Cliente(); try { //String recaptchaResponse = Request.Form.Get("g-recaptcha-response"); //Response.Write("<script> alert('Iniicio') </script>"); Captcha2.ValidateCaptcha(txtCaptcha2.Text.Trim()); Boolean b = Captcha2.UserValidated; //Response.Write("<script> alert('" + recaptchaResponse + "') </script>"); if (!this.checkBoxLogin.Checked) { if (this.txtNroPromocional != null && !String.IsNullOrEmpty(this.txtNroPromocional.Text)) { if (b) //recaptchaResponse != null && !recaptchaResponse.Equals("")) { enCodAleatorio.NroCodigoAleatorio = this.txtNroPromocional.Text; //String codTipoApuesta = blCodAleatorio.BL_validarCodigoJugadoResultadoListo(enCodAleatorio); //if (String.IsNullOrEmpty(codTipoApuesta)) //{ String textError = blCodAleatorio.BL_validarCodigoIngresado(enCodAleatorio); if (!String.IsNullOrEmpty(textError)) { Response.Write("<script> alert('" + textError + "') </script>"); } else { BL_Util.guardarCookie(HttpContext.Current, EN_Constante.nombreCookieCodAleatorio, enCodAleatorio.NroCodigoAleatorio); //String valor = HttpContext.Current.Session[EN_Constante.nombreCookieCodAleatorio].ToString(); Response.Redirect("InicioAG.aspx", false); } //} //else // irAResultados(codTipoApuesta, enCodAleatorio); } else { Response.Write("<script> alert('Ingrese Código de Seguridad Correcto') </script>"); } } else { Response.Write("<script> alert('Ingresar Codigo Promocional') </script>"); } } else { enCliente.NroDocumento = this.textNroDocumento.Text.ToString(); enCliente.Contrasena = this.textContrasenha.Text.ToString(); String textError = blCliente.BL_validarUsuarioIngresado(enCliente); if (!String.IsNullOrEmpty(textError)) { Response.Write("<script> alert('" + textError + "') </script>"); } else { if (this.txtNroPromocional != null && !String.IsNullOrEmpty(this.txtNroPromocional.Text)) { enCodAleatorio.NroCodigoAleatorio = this.txtNroPromocional.Text; textError = blCodAleatorio.BL_validarCodigoIngresado(enCodAleatorio); //String codTipoApuesta = blCodAleatorio.BL_validarCodigoJugadoResultadoListo(enCodAleatorio); //if (String.IsNullOrEmpty(codTipoApuesta)) //{ if (!String.IsNullOrEmpty(textError)) { Response.Write("<script> alert('" + textError + "') </script>"); } else { if (b) //recaptchaResponse != null && !recaptchaResponse.Equals("")) { BL_Util.guardarCookie(HttpContext.Current, EN_Constante.nombreCookieCodAleatorio, enCodAleatorio.NroCodigoAleatorio); BL_Util.guardarCookie(HttpContext.Current, EN_Constante.nombreCookieNroDoc, enCliente.NroDocumento); Response.Redirect("InicioAG.aspx", false); } else { Response.Write("<script> alert('Ingrese Código de Seguridad Correcto') </script>"); } } //} //else // irAResultados(codTipoApuesta, enCodAleatorio); } else { if (b) //recaptchaResponse != null && !recaptchaResponse.Equals("")) { BL_Util.guardarCookie(HttpContext.Current, EN_Constante.nombreCookieNroDoc, enCliente.NroDocumento); Response.Redirect("InicioAG.aspx", false); } else { Response.Write("<script> alert('Ingrese Código de Seguridad Correcto') </script>"); } } } } } catch (Exception ex) { Response.Write("<script> alert('Hubo problemas...') </script>"); } finally { } }