示例#1
0
 protected void Register_Click(object sender, EventArgs e)
 {
     try
     {
         if (Page.IsValid && Captcha1.Validate(TextBox6.Text))
         {
             SqlCommand cmd = new SqlCommand("insert into register values(@Name,@Phone,@Email,@Password);", con);
             cmd.Parameters.AddWithValue("@Name", TextBox1.Text);
             cmd.Parameters.AddWithValue("@Phone", TextBox2.Text);
             cmd.Parameters.AddWithValue("@Email", TextBox3.Text);
             cmd.Parameters.AddWithValue("@Password", TextBox4.Text);
             cmd.ExecuteNonQuery();
             Response.Write("<script>alert('Registration successful');</script>");
             TextBox1.Text = TextBox2.Text = TextBox3.Text = TextBox4.Text = TextBox5.Text = TextBox6.Text = "";
         }
         else
         {
             Response.Write("Registration Fails");
         }
     }
     catch (Exception e1)
     {
         Response.Write(e1.Message);
     }
     finally
     {
         con.Close();
     }
 }
示例#2
0
 protected void btn_submit_Click(object sender, EventArgs e)
 {
     if (Session["CheckRefresh"].ToString() == ViewState["CheckRefresh"].ToString())
     {
         Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());
         if (Page.IsValid)
         {
             Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim());
             if (Captcha1.UserValidated)
             {
                 ReturnClass.ReturnBool rb = new ReturnClass.ReturnBool();
                 bl_feedback            bl = new bl_feedback();
                 dl_feedback            dl = new dl_feedback();
                 bl.Feedback = txt_feedback.Text;
                 bl.Userid   = Session["username"].ToString();
                 bl.Subject  = ddl_subject.SelectedValue;
                 bl.Specify  = txt_sub.Text;
                 rb          = dl.insert_feedback(bl);
                 if (rb.status == true)
                 {
                     Utilities.MessageBox_UpdatePanel_Redirect(udp, "We Recieve Your FeedBack This Is Valuable For Us, We Will Response You Soon Thank You.", "../user/user_detail.aspx");
                 }
                 else
                 {
                     Utilities.MessageBox_UpdatePanel(udp, "Your Feed Back Is Not Registered");
                 }
             }
             else
             {
                 Utilities.MessageBox_UpdatePanel(udp, "Please Enter Right Security code");
             }
         }
     }
 }
    protected void btnSubmitFeedbck_Click(object sender, EventArgs e)
    {
        Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim());

        if (Captcha1.UserValidated)
        {
            objDAEntities.EnquiryTypeId = AppGlobal.FeedbackId;
            objDAEntities.Name          = txtName.Text.Trim();
            objDAEntities.Gender        = rdoGenderCom.SelectedItem.Text;
            objDAEntities.MobileNo      = txtMobile.Text.Trim();
            objDAEntities.Email         = txtEmail.Text;
            objDAEntities.Description   = txtFeedBack.Text;


            objBusinessLogic.SaveAllTypeEnquiry(objDAEntities);
            Response.Write("<script LANGUAGE='JavaScript'>alert('Query Save Successful')</script>");
            txtName.Text     = String.Empty;
            txtEmail.Text    = string.Empty;
            txtFeedBack.Text = String.Empty;
            txtCaptcha.Text  = String.Empty;
        }

        else
        {
            // Label1.ForeColor = System.Drawing.Color.Red;

            // Label1.Text = "You have Entered InValid Captcha Characters please Enter again";
            FillCapctha();
        }
    }
示例#4
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            int hata = 0;

            if (Session["hataligiris"] != null)
            {
                hata = Convert.ToInt16(Session["hataligiris"].ToString());
                if (hata > 2)
                {
                    Panel_captcha.Style.Add("display", "block");
                    Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim());
                    if (Captcha1.UserValidated)
                    {
                        giris();
                    }
                    else
                    {
                        lblgirisdurum.Text = "Kod hatalıdır";
                    }
                }
                else
                {
                    giris();
                }
            }
            else
            {
                giris();
            }
        }
        protected void DoRegister(object sender, EventArgs e)
        {
            MMServiceReference1.Service1Client prox = new MMServiceReference1.Service1Client();
            string Fname = FirstName.Text;
            string Lname = LastName.Text;
            string pass1 = PassWord1.Text;
            string pass2 = PassWord2.Text;
            string email = Email.Text;

            Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim());
            if (pass1 == pass2 && Captcha1.UserValidated)
            {
                string encryptedPass = prox.Encryption(pass1);

                string fullString = Fname + "," + Lname + "," + email + "," + encryptedPass;

                if (prox.write2XML("member.xml", fullString))
                {
                    PassResponse.Text = "Account Created";
                }
                else
                {
                    PassResponse.Text = "Account Not Created";
                }
            }
            else
            {
                PassResponse.Text = "Passwords do not match.";
            }
        }
示例#6
0
 protected void lknGuardar_Click(object sender, EventArgs e)
 {
     if (txtCaptcha.Text != "")
     {
         Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim());
         if (Captcha1.UserValidated)
         {
             AdminUsuarios admin = new AdminUsuarios();
             if (Session["user"] == null)
             {
                 tblUsuarios usu     = new tblUsuarios();
                 string      usuario = Request.QueryString["add"];
                 usu = admin.obtenerUsuarioEncriptado(usuario);
                 admin.actualizarPasswordActivacion(usu.id_usuario, txtPassword.Text);
                 pnlAdvertencia.CssClass  = "alert alert-success alert-dismissible";
                 lblResultadoProceso.Text = "La contraseña ha sido actualizada con exito, Ya puede iniciar Sesió en la plataforma con el nombre de usuario y contraseña correspondientes";
                 pnlAdvertencia.Visible   = true;
             }
             else
             {
                 pnlAdvertencia.CssClass  = "alert alert-success alert-dismissible";
                 lblResultadoProceso.Text = "No se puede Realizar la accion dado que ya ha iniciado sesion con un usuario diferente.";
                 pnlAdvertencia.Visible   = true;
             }
         }
     }
 }
