private bool CheckError()
 {
     CaptchaControl1.ValidateCaptcha(txtCode.Value);
     if (string.IsNullOrEmpty(txtEmail.Value))
     {
         clsUtility.Common.Show("Email không được rỗng!");
         txtEmail.Focus();
         return(false);
     }
     else if (!IsValidEmail(txtEmail.Value))
     {
         clsUtility.Common.Show("Email không hợp lệ!");
         txtEmail.Focus();
         return(false);
     }
     else if (string.IsNullOrEmpty(txtCode.Value))
     {
         clsUtility.Common.Show("Mã bảo mật không được rỗng!");
         txtCode.Focus();
         return(false);
     }
     else if (!CaptchaControl1.UserValidated)
     {
         clsUtility.Common.Show("Mã bảo mật không đúng");
         txtCode.Focus();
         return(false);
     }
     return(true);
 }
Exemple #2
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\userside.mdf;Integrated Security=True;User Instance=True");

        CaptchaControl1.ValidateCaptcha(TextBox1.Text);

        if (CaptchaControl1.UserValidated)
        {
            string str;
            //str = "select * from registration phoneno=Convert.ToInt64";
            str = "Insert into registration(username,emailid,password,address,city,phoneno,gender,birthdate)values('" + txtusername.Text + "','" + txtemailid.Text + "','" + txtpassword.Text + "','" + txtadd.Text + "','" + DropDownList1.Text + "', '" + txtphoneno.Text + "','" + RadioButtonList1.SelectedItem.Text + "','" + txtbirthdate.Text + "')";
            //Class   object     Class
            SqlCommand cmd = new SqlCommand(str, con);
            con.Open();

            cmd.ExecuteNonQuery();

            //for insert,update & delete query...
            Response.Redirect("Userlogin.aspx");
            con.Close();
        }

        else
        {
            Label1.Text = "not match";
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Literal9.Text = "";
        Label18.Text  = "";
        CheckBox1.Attributes.Add("style", "Color:0066FF;");
        string subject = "New Order";
        string body    = buildmessage();

        CaptchaControl1.ValidateCaptcha(capchatext.Text);
        if (!CaptchaControl1.UserValidated)
        {
            Literal9.Text = "من فضلك اكتب الحروف بشكل صحيح";
            return;
        }

        if (CheckBox1.Checked != true)
        {
            CheckBox1.ForeColor = Color.Red;
            return;
        }
        if (sendmail(subject, body) == true)
        {
            Label18.Text      = "تم الارسال بنجاح";
            Label18.ForeColor = Color.Green;
        }
        else
        {
            Label18.Text      = "خطأ فى ارسال الطلب";
            Label18.ForeColor = Color.Red;
        }
    }
