Beispiel #1
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 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.";
            }
        }
 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;
             }
         }
     }
 }
Beispiel #4
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;
            }
        }
Beispiel #5
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 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();
        }
    }
    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");
                 }
             }
         }
     }
 }
Beispiel #9
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);
     }
 }
 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 !!";
            }
        }
Beispiel #13
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 = "";
     }
 }
Beispiel #15
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";
     }
 }
Beispiel #16
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";
     }
 }
Beispiel #17
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 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       = "";
        }
    }
    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;
        }
    }
Beispiel #20
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");
                }
            }
        }
    }
Beispiel #23
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 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");
        //}
    }
    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");
            }
        }
    }
Beispiel #26
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);
                }
            }
        }
Beispiel #28
0
    protected void login_form_submit_Click(object sender, EventArgs e)
    {
        HttpBrowserCapabilities browse = Request.Browser;

        Captcha1.ValidateCaptcha(txt_captcha.Text.Trim());
        if (Captcha1.UserValidated)
        {
            bl.UserID          = txt_usr_id.Text;
            bl.Password        = ul.GenerateMd5Hash(txt_Password.Text);
            bl.UserIP          = ul.GetClientIpAddress(this.Page);
            bl.UserOS          = Utilities.System_Info(this.Page);
            bl.UserAgent       = browse.Version;
            bl.User_browser    = browse.Browser;
            bl.Succesful_login = "******";

            rd = dl.check_login(bl);
            if (rd.table.Rows.Count > 0)
            {
                bl.Succesful_login = "******";
                rb = dl.insert_logintrail(bl);
                string b = "true";
                Session["checkroll"] = b;
                //Session["username"] = txt_usr_id.Text;
                Session["username"] = rd.table.Rows[0]["UserID"].ToString();
                Session["role"]     = rd.table.Rows[0]["Role_id"].ToString();
                Session["EmpMapID"] = rd.table.Rows[0]["office_mapping_id"].ToString();
                //    Session["WelcomePage"] = rd.table.Rows[0]["WelcomePage"].ToString();
                if (rd.table.Rows.Count > 1)
                {
                    string role, rolenew = "";
                    int    i = 0;
                    //  rd1 = dl.select_emp(bl);

                    foreach (DataRow row in rd.table.Rows)
                    {
                        if (i == 0)
                        {
                            role    = row["role_id"].ToString();
                            rolenew = row["role_id"].ToString();
                            i++;
                        }
                        else
                        {
                            if (rolenew != row["role_id"].ToString())
                            {
                                b = "false";
                                Session["checkroll"] = b;
                            }
                        }
                    }
                    string    key       = System.Configuration.ConfigurationManager.AppSettings["EncKey"].ToString();
                    Utilities ut        = new Utilities();
                    string    encrypt_b = ut.Encrypt_AES(b, key);

                    Response.Redirect("employee_erole.aspx?b=" + encrypt_b);
                }
                else
                {
                    Response.Redirect(rd.table.Rows[0]["WelcomePage"].ToString());
                }
            }
            else
            {
                bl.Succesful_login = "******";

                rb = dl.insert_logintrail(bl);
                Utilities.MessageBoxShow("Check Your Username And Password That You Inserted");
                txt_captcha.Text  = "";
                txt_Password.Text = "";
                txt_usr_id.Text   = "";
            }
        }
        else
        {
            Utilities.MessageBoxShow("Please Enter Right Text In Captcha Box");
            txt_captcha.Text = "";
        }
    }