示例#7
0
        protected void OnServerValidate(object source, ServerValidateEventArgs e)
        {
            try
            {
                if (txtUsuario.Text.Trim() == string.Empty || txtpwd.Text.Trim() == string.Empty || txtCaptcha.Text.Trim() == string.Empty)
                {
                    return;
                }
                Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim());
                e.IsValid     = Captcha1.UserValidated;
                _validCaptcha = e.IsValid;
                if (!e.IsValid)
                {
                    List <string> sb = new List <string> {
                        "Captcha incorrecto."
                    };
                    if (sb.Count > 0)
                    {
                        _lstError = sb;
                        throw new Exception("");
                    }
                }
            }
            catch (Exception ex)
            {
                if (_lstError == null)
                {
                    _lstError = new List <string> {
                        ex.Message
                    };
                }

                Alerta = _lstError;
            }
        }
    protected void btnsubmit_Click(object sender, EventArgs e)
    {
        WebService    ws        = new WebService();
        SqlConnection hookUp    = new SqlConnection(ConfigurationManager.ConnectionStrings["DatabaseConnectionString"].ConnectionString);
        string        strInsert = "INSERT INTO tbl_kyqja(username,emri,mbiemri,fjalekalimi,datelindja,gjinia,email)" +
                                  " VALUES (@Username,@FName,@LName,@Password,@Birthdate,@Genre,@Email)";

        SqlCommand sqlCmd = new SqlCommand(strInsert, hookUp);

        sqlCmd.Parameters.Add("@Username", txtuser.Text);
        sqlCmd.Parameters.Add("@Password", ws.Encrypt(txtpwd.Text.Trim()));
        sqlCmd.Parameters.Add("@Birthdate", Birthdate.Text);
        sqlCmd.Parameters.Add("@Genre", Genre.SelectedValue);
        sqlCmd.Parameters.Add("@FName", txtfname.Text);
        sqlCmd.Parameters.Add("@LName", txtlname.Text);
        sqlCmd.Parameters.Add("@Email", txtemail.Text);



        Captcha1.ValidateCaptcha(txtcaptcha.Text.Trim());
        if (!Captcha1.UserValidated)
        {
            lblErrcaptcha.Text = "Captcha nuk eshte shenuar mire";
        }
        else
        {
            hookUp.Open();
            sqlCmd.ExecuteNonQuery();
            Session["name"] = txtuser.Text;
            hookUp.Close();
            Response.Redirect("LogIn.aspx");
        }
    }
 protected void btn_update_Click(object sender, EventArgs e)
 {
     if (Session["CheckRefresh"].ToString() == ViewState["CheckRefresh"].ToString())
     {
         Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());
         if (Page.IsValid)
         {
             Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim());
             if (Captcha1.UserValidated)
             {
                 string OTP = Session["OTP"].ToString();
                 if (txt_otp.Text == OTP)
                 {
                     HttpBrowserCapabilities browse = Request.Browser;
                     if (txt_new_pass.Text == txt_repass.Text)
                     {
                         bl.UserID       = Session["user"].ToString();
                         dt              = dl.select_password_by_username(bl);
                         Session["pass"] = dt.table.Rows[0]["Password"].ToString();
                         bl.NewPass      = ul.GenerateMd5Hash(txt_new_pass.Text);
                         dt              = dl.select_password_log(bl);
                         if (dt.table.Rows.Count == 0)
                         {
                             bl.UserID         = Session["user"].ToString();
                             bl.Password       = Session["pass"].ToString();
                             bl.NewPass        = ul.GenerateMd5Hash(txt_new_pass.Text);
                             bl.UserIP         = ul.GetClientIpAddress(this.Page);
                             bl.UserAgent      = Request.UserAgent.ToString();
                             bl.UserOS         = Utilities.System_Info(this.Page);
                             bl.User_browser   = browse.Browser;
                             bl.PasswordChange = "Y";
                             rb = dl.update_password(bl);
                             if (rb.status == true)
                             {
                                 Utilities.MessageBoxShow_Redirect("Your Password Update Successful Please Login Again", "../LogOut.aspx");
                             }
                             else
                             {
                                 Utilities.MessageBoxShow("Password Update Unsuccessful");
                             }
                         }
                         else
                         {
                             Utilities.MessageBoxShow("Your New Password Looks Like Your Old Password Please Create Unique Password");
                         }
                     }
                     else
                     {
                         Utilities.MessageBoxShow("Your New Password Does Not Match With Your Repeated Password Please Check");
                     }
                 }
                 else
                 {
                     Utilities.MessageBoxShow("You Entered Wrong OTP Please Enter Right OTP");
                 }
             }
         }
     }
 }
示例#10
0
 private bool ValidateCaptcha()
 {
     Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim());
     if (Captcha1.UserValidated)
     {
         return(true);
     }
     return(false);
 }
 protected void ValidateCaptcha(object sender, ServerValidateEventArgs e)
 {
     Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim());
     e.IsValid = Captcha1.UserValidated;
     if (e.IsValid)
     {
         //ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Valid Captcha!');", true);
     }
 }