Exemple #4
0
 protected void Btn_Register_Click(object sender, EventArgs e)
 {
     try
     {
         int i;
         if (CheckBox1.Checked == true)
         {
             CaptchaControl1.ValidateCaptcha(txtcaptcha.Text);
             #region btncode
             string dob      = ddlDay.SelectedItem.Value + "-" + ddlMonth.SelectedItem.Value + "-" + ddlYear.SelectedItem.Value;
             string fullname = txtFname.Text + " " + txtLname.Text;
             if (CaptchaControl1.UserValidated)
             {
                 i = bal.reg(dob, fullname, ddlGender.SelectedItem.Value, txtUname.Text + "@canoysoft.com", txtPassword.Text, txtEmail.Text, txtPhno.Text, txtAdd.Text, ddlBatch.SelectedItem.Value, Convert.ToBoolean(1), ddlQues.SelectedItem.ToString(), txtSecAns.Text, Convert.ToBoolean(1));
                 if (i > 0)
                 {
                     lblmsg.Text             = "registration success Please ";
                     lblmsg1.Text            = " to login";
                     LinkButton2.Visible     = true;
                     txtFname.Text           = "";
                     txtLname.Text           = "";
                     txtAdd.Text             = "";
                     txtcaptcha.Text         = "";
                     txtCPassword.Text       = "";
                     txtEmail.Text           = "";
                     txtSecAns.Text          = "";
                     txtPassword.Text        = "";
                     txtPhno.Text            = "";
                     txtUname.Text           = "";
                     ddlBatch.SelectedIndex  = 0;
                     ddlGender.SelectedIndex = 0;
                     ddlYear.SelectedIndex   = 0;
                     ddlQues.SelectedIndex   = 0;
                     CheckBox1.Checked       = false;
                 }
                 else
                 {
                     lblmsg.Text         = " this  register number is already used";
                     lblmsg1.Visible     = false;
                     LinkButton2.Visible = false;
                 }
             }
             else
             {
                 ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('The Captcha Code is in correct....!')</script>");
                 //lblCaptcha.Text = bal.CreateRandomPassword(8);
             }
             #endregion
         }
         else
         {
             ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('You must agree with the Canoysoft Terms and conditions')</script>");
         }
     }
     catch (Exception ex)
     {
         ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('" + ex.Message + "')</script>");
     }
 }
 protected void btRegister_Click(object sender, EventArgs e)
 {
     if (fc.checkCompany(txtIDCompany.Text) == true)
     {
         Response.Write("<script>alert('Đã tồn tại Tên đăng nhập này')</script>");
     }
     else
     {
         try
         {
             CaptchaControl1.ValidateCaptcha(txtCapscha.Text);
         }
         catch (Exception) {
             lbCapcha.Visible = true;
             return;
         }
         if (!CaptchaControl1.UserValidated)
         {
             lbCapcha.Visible = true;
             return;
         }
         else
         {
             try
             {
                 DateTime certifiedDate = DateTime.Parse(txtCertifiedDate.Text);
                 cnDb.connect();
                 SqlCommand cmd = new SqlCommand("sp_AddTourCompany", cnDb.conn);
                 cmd.CommandText = "sp_AddTourCompany";
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.AddWithValue("@IDCompany", txtIDCompany.Text);
                 cmd.Parameters.AddWithValue("@CompanyName", txtNameCompay.Text);
                 cmd.Parameters.AddWithValue("@LegalRepresentative", txtLegalRepresentative.Text);
                 cmd.Parameters.AddWithValue("@TransactionName", txtTransactionName.Text);
                 cmd.Parameters.AddWithValue("@TaxCode", txtTaxCode.Text);
                 cmd.Parameters.AddWithValue("@BusinessLicense", txtBusinessLicense.Text);
                 cmd.Parameters.AddWithValue("@CertifiedDate", certifiedDate);
                 cmd.Parameters.AddWithValue("@Address", txtAddress.Text);
                 cmd.Parameters.AddWithValue("@Phone", txtPhone.Text);
                 cmd.Parameters.AddWithValue("@Email", txtEmail.Text);
                 cmd.Parameters.AddWithValue("@Password", txtPass.Text);
                 cmd.Parameters.AddWithValue("@WebAddress", txtWebsite.Text);
                 cmd.ExecuteNonQuery();
                 cnDb.conn.Close();
                 Response.Redirect("UI_CompleteRegister.aspx");
             }
             catch (Exception)
             {
                 cnDb.conn.Close();
                 Response.Write("<script>alert('Vui lòng đăng ký lại sau.')</script>");
             }
         }
     }
 }
 protected void CaptchaValidate()
 {
     CaptchaControl1.Validate();
     if (!CaptchaControl1.IsValid)
     {
         lblcaptcha.Text = "Not successful";
         return;
     }
     else
     {
         lblcaptcha.Text = "Successful";
     }
 }
