private void btncancel_Click(object sender, EventArgs e)
        {
            this.Close();
            USER_LOGIN ul = new USER_LOGIN();

            ul.Show();
        }
        private void lnklblogout_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this.Close();
            USER_LOGIN ul = new USER_LOGIN();

            ul.Show();
        }
        private void btndeactivate_Click(object sender, EventArgs e)
        {
            string s = "delete from customer_info where email='" + uname + "'";

            dataaccess_layer.ProcessQuery(s);
            USER_LOGIN ul = new USER_LOGIN();

            ul.Show();
        }
        private void btnsubmit_Click(object sender, EventArgs e)
        {
            try
            {
                int valid1 = 0;
                if (cbgen.Text == "Select Gender" || cbssn.Text == "Select ID proof type")
                {
                    valid = 1;
                }
                if (lblcaptcha.Text != tbcaptcha.Text)
                {
                    MessageBox.Show("Incorrect Captcha");
                    Random        random      = new Random();
                    string        combination = "0123456789ABCDEFGHIJKJLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
                    StringBuilder captcha     = new StringBuilder();
                    for (int i = 0; i < 6; i++)
                    {
                        captcha.Append(combination[random.Next(combination.Length)]);
                    }
                    lblcaptcha.Text = captcha.ToString();
                }
                foreach (Control tb in this.Controls)
                {
                    if (tb is TextBox)
                    {
                        valid1 = bussiness_accesslayer.null_validation(tb.Text);
                        if (valid1 == 1 || valid == 1)
                        {
                            MessageBox.Show("Empty Fields Not Allowed", "Error");
                            break;
                        }
                        if (valid == 2 || valid3 == 2 || valid4 == 2)
                        {
                            MessageBox.Show("Validations Not Satisfied", "Error");
                            break;
                        }
                        else
                        {
                            valid4 = 0;
                        }
                    }
                }


                if (valid == 0 && valid1 == 0 && valid3 == 0 && valid4 == 0 && lblcaptcha.Text == tbcaptcha.Text)
                {
                    string        encrpyt = bussiness_accesslayer.Encrypt(tbpass.Text);
                    SqlDataReader sdr     = null;
                    string        conn    = "Data Source=DESKTOP-OPN87JD\\SQLEXPRESS;Initial Catalog=ExpDB;Integrated Security=True";
                    SqlConnection sc      = null;
                    sc = new SqlConnection(conn);
                    try
                    {
                        sc.Open();
                        SqlCommand cmd = new SqlCommand("Cust_Reg", sc);
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Parameters.AddWithValue("@Cname", tbname.Text);
                        cmd.Parameters.AddWithValue("@DOB", dob.Value.Date.ToShortDateString());
                        cmd.Parameters.AddWithValue("@Address", tbadd.Text);
                        cmd.Parameters.AddWithValue("@Phone", tbphone.Text);
                        cmd.Parameters.AddWithValue("@Email", tbemail.Text);
                        cmd.Parameters.AddWithValue("@Password", encrpyt);
                        cmd.Parameters.AddWithValue("@SSNType", cbssn.Text);
                        cmd.Parameters.AddWithValue("@SSNNumber", tbssn.Text);
                        cmd.Parameters.AddWithValue("@Gender", cbgen.Text);
                        cmd.Parameters.AddWithValue("@Security1", cmbsecurity1.Text);
                        cmd.Parameters.AddWithValue("@Security2", cmbsecurity2.Text);
                        cmd.Parameters.AddWithValue("@Security3", cmbsecurity3.Text);
                        cmd.Parameters.AddWithValue("@Answer1", tbanswer1.Text);
                        cmd.Parameters.AddWithValue("@Answer2", tbanswer2.Text);
                        cmd.Parameters.AddWithValue("@Answer3", tbanswer3.Text);
                        sdr = cmd.ExecuteReader();
                    }
                    catch (Exception ex)
                    {
                        bussiness_accesslayer.LogErrorFile(ex.Message + DateTime.Now.ToLongDateString() + DateTime.Now.ToLongTimeString());
                        MessageBox.Show("Internal Error Occured", "Sorry");
                        this.BeginInvoke(new MethodInvoker(Close));
                    }
                    MessageBox.Show("Registration is Successful", "Congrats");
                    MessageBox.Show("Your Email will be user ID", "Remember");
                    btnclear_Click(btnclear, null);
                    this.Close();
                    USER_LOGIN ul = new USER_LOGIN();
                    ul.Show();
                }
                valid = 0;
            }

            catch (Exception ex)
            {
                bussiness_accesslayer.LogErrorFile(ex.Message + DateTime.Now.ToLongDateString() + DateTime.Now.ToLongTimeString());
                MessageBox.Show("Internal Error Occured", "Sorry");
                this.BeginInvoke(new MethodInvoker(Close));
            }
        }