示例#12
0
 protected void btnRegisteration_Click(object sender, EventArgs e)
 {
     try
     {
         if (Captcha1.IsValid == false)
         {
             litInfo.Text = "Invalid verification code! Please check.";
             Captcha1.Generate();
             Captcha1.Clear();
             RequiredFieldValidator2.ErrorMessage = "";
             return;
         }
         else
         {
             if (txt_NEmail.Text != "")
             {
                 Captcha1.Generate();
                 SqlConnection con = DataAccess.GetConnction();
                 DataTable     dt  = new DataTable();
                 SqlCommand    cmd = new SqlCommand("Usp_ValidateOneTimePassword", con);
                 cmd.CommandType = System.Data.CommandType.StoredProcedure;
                 cmd.Parameters.Add(new SqlParameter {
                     ParameterName = "@UserEmail", DbType = DbType.String, Value = txt_NEmail.Text
                 });
                 cmd.Parameters.Add(new SqlParameter {
                     ParameterName = "@LoginId", DbType = DbType.String, Value = txtloginId.Text
                 });
                 cmd.Parameters.Add(new SqlParameter {
                     ParameterName = "@OneTimePassword", DbType = DbType.String, Value = txtotp.Text
                 });
                 using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                 {
                     da.Fill(dt);
                 }
                 if (dt.Rows.Count > 0)
                 {
                     Session["UserEmail"] = txt_NEmail.Text;
                     Session["LoginID"]   = txtloginId.Text;
                     ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('One Time Password (OTP) is Successfully Verified');window.location ='PublicUser.aspx';", true);
                 }
                 else
                 {
                     Alert.show("One Time Password (OTP) is incorrect");
                 }
             }
             else
             {
                 txt_NEmail.Focus();
                 Alert.show("Email ID is Mandatory Fields!");
             }
         }
     }
     catch (Exception ex)
     {
         LogError(ex);
     }
 }
 protected void ValidateCaptcha(object sender, ServerValidateEventArgs e)
 {
     Captcha1.ValidateCaptcha(txt_Captcha.Text.Trim());
     e.IsValid = Captcha1.UserValidated;
     if (e.IsValid)
     {
         captcha = e.IsValid.ToString();
     }
 }
        //Authentification backoffice (vérification)
        protected void btnVerify_Click(object sender, EventArgs e)
        {
            if (txtUsername.Text != "" && txtPassword.Text != "" && txtCaptcha.Text != "")
            {
                string Login = txtUsername.Text;

                string Password = this.Hash(txtPassword.Text);


                string _req = "select userbackofficeid,email,prenom from userbackoffice where login='******' and pwd='" + Password + "' and actif='1'";


                List <string> usrId = this.Authentification(_req);

                // les champs login , mot de passe et code ont été saisi
                if (usrId.Count == 3)
                {
                    Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim());
                    // En cas de saisie valide
                    if (Captcha1.UserValidated)
                    {
                        StatusBar.Text = "<img src=\"../../Ressources/Images/ajax-loader.gif\" style=\"margin-right:8px;\" /> Chargement";
                        _user.setClientId(0);
                        _user.setUserId(0);
                        _user.setTypeCompte(1);
                        _user.setRevendeurId(-1);
                        _user.setRevendeur("");
                        _user.setBackOfficeId(int.Parse(usrId.ElementAt(0)));
                        _user.setBackOffice(usrId.ElementAt(1).ToString());
                        new PageBase().setCurrentUser(_user);
                        //Redirection page client
                        Response.Redirect("../Client/Client.aspx");
                    }
                    // Dans le cas où le login est invalide
                    else
                    {
                        StatusBar.ForeColor = System.Drawing.Color.Red;
                        StatusBar.Text      = "<img src=\"../../Ressources/Images/exclamation.png\" style=\"margin-right:8px;\" /> Le code saisie est InValid";
                        txtCaptcha.Text     = "";
                    }
                }
                //Dans le ca où  login et mot de passe ne sont pas  valides
                else
                {
                    txtCaptcha.Text     = "";
                    StatusBar.ForeColor = System.Drawing.Color.Red;
                    StatusBar.Text      = "<img src=\"../../Ressources/Images/exclamation.png\" style=\"margin-right:8px;\" /> Le login ou/et le mot de passe saisie est incorrect !!";
                }
            }
            // Dans le cas où il n'y apas de saisie
            else
            {
                StatusBar.ForeColor = System.Drawing.Color.Red;
                StatusBar.Text      = "<img src=\"../../Ressources/Images/exclamation.png\" style=\"margin-right:8px;\" />Les champs login, mot de passe et code sont obligatoire !!";
            }
        }
示例#15
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         if (Captcha1.IsValid == false)
         {
             //AuditLogModule.LogEntry("Captcha code didn't match!", txtLoginId.Text)
             litInfo.Text = "Invalid verification code! Please check.";
             Captcha1.Generate();
             return;
         }
         Captcha1.Generate();
     }
 }
示例#16
0
 protected void ValidateCaptcha(object sender, ServerValidateEventArgs e)
 {
     Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim());
     e.IsValid = Captcha1.UserValidated;
     if (e.IsValid)
     {
         this.uploadFiles();
     }
     else
     {
         this.txtCaptcha.Text       = "";
         this.CustomValidator1.Text = "Captcha mismatch.";
     }
 }
 protected void ValidateCaptcha(object sender, ServerValidateEventArgs e)
 {
     Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim());
     e.IsValid = Captcha1.UserValidated;
     if (e.IsValid)
     {
         btnLogin_Click(sender, e);
     }
     else
     {
         if (captcha.tentativaSenha != 3)
         {
             string capErro = "UIkit.notify({message : 'Por favor, digite o código captcha corretamente!',status  : 'danger',timeout : 6000,pos: 'bottom-right'});";
             ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "loginCampos", capErro, true);
         }
         txtCaptcha.Text = "";
     }
 }
示例#18
0
 protected void btn_Solicitar_Click(object sender, EventArgs e)
 {
     Captcha1.ValidateCaptcha(txt_Captcha.Value.Trim());
     if (Captcha1.UserValidated)
     {
         lblMessage.Text = "Solicitud No Enviada";
         Clases.SolicitarCita sC = new Clases.SolicitarCita();
         if (sC.agregarSolicitud(HttpContext.Current.Session["Cod_Usuario"].ToString()))
         {
             lblMessage.Text = "Solicitud Enviada";
         }
     }
     else
     {
         lblMessage.ForeColor = System.Drawing.Color.Red;
         lblMessage.Text      = "Captcha Invalido";
     }
 }