Exemple #7
0
 protected void btnsubmit_Click(object sender, EventArgs e)
 {
     CaptchaControl1.ValidateCaptcha(txtcaptcha.Text.Trim());
     if (CaptchaControl1.UserValidated)
     {
         if (fileuploadphoto.HasFile)
         {
             if (fileuploadphoto.PostedFile.ContentType == "image/jpeg" || fileuploadphoto.PostedFile.ContentType == "image/png" || fileuploadphoto.PostedFile.ContentType == "image/gif" || fileuploadphoto.PostedFile.ContentType == "image/jpg")
             {
                 if (fileuploadresume.HasFile)
                 {
                     if (fileuploadphoto.PostedFile.ContentType == "document/txt" || fileuploadresume.PostedFile.ContentType == "text/plain" || fileuploadphoto.PostedFile.ContentType == "document/odf" || fileuploadphoto.PostedFile.ContentType == "document/doc" || fileuploadphoto.PostedFile.ContentType == "document/docx" || fileuploadphoto.PostedFile.ContentType == "document/pdf")
                     {
                         PS.FirstName        = txtfname.Text;
                         PS.LastName         = txtlname.Text;
                         PS.UserName         = txtusername.Text;
                         PS.Password         = txtpassword.Text;
                         PS.Email            = txtemailid.Text;
                         PS.MobileNo         = Convert.ToDecimal(txtmobileno.Text);
                         PS.Gender           = Convert.ToString(rndbtnlistgender.SelectedItem.Value);
                         PS.DateOfBirth      = Convert.ToDateTime(txtdob.Text);
                         PS.SecurityQuestion = Convert.ToString(drpsecurityquestion.SelectedItem.Value);
                         PS.SecurityAnswer   = txtanswer.Text;
                         PS.CountryId        = Convert.ToInt16(drpcountry.SelectedItem.Value);
                         PS.StateId          = Convert.ToInt16(drpstate.SelectedItem.Value);
                         PS.CityId           = Convert.ToInt16(drpcity.SelectedItem.Value);
                         PS.Photos           = ("~/Photos/" + fileuploadphoto.PostedFile.FileName);
                         PS.Resume           = ("Resume/" + fileuploadresume.PostedFile.FileName);
                         PS.InsertRegistration(PS);
                         fileuploadphoto.SaveAs(Server.MapPath(PS.Photos));
                         fileuploadresume.SaveAs(Server.MapPath(PS.Resume));
                         txtcl();
                     }
                     else
                     {
                         Response.Write("<script>alert('Please Select Proper Format Document. Like(TXT,ODF,PDF,DOC,DOCX);')</script>");
                     }
                 }
             }
             else
             {
                 Response.Write("<script>alert('Please Select Proper Format Image. Like(JPEG,JPG,PNG,GIF)');</script>");
             }
         }
     }
     else
     {
         lblmessage.ForeColor = System.Drawing.Color.Red;
         lblmessage.Text      = "Re-Enter Captcha";
     }
 }
Exemple #8
0
 protected void btnRegister_Click(object sender, EventArgs e)
 {
     CaptchaControl1.ValidateCaptcha(txtCapcha.Text.Trim());
     if (CaptchaControl1.UserValidated)
     {
         ValueObject.MemberVO mem = new ValueObject.MemberVO();
         mem.Username   = txtUserName.Text;
         mem.Password   = txtConfirmPassword.Text;
         mem.MemberName = txtFullName.Text;
         bool gender;
         if (rdoMale.Checked)
         {
             gender = true;
         }
         else
         {
             gender = false;
         }
         mem.Gender   = gender;
         mem.Birthday = DateTime.Parse(txtDOB.Text);
         mem.Address  = txtAddress.Text;
         mem.City     = txtCity.Text;
         mem.PhoneNo  = txtPhone.Text;
         mem.Email    = txtEmail.Text;
         mem.RoleID   = 2;
         BLL.BLL_Member bm = new BLL.BLL_Member();
         bool           st = bm.InsertMember(mem);
         if (st)
         {
             mtvwRegister.ActiveViewIndex = 1;
         }
         else
         {
             Utilties.Alert.Show("Tên đăng nhập hoặc email đã có người dùng!");
         }
     }
     else
     {
         lblError.ForeColor = System.Drawing.Color.Red;
         lblError.Text      = "Mã không đúng.";
     }
 }
 protected void btnComment_Click(object sender, EventArgs e)
 {
     //
     CaptchaControl1.ValidateCaptcha(txtCaptcha.Text);
     if (!CaptchaControl1.UserValidated)
     {
         lbMessCaptcha.Visible = true;
         return;
     }
     else
     {
         try
         {
             lbMessCaptcha.Visible = false;
             string id       = Request.QueryString["article"];
             string name     = txtCommenter.Text;
             string email    = txtEmail.Text;
             string contents = txtContent.Text;
             func.addComment(id, name, email, contents);
             txtContent.Text   = "";
             txtEmail.Text     = "";
             txtCommenter.Text = "";
             txtCaptcha.Text   = "";
             //Response.Write("<script>alert('Cảm ơn bạn đã góp ý')</script>");
             loadComment();
         }
         catch (Exception)
         {
             cnDb.conn.Close();
             Response.Write("<script>alert('Vui lòng phản hồi lại sau.')</script>");
             txtContent.Text   = "";
             txtEmail.Text     = "";
             txtCommenter.Text = "";
             txtCaptcha.Text   = "";
         }
     }
 }