Beispiel #29
0
 private bool SprawdzCaptcha()
 {
     Captcha1.ValidateCaptcha(WpiszKod.Text.Trim());
     return(Captcha1.UserValidated);
 }
    protected void btn_Submit_Click1(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            if (Session["CheckRefresh"].ToString() == ViewState["CheckRefresh"].ToString())
            {
                Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());
                bool cptch_expired = false;
                try
                {
                    Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim());
                }
                catch { cptch_expired = true; }
                txtCaptcha.Text = "";
                if (!cptch_expired)
                {
                    if (Captcha1.UserValidated)
                    {
                        Captcha1.DataBind();
                        dl_RTI_Registration dl    = new dl_RTI_Registration();
                        bl_RTI_Request      objBL = new bl_RTI_Request();
                        dl_RTI_Request      objDl = new dl_RTI_Request();
                        // set data for rti_request
                        objBL.RTI_Request_id = objDl.Get_unique_RtiRequest_code(); //"<NTC>RTI Request ID from DL";//objDl.GetMaxValue("SELECT IFNULL(MAX(rti_request_id),0) as NO FROM rti_detail ");
                        objBL.UserType       = ddl_usertype.SelectedItem.Value;
                        objBL.NameEnglish    = txtName.Text;
                        objBL.Gender         = DDL_Gender.SelectedItem.Value;
                        objBL.Email          = txtEmailID.Text;
                        objBL.Address        = txtAddress.Text;
                        objBL.Country        = ddl_country.SelectedItem.Value;
                        objBL.Securitycode   = dl.GenOTPString(4);
                        HttpBrowserCapabilities browse = Request.Browser;
                        objBL.UserAgent       = Request.UserAgent.ToString();
                        objBL.Client_os       = Utilities.System_Info(this.Page);
                        objBL.ClientBrowser   = browse.Browser;
                        objBL.IsRTIFileUpload = "N";
                        objBL.IsNew           = "Y";
                        if (objBL.Country == "091")
                        {
                            objBL.State       = DDL_State.SelectedItem.Value;
                            objBL.District    = ddl_district.SelectedItem.Value;
                            objBL.CountryName = null;
                        }
                        else
                        {
                            objBL.CountryName = txtState_Other.Text;
                        }
                        objBL.Pincode            = txtPinCode.Text;
                        objBL.Mobile             = txtMobile.Text;
                        objBL.Rti_Subject        = txt_subject.Text;
                        objBL.RTI_Text           = txt_RequestApplicationText.Text;
                        objBL.RTI_login_userName = userID;
                        //objBL.RTI_request_date = DateTime.Now.ToString("yyyy-MM-dd");
                        Utilities util = new Utilities();
                        objBL.RTI_ipaddress = util.GetClientIpAddress(this.Page);//GetIPAddress();
                        objBL.RTI_Is_bpl    = DDL_BPL.SelectedItem.Value;
                        # region check for BPL
                        if (objBL.RTI_Is_bpl == "Y")
                        {
                            if (FU_BPL.PostedFile == null || FU_BPL.PostedFile.ContentLength < 1)
                            {
                                Utilities.MessageBox_UpdatePanel(update1, "Attach one BPL Supporting Document ");
                                return;
                            }
                            objBL.BPL_Card_No = txtBPLNo.Text;
                            int Current_year = Convert.ToInt32(DateTime.Now.Year);
                            int find_year    = Convert.ToInt32(txtYearOfIssue.Text);

                            if (find_year > Current_year)
                            {
                                // Utilities.MessageBoxShow("Year should not be greater then current year");
                                Utilities.MessageBox_UpdatePanel(update1, "Year should not be greater then current year ");
                                return;
                            }
                            else
                            {
                                objBL.BPL_Issue_Year = txtYearOfIssue.Text;
                            }
                            objBL.BPL_Issuing_Authority = txtIssuingAuthority.Text;
                            //objBL.RTI_Fees = "0";
                        }

                        else
                        {
                            //objBL.RTI_Fees = "10";
                        }
                        #endregion BPL
                        // set data for rti_filed_user
                        // objBL.RTI_filed_user_id = objDl.GetMaxValueRtiFiledUser();//"<NTC>RTI Filed user ID from DL"; //objDl.GetMaxValue("SELECT IFNULL(MAX(rti_FiledUserID),0) as NO FROM rti_filed_user ");
                        # region file submit problem is generating here
                        objBL.RTI_filed_user_id = objBL.RTI_Request_id;
                        objBL.Rti_Status        = "REG"; //Initial status of RTI Filed
                        objBL.Action_id         = "";
                        objBL.IsValid           = "N";
                        objBL.Office_mapping_id = DDL_RTI_Officer.SelectedValue;
                        objBL.Action_date       = DateTime.Now.ToString("yyyy-MM-dd"); // Need to ask
                        //objBL.Rti_Status = "registered"; // initial status
                        //set data for rti_file
                        string RTI_fileID = objDl.GetMaxValueRtiFiles();// "<NTC> file iD";//objDl.GetMaxValue("SELECT IFNULL(MAX(rti_fileID),0) as NO FROM rti_files ");

                        List <bl_RTI_RequestFiles> objList = new List <bl_RTI_RequestFiles>();

                        int maxCountFileID = Convert.ToInt32(RTI_fileID);
                        if (FU_BPL.PostedFile != null && FU_BPL.PostedFile.FileName != "")
                        {
                            if (FU_BPL.PostedFile.ContentLength > 0)
                            {
                                bl_RTI_RequestFiles objBLFile  = new bl_RTI_RequestFiles();
                                HttpPostedFile      postedFile = FU_BPL.PostedFile;

                                objBLFile.FileDescription  = txt_FU_BPL_Disc.Text;
                                objBLFile.RTI_fileID       = maxCountFileID.ToString();
                                objBLFile.RTI_fileName     = Path.GetFileName(postedFile.FileName);
                                objBLFile.RTI_fileType     = postedFile.ContentType;
                                objBLFile.BPL_RTI_FileType = "BPL_DOC";  // it is a BPL Supporting Document
                                objBLFile.RTI_Request_id   = objBL.RTI_Request_id;
                                Stream fs = postedFile.InputStream;

                                if ((objBLFile.RTI_fileType == "application/pdf" || objBLFile.RTI_fileType == "application/x-pdf" || objBLFile.RTI_fileType == "application/x-unknown") && fs.Length < 2097152)
                                {
                                    BinaryReader br    = new BinaryReader(fs);
                                    byte[]       bytes = br.ReadBytes((Int32)fs.Length);
                                    objBLFile.RTI_fileData = bytes;
                                    maxCountFileID         = maxCountFileID + 1;
                                    objList.Add(objBLFile);   // Add into the list
                                }
                                else
                                {
                                    //statusCount = 1;
                                    // Utilities.MessageBoxShow("Only Image File and less then 1000 KB is accepted");
                                    //lbl_status.Text = " Only Image File and less then 1000 KB is accepted ";
                                    Utilities.MessageBox_UpdatePanel(update1, " Only PDF File and less then 2000 KB is accepted for BPL File");
                                    return;
                                }
                            }
                            else
                            {
                                Utilities.MessageBox_UpdatePanel(update1, " BPL File Size Must be great then Zero");
                                return;
                            }
                        }
                        // RTI File Insert in data base
                        if (FU_RTI.PostedFile != null && FU_RTI.PostedFile.FileName != "")
                        {
                            if (FU_RTI.PostedFile.ContentLength > 0)
                            {
                                bl_RTI_RequestFiles objBLFile  = new bl_RTI_RequestFiles();
                                HttpPostedFile      postedFile = FU_RTI.PostedFile;

                                objBLFile.FileDescription  = txt_FU_RTI_Disc.Text;
                                objBLFile.RTI_fileID       = maxCountFileID.ToString();
                                objBLFile.RTI_fileName     = Path.GetFileName(postedFile.FileName);
                                objBLFile.RTI_fileType     = postedFile.ContentType;
                                objBLFile.BPL_RTI_FileType = "RTI_DOC";    // it is RTI Document
                                objBLFile.RTI_Request_id   = objBL.RTI_Request_id;
                                Stream fs = postedFile.InputStream;

                                if ((objBLFile.RTI_fileType == "application/pdf" || objBLFile.RTI_fileType == "application/x-pdf" || objBLFile.RTI_fileType == "application/x-unknown") && fs.Length < 2097152)
                                {
                                    BinaryReader br    = new BinaryReader(fs);
                                    byte[]       bytes = br.ReadBytes((Int32)fs.Length);
                                    objBLFile.RTI_fileData = bytes;
                                    maxCountFileID         = maxCountFileID + 1;
                                    objList.Add(objBLFile);   // Add into the list
                                }
                                else
                                {
                                    //statusCount = 1;
                                    // Utilities.MessageBoxShow("Only Image File and less then 1000 KB is accepted");
                                    //lbl_status.Text = " Only Image File and less then 1000 KB is accepted ";
                                    Utilities.MessageBox_UpdatePanel(update1, " Only PDF File and less then 2000 KB is accepted for RTI File");
                                    return;
                                }
                            }

                            else
                            {
                                Utilities.MessageBox_UpdatePanel(update1, "RTI File Size Must be greater then Zero");
                                return;
                            }
                            objBL.IsRTIFileUpload = "Y";
                        }
                        #endregion
                        if (objBL.Mobile == H_LoginMobileNo.Value)
                        {
                            objBL.IsValid = "Y";
                        }

                        ReturnClass.ReturnBool dt = objDl.Insert_RTI_Info(objBL, objList);
                        if (dt.status == true)
                        {
                            if (objBL.Mobile == H_LoginMobileNo.Value)
                            {      // Directly go to success page No Need OTP
                                string rti_message = "RTI Submition successfull your Registration no. is: " + objBL.RTI_Request_id + "  And  Your Security Code is:  " + objBL.Securitycode + "   please save  details for further Information.";
                                Utilities.MessageBox_UpdatePanel_Redirect(update1, rti_message, "./UserWelcome.aspx");
                            }
                            else
                            {
                                Session["RTI_ID"]            = objBL.RTI_Request_id;
                                Session["VERIFICATION_TYPE"] = "Rti";

                                Utilities.MessageBox_UpdatePanel_Redirect(update1, "Your RTI Request has been submited Need Mobile Verification for Registeration", "./User_Mobile_Varification.aspx");
                            }
                        }
                        else
                        {
                            Utilities.MessageBox_UpdatePanel(update1, "RTI Submition Failed");
                        }
                    }//end of captcha1 validated
                    else
                    {
                        Utilities.MessageBox_UpdatePanel(update1, "Incorrect Security Code");
                    }
                } // If ! captch expired
            }     // End of If checkRefresh