示例#19
0
 protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
 {
     if (txtCaptcha.Text != "")
     {
         Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim());
         if (Captcha1.UserValidated)
         {
             AdminUsuarios aU = new AdminUsuarios();
             if (aU.validarUsuarioEmpresa(txtUsername.Text))
             {
                 lblUserExiste.Visible = false;
                 int idEmpresa = aU.insertarEmpresa(txtNombre.Text, txtDDTipoId.SelectedValue, txtIdentificacion.Text,
                                                    txtDireccion.Text, txtContacto.Text, txtTelefono.Text, txtCelular.Text, txtMail.Text);
                 if (idEmpresa > 0)
                 {
                     int idSucursal = aU.insertarSucursalPrincipal(idEmpresa);
                     int idUsuario  = aU.insertarUsuario(txtIdUsuario.Text, txtUNombres.Text, txtApellidos.Text,
                                                         txtUCelular.Text, txtPassword.Text, 4, idSucursal, txtUsername.Text, txtUEmail.Text);
                     if (idUsuario > 0)
                     {
                         pnlProgress2.CssClass    = "progress-bar  progress-bar-striped progress100";
                         pnlAdvertencia.CssClass  = "alert alert-success alert-dismissible";
                         lblResultadoProceso.Text = "Usuario Creado Con Exito... Se enviara un correo para la activacion de la cuenta";
                         pnlAdvertencia.Visible   = true;
                     }
                 }
             }
             else
             {
                 lblUserExiste.Visible = true;
             }
             lblMessage.Text = "";
         }
         else
         {
             lblMessage.Text = "Captcha Incorrecto";
         }
     }
     else
     {
         lblMessage.Text = "Ingrese el Captcha";
     }
 }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim());

        if (Captcha1.UserValidated)
        {
            User user = ConnectionClass.LoginUser(txtName.Text, txtPassword.Text);
            if (user != null)
            {
                if (user.Role == "client")
                {
                    if (user.Active == 1)
                    {
                        Session["login"] = user.UserName;
                        Response.Redirect("Default.aspx");
                    }
                    else
                    {
                        lblError.ForeColor = System.Drawing.Color.Red;
                        lblError.Text      = "User is not Active, Contact your consultant";
                    }
                }
                else
                {
                    Session["admin"] = user.UserName;
                    Response.Redirect("~/Admin/AdminHome.aspx");
                }
            }
            else
            {
                lblError.ForeColor = System.Drawing.Color.Red;
                lblError.Text      = "Username and Password didn't match";
                txtName.Text       = "";
            }
        }

        else
        {
            lblError.ForeColor = System.Drawing.Color.Red;
            lblError.Text      = "Invalid characters. Try Again!";
            txtName.Text       = "";
        }
    }
示例#21
0
 protected void ValidateCaptcha(object sender, ServerValidateEventArgs e)
 {
     if (this.txtdni != null && !String.IsNullOrEmpty(this.txtdni.Text))
     {
         Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim());
         e.IsValid = Captcha1.UserValidated;
         if (e.IsValid)
         {
             //Response.Write("<script> alert('validateCaptchaTrue ...') </script>");
             //ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Valid Captcha!');", true);
         }
         else
         {
             validaCaptcha        = false;
             this.txtCaptcha.Text = null;
             Response.Write("<script> alert('Código de seguridad incorrecto! Vuelva a intentarlo...') </script>");
         }
     }
 }
    protected void btnSubmitComp_Click(object sender, EventArgs e)
    {
        Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim());

        if (Captcha1.UserValidated)
        {
            objDAEntities.EnquiryTypeId = AppGlobal.Complaint;
            objDAEntities.Name          = txtName.Text.Trim();
            objDAEntities.Email         = txtEmail.Text;
            objDAEntities.Description   = txtComplaint.Text;


            objBusinessLogic.SaveAllTypeEnquiry(objDAEntities);
            Response.Write("<script LANGUAGE='JavaScript'>alert('Query Save Successful')</script>");
            txtName.Text      = String.Empty;
            txtEmail.Text     = string.Empty;
            txtComplaint.Text = String.Empty;
            txtCaptcha.Text   = String.Empty;
        }
    }