Exemple #10
0
 protected void  btn_login_Click(object sender, EventArgs e)
 {
     if (txt_UserName.Text != null && txt_Password.Text != null)
     {
         User newuser = User.LoginCheck(txt_UserName.Text, txt_Password.Text);
         CaptchaControl1.ValidateCaptcha(txt_Captcha.Text);
         if (CaptchaControl1.UserValidated)
         {
             if (newuser == null)
             {
                 lbl_error.Text = "نام کاربری یا گذرواژه اشتباه می باشد ";
             }
             else
             {
                 Session["User"] = newuser;
                 if (Session["URLReferer"] == null)
                 {
                     Response.Redirect("Default.aspx");
                 }
                 else
                 {
                     Response.Redirect(Session["URLReferer"].ToString());
                     Session["URLReferer"] = null;
                 }
             }
         }
         else
         {
             lbl_error.Text   = "دوباره وارد کنید";
             txt_Captcha.Text = "";
         }
     }
     else
     {
         lbl_error.Text = "فیلدها را خواهشا پرکنید";
     }
 }
Exemple #11
0
        protected void ibCrearCuenta_Click(object sender, ImageClickEventArgs e)
        {
            string Nombre  = TextBox2.Text;
            string Rut     = txtRut.Text;
            string Usuario = txtUsername.Text;
            string pass    = txtPass.Text;
            string pass2   = txtPass2.Text;
            string correo  = txtCorreo.Text;
            string Pin     = txtPin.Text;
            string pin2    = txtPin2.Text;

            CaptchaControl1.ValidateCaptcha(txtCaptcha.Text);

            if (Usuario == "")
            {
                string popupScript = "<script language='JavaScript'> alert(' El Campo Usuario es Obligatorio.'); </script>";
                Page.RegisterStartupScript("PopupScript", popupScript);
                txtUsername.Focus();
                txtCaptcha.Text = "";
            }
            else if (pass == "")
            {
                string popupScript = "<script language='JavaScript'> alert(' El Campo Password es Obligatorio.'); </script>";
                Page.RegisterStartupScript("PopupScript", popupScript);
                txtPass.Focus();
                txtCaptcha.Text = "";
            }
            else if (pass2 == "")
            {
                string popupScript = "<script language='JavaScript'> alert(' El Campo reingrese Password es Obligatorio.'); </script>";
                Page.RegisterStartupScript("PopupScript", popupScript);
                txtPass2.Focus();
                txtCaptcha.Text = "";
            }

            else if (correo == "")
            {
                string popupScript = "<script language='JavaScript'> alert(' El Campo Correo es Obligatorio.'); </script>";
                Page.RegisterStartupScript("PopupScript", popupScript);
                txtCorreo.Focus();
                txtCaptcha.Text = "";
            }
            else if (Pin == "")
            {
                string popupScript = "<script language='JavaScript'> alert(' El Campo PIN es Obligatorio.'); </script>";
                Page.RegisterStartupScript("PopupScript", popupScript);
                txtPin.Focus();
                txtCaptcha.Text = "";
            }
            else if (pin2 == "")
            {
                string popupScript = "<script language='JavaScript'> alert(' El Campo reingrese PIN es Obligatorio.'); </script>";
                Page.RegisterStartupScript("PopupScript", popupScript);
                txtPin2.Focus();
                txtCaptcha.Text = "";
            }
            else
            {
                if (isValidPass(txtPass.Text) == true)
                {
                    if (pass != "1234" || pass != "4321")
                    {
                        if (pass == pass2)
                        {
                            if (Pin == pin2)
                            {
                                if (IsValidEmail(txtCorreo.Text) == true)
                                {
                                    if (CaptchaControl1.UserValidated)
                                    {
                                        respuesta = cReg.RegistroUsuario(Nombre, Rut, Usuario, pass, correo, Convert.ToInt32(Pin), txtCargo.Text, txtCentroCosto.Text);

                                        if (respuesta != false)
                                        {
                                            generarCorreo();
                                            string popupScript = "<script language='JavaScript'> alert(' Cuenta de Usuario creada correctamente.\\n\\n Su cuenta se encuentra Inactiva. ');location.href='Login.aspx' </script>";
                                            Page.RegisterStartupScript("PopupScript", popupScript);
                                        }
                                        else
                                        {
                                            string popupScript = "<script language='JavaScript'> alert(' El nombre de usuario y/o rut ya existe, vuelva a intentarlo.'); </script>";
                                            Page.RegisterStartupScript("PopupScript", popupScript);
                                        }
                                    }
                                    else
                                    {
                                        string popupScript = "<script language='JavaScript'> alert(' Código de Seguridad Incorrecto, vuelva a intentarlo.'); </script>";
                                        Page.RegisterStartupScript("PopupScript", popupScript);
                                        txtCaptcha.Text = "";
                                    }
                                }
                                else
                                {
                                    string popupScript = "<script language='JavaScript'> alert('El correo no tiene el formato correcto, sólo se permiten correos de la empresa.\\n\\n Por Ejemplo: [email protected] o [email protected]'); </script>";
                                    Page.RegisterStartupScript("PopupScript", popupScript);
                                }
                            }
                            else
                            {
                                string popupScript = "<script language='JavaScript'> alert(' Los códigos PIN NO coinciden'); </script>";
                                Page.RegisterStartupScript("PopupScript", popupScript);
                                txtCaptcha.Text = "";
                            }
                        }
                        else
                        {
                            string popupScript = "<script language='JavaScript'> alert(' Las Claves Secretas NO Coinciden'); </script>";
                            Page.RegisterStartupScript("PopupScript", popupScript);
                            txtCaptcha.Text = "";
                        }
                    }
                    else
                    {
                        string popupScript = "<script language='JavaScript'> alert('El código PIN es poco seguro, vuelva a intentarlo'); </script>";
                        Page.RegisterStartupScript("PopupScript", popupScript);
                    }
                }
                else
                {
                    string popupScript = "<script language='JavaScript'> alert('Estimado Usuario: \\n\\nPor seguridad su clave debe contener Número y letras ademas de un minimo de 6 caracteres.'); </script>";
                    Page.RegisterStartupScript("PopupScript", popupScript);
                }
            }
        }
