protected void Button1_Click(object sender, EventArgs e) { CanvasBizProcess canvBiz = new CanvasBizProcess(); try { if (txtEmailid.Text.Contains(">") || txtEmailid.Text.Contains("<") || txtEmailid.Text.Contains("'") || txtEmailid.Text.Contains("--") || txtEmailid.Text.Contains("%")) { txtEmailid.Text = ""; } else { string temppass = "******"; AppCustomer oAppCustomer = new AppCustomer(); oAppCustomer.CustomerID = oAppCustomer.GetNewDIDWithPrefix(); oAppCustomer.SCompanyName = txtOrganization.Text.Trim(); oAppCustomer.SCustomerCountry = Convert.ToInt32(ddlCountry.SelectedValue); oAppCustomer.SCustomerEmail = txtEmailid.Text.Trim(); oAppCustomer.SCustomerPWD = temppass; oAppCustomer.SCustomerStatus = "1"; //Remove hardcoding oAppCustomer.SCustomerUserName = txtFullName.Text.Trim(); oAppCustomer.SfpStatus = "0"; oAppCustomer.SAddress = txtAddress.Text.Trim(); //Check if Privacy policy check-box is checked if (flag) { if (checkTC.Checked == true) { canvBiz.InsertNewCustomer(oAppCustomer); int mailstatus = MailTrigger(txtEmailid.Text); if (mailstatus == 1) { string script = "alert('A verification Email has been sent to you.');" + "location.href='Home.aspx?';"; this.ClientScript.RegisterStartupScript(typeof(Page), "Redirect", script, true); } } else { string script = "alert('Kindly accept the T&C and Privacy Policy')"; this.ClientScript.RegisterStartupScript(typeof(Page), "Redirect", script, true); CodeNumberTextBox.Text = ""; this.Session["CaptchaImageText"] = GenerateRandomCode(); } } else { CodeNumberTextBox.Text = ""; errorlblsecurity.Style.Add("display", "block"); StringBuilder sErrorMsg = new StringBuilder(); sErrorMsg.Append("The Characters Don't Match.</br>"); sErrorMsg.Append("Please Try Again."); errorlblsecurity.Text = sErrorMsg.ToString(); CodeNumberTextBox.Focus(); this.Session["CaptchaImageText"] = GenerateRandomCode(); } } } catch (Exception ex) { objCommonUtil.SendErrorMail(ex.Message, ex.StackTrace, System.Reflection.MethodBase.GetCurrentMethod().Name.ToString(), System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString(), SessionData.Customer.CustomerID); } }
public bool InsertNewCustomer(AppCustomer oAppCustomer) { try { DatabaseHandler oDBH = new DatabaseHandler(); StringBuilder oSBQuery = new StringBuilder(); oDBH = new DatabaseHandler(); oDBH.ExecuteNonQuery_SP("InsertNewCustomer", oAppCustomer.GetNewDIDWithPrefix(), oAppCustomer.SCustomerUserName, oAppCustomer.SCustomerEmail, oAppCustomer.SCustomerPWD, oAppCustomer.SCompanyName, oAppCustomer.SCustomerCountry, 1, 1, oAppCustomer.SAddress,""); return true; } catch (Exception ex) { throw ex; } }