示例#23
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        Captcha1.ValidateCaptcha(txtcaptcha.Value.Trim());
        if (Captcha1.UserValidated)
        {
            string sub  = "شکابت" + " از طرف " + txtName.Value + "-" + txtPhone.Value;
            string body = txtmessage.Value;
            if (SendingMail("*****@*****.**", "*****@*****.**", sub, body))

            {
                System.Windows.Forms.MessageBox.Show("شکابت شما ارسال گردید");
                txtmessage.Value = "";
                txtName.Value    = "";
                txtPhone.Value   = "";
                txtcaptcha.Value = "";
            }
        }
        else
        {
            System.Windows.Forms.MessageBox.Show("شکابت شما ارسال نه گردید");
        }
    }
 protected void btnRegistrar_Click(object sender, EventArgs e)
 {
     Captcha1.ValidateCaptcha(txtCaptcha.Text.ToUpper());//Validando - CAPTCHA********************//**//***
     if (Captcha1.UserValidated)
     {
         Captcha1.Visible = true;
         obje.UserName    = txtusuarioNombre.Text;
         obje.Password    = txtpasswordUsuario.Text;
         List <LoguearUsuario> logueo = objn.Validar_Usuario(obje);
         if (logueo.Count > 0)
         {
             if (logueo[0].IdUsuario == "00000000-0000-0000-0000-000000000001")//Administrador
             {
                 Session["Usuario"]  = logueo[0].NombreUsuario;
                 Session["Password"] = txtpasswordUsuario.Text;
                 Response.Redirect("afiliados.aspx");
             }
             else
             {
                 string RolId = logueo[0].IdUsuario;
                 Session["Usuario"]  = logueo[0].NombreUsuario;
                 Session["Password"] = txtpasswordUsuario.Text;
                 Response.Redirect("afiliados.aspx?Tipo=" + RolId);
             }
         }
         else
         {
             txtmensaje.Text = "El nombre de usuario o contraseña es incorrecta ";
             string jss = "openModal()";
             ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", jss, true);
         }
     }
     else
     {
         return;
     }
 }
    protected void btn_submit_Click(object sender, EventArgs e)
    {
        if (Session["CheckRefresh"].ToString() == ViewState["CheckRefresh"].ToString())
        {
            Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());
            if (Page.IsValid)
            {
                Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim());
                if (Captcha1.UserValidated)
                {
                    if (btn_submit.Text == "Submit")
                    {
                        bl.UserID = txt_Userid.Text;
                        rd        = dl.CheckUserID(bl);


                        if (rd.table.Rows.Count == 0)
                        {
                            HttpBrowserCapabilities browse = Request.Browser;
                            bl.RegistrationID = dl.Get_unique_Registration_code();
                            bl.Password       = ul.GenerateMd5Hash(txt_password.Text);
                            bl.NameHindi      = "";
                            bl.NameEnglish    = txt_first_name.Text;
                            bl.Gender         = ddl_gender.SelectedValue;
                            bl.MobileNo       = txt_mobile.Text;
                            bl.EmailID        = txt_email.Text;
                            bl.Address        = txt_Address.Text;
                            if (ddl_country.SelectedValue == "091")
                            {
                                bl.Country_name = txtState_Other.Text;
                                bl.Country      = ddl_country.SelectedValue;
                                bl.Statecode    = ddl_state.SelectedValue;
                                bl.DistrictCode = ddl_district.SelectedValue;
                                bl.DistrictName = txt_Districtname.Text;
                            }
                            else
                            {
                                bl.Country_name = txtState_Other.Text;
                                bl.Statecode    = "";
                                bl.Country      = ddl_country.SelectedValue;
                                bl.DistrictCode = "";
                            }
                            bl.PinCode           = txt_pincode.Text;
                            bl.IsValid           = "N";
                            bl.UserType          = ddl_usertype.SelectedValue;
                            bl.Registration_Year = DateTime.Now.Year.ToString();
                            bl.UserIP            = ul.GetClientIpAddress(this.Page);
                            bl.UserAgent         = Request.UserAgent.ToString();
                            bl.UserOS            = Utilities.System_Info(this.Page);



                            bl.User_browser = browse.Browser;
                            rb = dl.Insert_user_Registration(bl);
                            if (rb.status == true)
                            {
                                Session["username"] = bl.UserID;
                                Session["REGID"]    = bl.RegistrationID;
                                //  Response.Redirect("User_Mobile_Varification.aspx?mobile=" + bl.MobileNo + "&RegistrationID=" + bl.RegistrationID + "");
                                Utilities.MessageBox_UpdatePanel_Redirect(udp_farm, "You Are Registered In Our Server You Need To Varify Your Mobile To activate Yor Login ID, We Are Redirecting To Our Varification Page", "user/User_Mobile_Varification.aspx");
                            }
                            else
                            {
                                Utilities.MessageBoxShow("registration Unsuccessful");
                            }
                        }
                        else
                        {
                            Utilities.MessageBoxShow("User ID Not Available Please Choose Another UserID");
                        }
                    }
                }
                else
                {
                    Utilities.MessageBox_UpdatePanel(udp_farm, "Invalid Captcha");
                }
            }
        }
    }