Exemple #12
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                #region Encoding
                string inputEmailOrPhone = HttpUtility.HtmlEncode(txtEmailOrPhone.Text);
                string inputPassword     = HttpUtility.HtmlEncode(txtPassword.Text);
                string captchaText       = HttpUtility.HtmlEncode(txtCaptcha.Text);
                #endregion

                #region Validations, Notifications & Authenticaiton Process
                divNotification.Visible = false;
                ltrNotification.Text    = string.Empty;

                LOGSTAT.LoginTypeName logType  = LOGSERV.IdentifyAndValidateEmailOrPhone(inputEmailOrPhone);
                SaUserModel.SaUser    thisUser = new LOGSTAT.SaUser();


                if (inputEmailOrPhone == string.Empty)
                {
                    divNotification.Visible = true;
                    ltrNotification.Text    = LOGSTAT.msgPhoneEmailEmpty;
                }
                else if (inputPassword == string.Empty)
                {
                    divNotification.Visible = true;
                    ltrNotification.Text    = LOGSTAT.msgPasswordEmpty;
                }
                else if (txtCaptcha.Text == string.Empty)
                {
                    divNotification.Visible = true;
                    ltrNotification.Text    = LOGSTAT.msgCaptchaEmpty;
                }
                else if (logType == LOGSTAT.LoginTypeName.None)
                {
                    divNotification.Visible = true;
                    ltrNotification.Text    = LOGSTAT.msgInvalidPhoneEmailFormat;
                }
                else if (txtCaptcha.Text != string.Empty)
                {
                    CaptchaControl1.ValidateCaptcha(captchaText);

                    if (!CaptchaControl1.UserValidated)
                    {
                        divNotification.Visible = true;
                        ltrNotification.Text    = LOGSTAT.msgCaptchaEmpty;
                    }
                    else
                    {
                        thisUser = logType == SaUserModel.LoginTypeName.Email ? SaUserService.QueryUserByEmail(inputEmailOrPhone) : (logType == SaUserModel.LoginTypeName.Phone ? SaUserService.QueryUserByGsmNumber(inputEmailOrPhone) : null);

                        if (thisUser.Password != inputPassword)
                        {
                            divNotification.Visible = true;
                            ltrNotification.Text    = LOGSTAT.msgInvalidPassword;
                        }
                        else if (thisUser != null && thisUser.UserActive == true)
                        {
                            SaUserService.CreateAuthenticationCookies(inputEmailOrPhone);

                            HttpCookie userCookie = new HttpCookie("userName", thisUser.Name + " " + thisUser.LastName);
                            HttpContext.Current.Response.Cookies.Add(userCookie);

                            string returnUrlString = Request.QueryString["ReturnUrl"] != null ? Request.QueryString["ReturnUrl"].ToString() : string.Empty;

                            string redirectionUrl = !string.IsNullOrEmpty(returnUrlString) ? returnUrlString : "~/Home.aspx";
                            Response.Redirect(redirectionUrl, false);

                            //if (!string.IsNullOrEmpty(returnUrlString))
                            //{
                            //    Response.Redirect(returnUrlString, false);
                            //}
                            //else
                            //{
                            //    Response.Redirect("~/Home.aspx", false);

                            //}
                        }
                        else
                        {
                            divNotification.Visible = true;
                            ltrNotification.Text    = LOGSTAT.msgUserDoesntExist;
                        }
                    }
                }

                #endregion


                txtCaptcha.Text      = string.Empty;
                txtEmailOrPhone.Text = string.Empty;
                txtPassword.Text     = string.Empty;
            }
            catch (Exception ex)
            {
                ltrResult.Text = ex.Message + " - " + ex.StackTrace;
                //EXP.RedirectToErrorPage(ex.Message);
            }
        }
        protected void ibRecuperar_Click(object sender, ImageClickEventArgs e)
        {
            CaptchaControl1.ValidateCaptcha(txtCaptcha.Text);


            if (txtCorreo.Text == "" & txtUsuario.Text != "")
            {
                string popupScript = "<script language='JavaScript'> alert('El campo Correo es obligatorio.');</script>";
                Page.RegisterStartupScript("PopupScript", popupScript);
            }
            else if (txtCorreo.Text != "" & txtUsuario.Text == "")
            {
                string popupScript = "<script language='JavaScript'> alert('El campo Usuario es obligatorio.');</script>";
                Page.RegisterStartupScript("PopupScript", popupScript);
            }
            else if (txtCorreo.Text == "" && txtUsuario.Text == "")
            {
                string popupScript = "<script language='JavaScript'> alert('Los campos usuario y Correo son obligatorios.');</script>";
                Page.RegisterStartupScript("PopupScript", popupScript);
            }
            else
            {
                if (txtCaptcha.Text != "")
                {
                    if (CaptchaControl1.UserValidated)
                    {
                        respuesta = RP.verificaResetPassword(txtUsuario.Text, txtCorreo.Text);
                        if (respuesta == true)
                        {
                            Controller_Login lo = new Controller_Login();
                            idUsu        = lo.BuscarIDUsuario(txtUsuario.Text);
                            lblpaso.Text = idUsu.ToString();

                            verifica = RP.verificaEstadoReset(Convert.ToInt32(idUsu.ToString()));
                            if (verifica != false)
                            {
                                string popupScript = "<script language='JavaScript'> alert('¡Estimado Usuario:\\n\\n Ya existe una solicitud pendiente de cambio de contraseña en su correo electrónico. ! ');location.href='Login.aspx'</script>";
                                Page.RegisterStartupScript("PopupScript", popupScript);
                            }
                            else
                            {
                                respInserM = RP.insertCambioMail(idUsu, Codigo);
                                if (respInserM == true)
                                {
                                    EnviarCorreo();
                                    string popupScript = "<script language='JavaScript'> alert('Estimado Usuario:\\n\\n Los Datos solicitados han sido enviados a su correo electrónico.');location.href='Login.aspx'</script>";
                                    Page.RegisterStartupScript("PopupScript", popupScript);
                                }
                                else
                                {
                                    string popupScript = "<script language='JavaScript'> alert('Estimado Usuario:\\n\\n Ya existe una solicitud pendiente de cambio de contraseña en su correo electrónico.');location.href='Login.aspx'</script>";
                                    Page.RegisterStartupScript("PopupScript", popupScript);
                                }
                            }
                        }
                        else
                        {
                            string popupScript = "<script language='JavaScript'> alert('Los datos proporcionados son incorrectos, favor corregir.');</script>";
                            Page.RegisterStartupScript("PopupScript", popupScript);
                        }
                    }
                    else
                    {
                        string popupScript = "<script language='JavaScript'> alert('El código de seguridad no coincide, vuelve a intentarlo.');</script>";
                        Page.RegisterStartupScript("PopupScript", popupScript);
                        txtCaptcha.Text = "";
                    }
                }
                else
                {
                    string popupScript = "<script language='JavaScript'> alert('El campo código de seguridad es obligatorio.');</script>";
                    Page.RegisterStartupScript("PopupScript", popupScript);
                }
            }
        }
