Beispiel #1
0
        protected void btnsignup_Click(object sender, EventArgs e)
        {
            //check if email exists
            DataTable dttemp = Peerfx_DB.SPs.ViewUsersEmail(txtemail.Text).GetDataSet().Tables[0];
            if (dttemp.Rows.Count > 0)
            {
                //user exists
                lblerror.Text = "Email address already Signed Up";
            }
            else if (txtemail.Text == "")
            {
                lblerror.Text = "Please enter email address";
            }
            else if (!sitetemp.IsValidEmail(txtemail.Text))
            {
                lblerror.Text = "Please enter a valid email address";
            }
            else if (txtfirstname.Text == "")
            {
                lblerror.Text = "Please enter first name";
            }
            else if (txtlastname.Text == "")
            {
                lblerror.Text = "Please enter last name";
            }
            else if (txtpassword.Text == "")
            {
                lblerror.Text = "Please enter password";
            }
            else
            {
                //sign up user & log them in
                StoredProcedure sp_UpdateSignup1 = Peerfx_DB.SPs.UpdateUsers(0, "", txtfirstname.Text, "", txtlastname.Text, null, null, txtemail.Text, HttpContext.Current.Request.UserHostAddress, 0);
                sp_UpdateSignup1.Execute();

                int temp_user_key = Convert.ToInt32(sp_UpdateSignup1.Command.Parameters[9].ParameterValue.ToString());

                Peerfx_DB.SPs.UpdateUsersInfo(temp_user_key, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null).Execute();

                Peerfx_DB.SPs.UpdateUsersInfoSignupTab3(temp_user_key, "", txtpassword.Text).Execute();

                mx.TrackEvent("Sign Up", temp_user_key, null);

                Users user = sitetemp.view_users_info_email(txtemail.Text);
                HttpContext.Current.Session["currentuser"] = user;
                //Response.Redirect("/User/Dashboard.aspx");

                //send verification email
                External_APIs.SendGrid sg = new External_APIs.SendGrid();
                sg.Send_Email_Verification(temp_user_key);

                Page.ClientScript.RegisterStartupScript(GetType(), "h", "Loginuser();", true);
            }
        }
Beispiel #2
0
        protected void btnContinue3_Click(object sender, EventArgs e)
        {
            //check captcha
            RadCaptcha1.Validate();
            if (RadCaptcha1.IsValid)
            {
                //save to db
                Peerfx_DB.SPs.UpdateUsersSecurityAnswers(user_key, Convert.ToInt32(ddlSecurityQuestion1.SelectedValue), txtSecurityAnswer1.Text).Execute();
                Peerfx_DB.SPs.UpdateUsersSecurityAnswers(user_key, Convert.ToInt32(ddlSecurityQuestion2.SelectedValue), txtSecurityAnswer2.Text).Execute();
                Peerfx_DB.SPs.UpdateUsersSecurityAnswers(user_key, Convert.ToInt32(ddlSecurityQuestion3.SelectedValue), txtSecurityAnswer3.Text).Execute();

                Peerfx_DB.SPs.UpdateUsersInfoSignupTab3(user_key, txtUsername.Text, txtPassword.Text).Execute();

                //mixpanel

                //go to next screen
                changetab(3);

                //made it to confirmation screen
                DataTable dtuserinfo = Master.view_users_info_dt(user_key);
                lblemailaddress.Text = dtuserinfo.Rows[0]["email"].ToString();
                lblemailaddress2.Text = lblemailaddress.Text;
                lblclientnumber.Text = dtuserinfo.Rows[0]["user_key"].ToString();

                //send verification email
                External_APIs.SendGrid sg = new External_APIs.SendGrid();
                sg.Send_Email_Verification(user_key);
            }
            else
            {
            }
        }