示例#26
0
 protected void btn_update_Click(object sender, EventArgs e)
 {
     if (Session["CheckRefresh"].ToString() == ViewState["CheckRefresh"].ToString())
     {
         Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());
         if (Page.IsValid)
         {
             Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim());
             if (Captcha1.UserValidated)
             {
                 string OTP = Session["OTP"].ToString();
                 if (txt_otp.Text == OTP)
                 {
                     HttpBrowserCapabilities browse = Request.Browser;
                     if (txt_new_pass.Text == txt_repass.Text)
                     {
                         bl.UserID       = Session["user"].ToString();
                         dt              = dl.select_password_by_username(bl);
                         Session["pass"] = dt.table.Rows[0]["Password"].ToString();
                         bl.NewPass      = ul.GenerateMd5Hash(txt_new_pass.Text);
                         dt              = dl.select_password_log(bl);
                         if (dt.table.Rows.Count == 0)
                         {
                             bl.UserID         = Session["user"].ToString();
                             bl.RegistrationID = bl.UserID;          //Added by Naveen on 09-sep-2017
                             bl.Password       = Session["pass"].ToString();
                             bl.NewPass        = ul.GenerateMd5Hash(txt_new_pass.Text);
                             bl.UserIP         = ul.GetClientIpAddress(this.Page);
                             bl.UserAgent      = Request.UserAgent.ToString();
                             bl.UserOS         = Utilities.System_Info(this.Page);
                             bl.User_browser   = browse.Browser;
                             bl.PasswordChange = "Y";
                             rb = dl.update_password(bl);
                             if (rb.status == true)
                             {
                                 if (Session["language"].ToString() == "en-GB")
                                 {
                                     Utilities.MessageBoxShow_Redirect("Your Password Updated Successfully, Please Login Again", "LogOut.aspx");
                                 }
                                 else
                                 {
                                     Utilities.MessageBoxShow_Redirect("आपका पासवर्ड सफलतापूर्वक अपडेट किया गया, कृपया फिर से लॉगिन करें", "LogOut.aspx");
                                 }
                                 // Utilities.MessageBoxShow_Redirect("Your Password Update Successful Please Login Again", "../LogOut.aspx");
                             }
                             else
                             {
                                 if (Session["language"].ToString() == "en-GB")
                                 {
                                     Utilities.MessageBoxShow("Password Update Unsuccessful");
                                 }
                                 else
                                 {
                                     Utilities.MessageBoxShow("पासवर्ड अपडेट असफल");
                                 }
                                 // Utilities.MessageBoxShow("Password Update Unsuccessful");
                             }
                         }
                         else
                         {
                             if (Session["language"].ToString() == "en-GB")
                             {
                                 Utilities.MessageBoxShow("Your New Password Looks Like Your Old Password, Please Create Unique Password");
                             }
                             else
                             {
                                 Utilities.MessageBoxShow("आपका नया पासवर्ड आपके पुराने पासवर्ड की तरह दिखता है, कृपया अद्वितीय पासवर्ड बनाएं");
                             }
                             // Utilities.MessageBoxShow("Your New Password Looks Like Your Old Password Please Create Unique Password");
                         }
                     }
                     else
                     {
                         if (Session["language"].ToString() == "en-GB")
                         {
                             Utilities.MessageBoxShow("Your New Password Does Not Match With Your Repeated Password, Please Check");
                         }
                         else
                         {
                             Utilities.MessageBoxShow("आपका नया पासवर्ड आपके दोहराए गए पासवर्ड से मेल नहीं खाता, कृपया चेक करें");
                         }
                         //Utilities.MessageBoxShow("Your New Password Does Not Match With Your Repeated Password Please Check");
                     }
                 }
                 else
                 {
                     if (Session["language"].ToString() == "en-GB")
                     {
                         Utilities.MessageBoxShow("You have Entered Wrong OTP, Please Enter Right OTP");
                     }
                     else
                     {
                         Utilities.MessageBoxShow("आपने गलत OTP दर्ज किया है, कृपया सही OTP दर्ज करें");
                     }
                     // Utilities.MessageBoxShow("You Entered Wrong OTP Please Enter Right OTP");
                 }
             }
             else
             {
                 if (Session["language"].ToString() == "en-GB")
                 {
                     Utilities.MessageBoxShow("Incorrect Security Code");
                 }
                 else
                 {
                     Utilities.MessageBoxShow("गलत सुरक्षा कोड");
                 }
             }
         }
     }
 }
    protected void forgot_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            try
            {
                if (Session["CheckRefresh"] != null)
                {
                    if (Session["CheckRefresh"].ToString() == ViewState["CheckRefresh"].ToString())
                    {
                        Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());

                        bool cptch_expired = false;
                        try
                        {
                            Captcha1.ValidateCaptcha(txt_captcha.Text.Trim());
                        }
                        catch { cptch_expired = true; }
                        txt_captcha.Text = "";

                        if (!cptch_expired)
                        {
                            if (Captcha1.UserValidated)
                            {
                                Captcha1.DataBind();
                                bl.Cell_No  = txt_login.Text.Trim();
                                bl.Verified = "Y";
                                dt          = dl.user_login_details_for_forgot_password(bl);
                                if (dt.table.Rows.Count > 0)
                                {
                                    Session["Mobile_No"]    = bl.Cell_No;
                                    Session["Reset_Method"] = "Y";
                                    Random randomclass = new Random();
                                    Int32  rno1        = randomclass.Next(1000000, 9999999);
                                    string random      = Convert.ToString(rno1);
                                    string rno         = random.ToString();
                                    bl.Success = send_sms(rno, bl.Cell_No);
                                    rb         = dl.sms_log(bl);

                                    Utilities.MessageBox_UpdatePanel_Redirect(UpdatePanel2, "OTP has been sent to Your Mobile Number", "OtpVerification_Reg.aspx");
                                }
                                else
                                {
                                    Utilities.MessageBox_UpdatePanel(UpdatePanel2, "Please check your mobile number.");
                                }
                            }
                            else
                            {
                                Utilities.MessageBox_UpdatePanel(UpdatePanel2, "Invalid Captcha!!! Please enter same characters as you see in image.");
                            }
                        }
                        else
                        {
                            Utilities.MessageBox_UpdatePanel(UpdatePanel2, "Captcha Expired!!! Please re open this page in new window.");
                        }
                    }
                    else
                    {
                        Utilities.MessageBox_UpdatePanel(UpdatePanel2, "Page Refresh or Back button is now allowed");
                    }
                }
                else
                {
                    Utilities.MessageBox_UpdatePanel(UpdatePanel2, "Page expired!!! Please re open this page in new window.");
                }
            }
            catch (NullReferenceException)
            {
                Utilities.MessageBox_UpdatePanel_Redirect(UpdatePanel2, "Your Session Has Expired Please Login Again", "../Logout.aspx");
            }
        }
    }
    protected void Signup_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            try
            {
                if (ChkContent.Checked)
                {
                    if (Session["CheckRefresh"] != null)
                    {
                        if (Session["CheckRefresh"].ToString() == ViewState["CheckRefresh"].ToString())
                        {
                            Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());
                            Captcha1.ValidateCaptcha(txt_captcha.Text.Trim());
                            txt_captcha.Text = "";
                            if (Captcha1.UserValidated)
                            {
                                Captcha1.DataBind();
                                bl.Name                      = txt_first_Name.Text.Trim();
                                bl.Last_name                 = txt_last_Name.Text.Trim();
                                bl.Cell_No                   = Mobile.Text.Trim();
                                bl.Email                     = Email.Text.Trim();
                                bl.Password_Plain            = Password.Text.Trim();
                                bl.Password                  = bl.Password_Plain;
                                bl.Applicant_active          = "N";
                                bl.Applicant_mobile_verified = "N";
                                bl.Applicant_email_verified  = "N";
                                bl.Action_Date               = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
                                bl.ClientIp                  = util.GetClientIpAddress(this.Page);
                                bl.User_type                 = user_type.SelectedValue;
                                //   bl.Country_code = ddl_code.SelectedValue;
                                bl.Classes      = ddl_class.SelectedValue;
                                bl.Stream       = ddl_stream.SelectedValue;
                                bl.Country_code = "91";
                                if (bl.User_type == "USER")
                                {
                                    bl.Role_Id = "01";
                                }
                                else if (bl.User_type == "TEA")
                                {
                                    bl.Role_Id = "02";
                                }
                                //if (Request.QueryString["reco"] != null)
                                //{
                                //    string uid = util.Encrypt_AES(Request.QueryString["reco"].ToString(), key);
                                //    //   bl.Refer_code = Request.QueryString["reco"].ToString();
                                //    bl.Refer_code = uid;
                                //}
                                //else
                                //{
                                bl.Refer_code = DBNull.Value.ToString();
                                //}
                                Session["User_type"] = bl.User_type;
                                rb = dl.Insert_user_signup(bl);
                                if (rb.status)
                                {
                                    Session["Mobile_No"] = bl.Cell_No;
                                    Random randomclass = new Random();
                                    Int32  rno1        = randomclass.Next(1000000, 9999999);
                                    string random      = Convert.ToString(rno1);
                                    string rno         = random.ToString();
                                    Session["OTP"] = rno;
                                    //Thread Stamp_Action = new Thread(delegate ()
                                    //{
                                    //    bl.Success = send_sms(rno, bl.Cell_No);
                                    //    rb = dl.sms_log(bl);
                                    //    bl.Type = null;
                                    //    bl.Success = email_to_user(rno, bl.Email);
                                    //    rb = dl.sms_log(bl);
                                    //});
                                    //Stamp_Action.IsBackground = true;
                                    //Stamp_Action.Start();

                                    Utilities.MessageBox_UpdatePanel_Redirect(UpdatePanel2, "Please verify your number with otp to complete the registration process " + rno, "otp_verification.aspx");
                                }
                                else
                                {
                                    Utilities.MessageBox_UpdatePanel(UpdatePanel2, "Records could not be saved: Please Try Again");
                                }
                            }
                            else
                            {
                                Utilities.MessageBox_UpdatePanel(UpdatePanel2, "Invalid Captcha!!! Please enter same characters as you see in image.");
                            }
                        }
                        else
                        {
                            Utilities.MessageBox_UpdatePanel(UpdatePanel2, "Page Refresh or Back button is now allowed");
                        }
                    }
                    else
                    {
                        Utilities.MessageBox_UpdatePanel(UpdatePanel2, "Page expired!!! Please re open this page in new window.");
                    }
                }
                else
                {
                    Utilities.MessageBox_UpdatePanel(UpdatePanel2, "Please check I agree to terms ");
                }
            }
            catch (NullReferenceException)
            {
                Utilities.MessageBox_UpdatePanel_Redirect(UpdatePanel2, "Your Session Has Expired Please Login Again", "../Logout.aspx");
            }
        }
        //else
        //{
        //    //   Utilities.MessageBox_UpdatePanel(UpdatePanel2, "( *  ) Indicates  Mandatory Fields, Please Fill");
        //}
    }