Exemple #14
0
    protected void btnSend_Click(object sender, EventArgs e)
    {
        bool boolIsValidPast = true;

        boolIsValidPast &= IsValidText(txtName.Text);
        boolIsValidPast &= IsValidText(txtEmail.Text);
        boolIsValidPast &= IsValidText(txtPhone.Text);

        int quantity = 0;

        if (!Int32.TryParse(txtAmount.Text, out quantity) || (quantity < 1))
        {
            boolIsValidPast = false;
        }

        if (!ValidationHelper.IsValidEmail(txtEmail.Text.Trim()))
        {
            boolIsValidPast = false;
        }

        if (!CaptchaControl1.IsValid())
        {
            CaptchaControl1.TryNew();
            boolIsValidPast = false;
        }

        if (boolIsValidPast == false)
        {
            ShowMessage(Notify.NotifyType.Error, Resource.Client_Feedback_WrongData);
            return;
        }

        try
        {
            var orderByRequest = new OrderByRequest
            {
                ProductId   = product.ID,
                ProductName = product.Name,
                ArtNo       = product.ArtNo,
                Quantity    = quantity,
                UserName    = txtName.Text,
                Email       = txtEmail.Text,
                Phone       = txtPhone.Text,
                Comment     = txtComment.Text,
                IsComplete  = false,
                RequestDate = DateTime.Now
            };

            OrderByRequestService.AddOrderByRequest(orderByRequest);

            var clsParam = new ClsMailParamOnOrderByRequest
            {
                OrderByRequestId = orderByRequest.OrderByRequestId.ToString(CultureInfo.InvariantCulture),
                ArtNo            = product.ArtNo,
                ProductName      = product.Name,
                Quantity         = quantity.ToString(CultureInfo.InvariantCulture),
                UserName         = txtName.Text,
                Email            = txtEmail.Text,
                Phone            = txtPhone.Text,
                Comment          = txtComment.Text
            };

            string message = SendMail.BuildMail(clsParam);

            SendMail.SendMailNow(txtEmail.Text, Resource.Client_OrderByRequest_PreOrder, message, true);
            SendMail.SendMailNow(SettingsMail.EmailForOrders, Resource.Client_OrderByRequest_PreOrder, message, true);

            lblMessage.Text = Resource.Client_Feedback_MessageSent;
            MultiView1.SetActiveView(ViewResult);
        }
        catch (Exception ex)
        {
            Debug.LogError(ex);
            ShowMessage(Notify.NotifyType.Error, Resource.Client_Feedback_MessageError);
            MultiView1.SetActiveView(ViewResult);
        }
    }
        protected void RegisterButton_Click(object sender, EventArgs e)
        {
            if (!CaptchaControl1.Validate(CaptchaTextBox.Text))
            {
                ErrorLabel.Text = "Error : The code you have entered in invalid , please try again ..";
                return;
            }
            if (Membership.GetUser(UsernameTextBox.Text.Trim()) != null)
            {
                ErrorLabel.Text = "Error : Username already taken , please choose another one ..";
                return;
            }
            else
            {
                RegisterPanel.Visible = false;
                SuccessfulLabel.Text  = String.Format("Your account has been created, but before you can login you must first verify your email address.<br/> A message has been sent to the email address you specified <strong>({0})</strong>.<br/> Please check your email inbox and follow the instructions in that email to verify your account.",
                                                      EmailTextBox.Text);
                WaitingForValidationPanel.Visible = true;
                MembershipUser newuser = Membership.CreateUser(UsernameTextBox.Text, PasswordTextBox.Text, EmailTextBox.Text);
                newuser.IsApproved = false;
                Membership.UpdateUser(newuser);
                MailMessage message = new MailMessage();
                message.IsBodyHtml = true;
                message.From       = new MailAddress("*****@*****.**");
                message.To.Add(new MailAddress(EmailTextBox.Text));
                message.Subject = "Sudoku Realm Account Activation";
                message.Body    = String.Format(@"---This is an automated message , please don't reply---<br/><br/>Dear {0}, Thanks for creating an account on <a href='http://www.sudokurealm.com'>Sudoku Realm</a> ...<br/><br/>
Please click on the following link to activate your account:<br/>
<a href='{1}'>{1}</a><br/><br/>
after activation you can use your credentials to login to our realm, which are ..<br/>
User Name : {0}<br/>
Email : {2}<br/>
Password: {3}<br/><br/>
Thank you very much for your interest in Sudoku Realm and good luck with your games!
                    ",
                                                UsernameTextBox.Text,
                                                "http://www.sudokurealm.com/verify.aspx?ID=" + newuser.ProviderUserKey.ToString(),
                                                EmailTextBox.Text,
                                                PasswordTextBox.Text
                                                );
                SmtpClient client = new SmtpClient();
                client.Send(message);
            }
//            Avempace Registration

//Dear applicant, Welcome to the website of Avempace - a scholarship scheme for academic exchange between Jordan,Lebanon, Palestine, Syria and 8 EU countries!
// Please click on the following link to activate your account:

//http://avempace.biobs.com/register_new.aspx?validate=2fe0c0b0-203a-40b0-87d1-e704ddb3028b

// email: [email protected]

//password: 7a2cutdk9ms1
// Please notice:
// The online application consists of two steps. Step 1 needs to be completed by clicking the "Finish Data Entry" button
// before it is possible to proceed to step 2 where documents have to be uploaded and the host university chosen.

//Note that no more changes are possible within step 1 once it has been finished by clicking the button "Finish Data Entry (step 1)".

// Step 1 consists of:
//>>Main data (a picture needs to be uploaded as well)
//>>Profile
//>>Language skills
//>>Motivation statement

// Step 2 consists of:
//>>Documents to be uploaded
//>>Priority for host universities

// Once you click on "Finish application" after the completion of both steps, you will not have access anymore
// to your application and no more changes will be possible
// So please make sure to carefully review your application before hitting the submit button "Finish application".

// Thank you very much for your interest in Avempace and good luck with your application!
        }
