private void btn_submit_Click(object sender, EventArgs e)
        {
            bool IsValidPass  = _validate.IsValidPassword(txt_pass.Text);
            bool IsValidEmail = _validate.IsValidEmail(txt_email.Text);
            bool EmailPresent = _validate.EmailPresent(txt_email.Text);

            if (txt_pass.Text.Equals(txt_c_pass.Text) && IsValidPass && IsValidEmail && !EmailPresent)
            {
                string[] param  = { "a_name", "a_email", "a_pass" };
                string[] values = { txt_name.Text, txt_email.Text, txt_pass.Text };
                //SqlMng mng = new SqlMng();

                if (!_validate.checkEmpty(values))
                {
                    sqlMng.insertDB("admin_signup", param, values);
                    MessageBox.Show("Your request has been sent");
                }
                else
                {
                    MessageBox.Show("All Fields are required!");
                }
            }
            else if (!IsValidPass)
            {
                MessageBox.Show("Password must be more then 6 characters!");
            }
            else if (!IsValidEmail)
            {
                MessageBox.Show("Enter a proper Email");
            }
            else if (EmailPresent)
            {
                MessageBox.Show("Email already in use");
            }
            else if (!txt_pass.Text.Equals(txt_c_pass.Text))
            {
                MessageBox.Show("Passwords do not match");
            }
        }
Exemple #2
0
        private void btn_SignUp_Click(object sender, EventArgs e)
        {
            InitVariables();

            bool isValidEmail = vl.IsValidEmail(txt_Email.Text);
            bool emptyFlag    = vl.checkEmpty(fields);
            bool isValidPhone = vl.IsValidPhone(txt_Phone.Text);
            bool isValidPass  = vl.IsValidPassword(txt_Pass.Text);
            bool IdPresent    = vl.IdPresent(txt_Id.Text);

            if (emptyFlag == false && isValidEmail && isValidPhone && IdPresent == false && isValidPass)
            {
                sql.ProcessDB(sp_Name, param, value);
                MessageBox.Show("You are Registered!");
            }
            else if (IdPresent)
            {
                MessageBox.Show("You are already Registered");
            }
            else if (!isValidPass)
            {
                MessageBox.Show("Password should be more then 6 characters!");
            }
        }