示例#29
0
        protected void cmdDangNhap_Click1(object sender, ImageClickEventArgs e)
        {
            DataSet ds;
            string  userName = txtUserName.Value.Trim().Replace("'", "''");

            if (!VatLid.Utils.KillChars3(userName))
            {
                MessageBox.Show("Tên nhập có ký tự đặc biệt !");
                return;
            }
            Captcha1.ValidateCaptcha(txtMaBaoMat.Value.Trim());

            if (!Captcha1.UserValidated)
            {
                MessageBox.Show("Bạn nhập sai ma capcha !");
                return;
            }

            if (userName.Length == 0)
            {
                MessageBox.Show("Bạn nhập tên đăng nhập !");
                return;
            }

            string Pass = txtPass.Value;

            if (Pass.Length == 0)
            {
                MessageBox.Show("Bạn nhập password !");
                return;
            }

            //ds = VatLid.DAL.SelectCountUserLogin(txtUserName.Value.Trim().Replace("'", "''"));

            //if (ds.Tables[1].Rows.Count > 0)
            //{
            //    if (Convert.ToInt32(ds.Tables[1].Rows[0]["countLog"].ToString()) >= 5)
            //    {
            //        Response.Redirect(VatLid.Variables.sWebRoot + "error_info.aspx?err=36");
            //    }
            //}



            try
            {
                SqlCommand cmd = new SqlCommand();
                cmd.Parameters.AddWithValue("@UserName", userName);
                cmd.Parameters.AddWithValue("@PassMD5", SaltedHash.EncodeMD5(Pass));

                ds = VatLid.DAL.GetDataSet("[cms_userlogin]", VatLid.DAL.getConnectionString1(), cmd);
                DataTable dt = ds.Tables[0];

                userName = VatLid.Utils.safeString(userName);
                if (dt.Rows.Count > 0)
                {
                    Session["USER"]        = txtUserName.Value.Trim();
                    Session["USERGROUPID"] = dt.Rows[0][2].ToString();
                    Session["USERID"]      = dt.Rows[0][0].ToString();
                    Session["USERNAME"]    = dt.Rows[0][1].ToString();
                    Session["PartnerID"]   = dt.Rows[0]["PartnerID"].ToString();


                    //intLoginResult = 1;


                    //if (ds.Tables[2].Rows[0]["isnew"].ToString() == "1")
                    //{
                    //    Response.Redirect("Sys/ChangePw.aspx?acction=1");
                    //}
                    //if (DateTime.Now.Day == 1 && ds.Tables[2].Rows[0]["dateChange"].ToString() == "0")
                    //{
                    //    Response.Redirect("Sys/ChangePw.aspx?acction=2");
                    //}
                    //else
                    //    Response.Redirect("default.aspx");


                    //VatLid.DAL.INSERT_USER_LOG_NEW(VatLid.Utils.getUserId(Session).ToString(), VatLid.LogType.LogIn.ToString(), VatLid.DAL.getCategoryID(FileName), "OK", "0", VatLid.Utils.GetIP());
                    Response.Redirect("default.aspx");
                }
                else
                {
                    Session.Abandon();
                    Session["USER"]     = null;
                    Session["USERNAME"] = "";
                    lblMessage.Text     = "Đăng nhập không thành công !";
                    VatLid.DAL.INSERT_USER_LOG_NEW(VatLid.Utils.getUserId(Session).ToString(), VatLid.LogType.LogIn.ToString(), VatLid.DAL.getCategoryID(FileName), "NOK", "0", VatLid.Utils.GetIP());
                    if (!Page.IsValid)
                    {
                        FormsAuthentication.RedirectFromLoginPage(txtUserName.Value, false);
                    }
                }
            }
            catch (Exception err)
            {
                VatLid.DAL.ExceptionProcess(err);
            }
            finally
            {
                Log_login(intLoginResult);
            }
        }
        protected void btnRegistrar_Click(object sender, EventArgs e)
        {
            using (UserSeguridad_DAO db = new UserSeguridad_DAO())
            {
                try
                {
                    if (chkAcepto.Checked == false)
                    {
                        string jss2 = "openModal()";
                        txtmensaje.Text = "Debe activar la aceptación de terminos y condiciones";
                        ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", jss2, true);
                        return;
                    }

                    if (txtCorreoElectronico.Text != txtCorreoElectronicoConfirmar.Text)
                    {
                        txtmensaje.Text = "Verifique el correo electronico, no coinciden";
                        string jss10 = "openModal()";
                        ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", jss10, true);
                        return;
                    }

                    //if (txtcontraseña.Text != txtconfirmar.Text)
                    //{
                    //    //lblError.Text = "Las contraseñas proporcionadas no coinciden";
                    //    //ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "message();", true);

                    //    txtmensaje.Text = "Las contraseñas proporcionadas no coinciden";
                    //    string jss10 = "openModal()";
                    //    ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", jss10, true);
                    //    return;
                    //}

                    Captcha1.ValidateCaptcha(txtCaptcha.Text.ToUpper());//Validando - CAPTCHA********************//**//***
                    if (Captcha1.UserValidated)
                    {
                        Captcha1.Visible = true;


                        Users oUser = new Users();

                        oUser.Id = GetUniqueKey(128);
                        oUser.ApellidoPaterno    = txtapepaterno.Text;
                        oUser.ApellidoMaterno    = txtapematerno.Text;
                        oUser.Nombre             = txtnombres.Text;
                        oUser.Email              = txtCorreoElectronico.Text;
                        oUser.UserName           = txtCorreoElectronico.Text;
                        oUser.CustomPasswordHash = txtcontraseña.Text;
                        oUser.PasswordHash       = txtcontraseña.Text;
                        oUser.EmailConfirmed     = false;
                        //oUser.TipoDocumento = Convert.ToInt32(ddlTipoDoc.SelectedValue);
                        //oUser.NumeroDocumento = txtnumerodoc.Text;
                        oUser.PhoneNumberConfirmed = false;
                        oUser.TwoFactorEnabled     = false;
                        oUser.LockoutEnabled       = false;
                        oUser.AccessFailedCount    = 0;
                        oUser.Discriminator        = "ApplicationUser";
                        oUser.Password             = txtcontraseña.Text; //txtconfirmar.Text;

                        string iduser = db.Agregar(oUser);

                        Session["usuAfiliacion"] = oUser.Email;
                        EnviarMensajeEmail(oUser.Email, "Hermes Seguros - Confirmacion de Afiliacion", oUser.Id);

                        //txtmensaje.Text = "Se ha enviado un correo de confirmación de usuario al correo electrónico registrado, por favor verifique e ingrese a través del LINK AFILIACIÓN WEB";
                        //string jss3 = "openModal()";
                        //ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", jss3, true);
                        //ROLES
                        string    r  = cUtil.ObtenerValorParametro("CLIENTE", "ROL");
                        UserRoles ur = new UserRoles();
                        ur.RoleId = r;
                        ur.UserId = iduser;
                        db.AgregarRol(ur);

                        //--------------------------------------------------------------------------------------
                        Usuario_DAO    objn = new Usuario_DAO();
                        LoguearUsuario obje = new LoguearUsuario();

                        obje.UserName = txtCorreoElectronico.Text;
                        obje.Password = txtcontraseña.Text;
                        List <LoguearUsuario> logueo = objn.Validar_Usuario(obje);
                        if (logueo.Count > 0)
                        {
                            string RolId = logueo[0].IdUsuario;
                            Session["Usuario"]  = logueo[0].NombreUsuario;
                            Session["Password"] = txtcontraseña.Text;
                            Response.Redirect("afiliados.aspx?Tipo=" + RolId);
                        }
                        //--------------------------------------------------------------------------------------
                        //FINROLES
                    }
                    else
                    {
                        string jss2 = "openModal()";
                        txtmensaje.Text = "El texto de la imagen ingresado es incorrecto.";
                        ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", jss2, true);
                        return;
                    }
                }
                catch (Exception ex)
                {
                    txtmensaje.Text = ex.Message;
                    string jss2 = "openModal()";
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", jss2, true);
                }
            }
        }