Exemple #16
0
        protected void btnSend_Click(object sender, EventArgs e)
        {
            bool boolIsValidPast = true;

            boolIsValidPast &= IsValidText(txtName.Text);
            boolIsValidPast &= IsValidText(txtEmail.Text);
            boolIsValidPast &= IsValidText(txtPhone.Text);

            float quantity = 0;

            if (!float.TryParse(txtAmount.Text, out quantity) || (quantity < 0))
            {
                boolIsValidPast = false;
            }

            if (!ValidationHelper.IsValidEmail(txtEmail.Text.Trim()))
            {
                boolIsValidPast = false;
            }

            if (!CaptchaControl1.IsValid())
            {
                CaptchaControl1.TryNew();
                boolIsValidPast = false;
            }

            if (boolIsValidPast == false)
            {
                CaptchaControl1.TryNew();
                ShowMessage(Notify.NotifyType.Error, Resource.Client_Feedback_WrongData);
                return;
            }

            try
            {
                var orderByRequest = new OrderByRequest
                {
                    OfferId     = offer.OfferId,
                    ProductId   = offer.Product.ID,
                    ProductName = offer.Product.Name,
                    ArtNo       = offer.ArtNo,
                    Quantity    = quantity,
                    UserName    = txtName.Text,
                    Email       = txtEmail.Text,
                    Phone       = txtPhone.Text,
                    Comment     = txtComment.Text,
                    IsComplete  = false,
                    RequestDate = DateTime.Now,
                    Options     = Options
                };

                OrderByRequestService.AddOrderByRequest(orderByRequest);


                IList <EvaluatedCustomOptions> listOptions = null;
                if (Options.IsNotEmpty())
                {
                    try
                    {
                        listOptions = CustomOptionsService.DeserializeFromXml(Options);
                    }
                    catch (Exception)
                    {
                        listOptions = null;
                    }
                }

                var mailTemplate =
                    new OrderByRequestMailTemplate(
                        orderByRequest.OrderByRequestId.ToString(CultureInfo.InvariantCulture), offer.ArtNo,
                        offer.Product.Name + " " + OrderService.RenderSelectedOptions(listOptions),
                        quantity.ToString(CultureInfo.InvariantCulture), txtName.Text, txtEmail.Text, txtPhone.Text,
                        txtComment.Text, offer.Color != null ? offer.Color.ColorName : string.Empty,
                        offer.Size != null ? offer.Size.SizeName : string.Empty);

                mailTemplate.BuildMail();

                SendMail.SendMailNow(txtEmail.Text, mailTemplate.Subject, mailTemplate.Body, true);
                SendMail.SendMailNow(SettingsMail.EmailForOrders, mailTemplate.Subject, mailTemplate.Body, true);

                lblMessage.Text = Resource.Client_Feedback_MessageSent;
                MultiView1.SetActiveView(ViewResult);
            }
            catch (Exception ex)
            {
                Debug.LogError(ex);
                ShowMessage(Notify.NotifyType.Error, Resource.Client_Feedback_MessageError);
                MultiView1.SetActiveView(ViewResult);
            }
        }