//Send Pin
        private void button1_Click(object sender, EventArgs e)
        {
            email = txtEmail.Text;
            Patient patient = new Patient();

            try
            {
                if (patient.isValidEmail(email))
                {
                    if (txtCaptcha.Text == finalString)
                    {
                        lblEmail.Text = "";

                        Random rnd = new Random();
                        randomNumber = (rnd.Next(1000, 9999)).ToString();

                        EmailProgressing check = new EmailProgressing(email, randomNumber);
                        check.ShowDialog();

                        timer1.Start();

                        txtEmail.Enabled   = false;
                        txtCaptcha.Enabled = false;

                        txtPin.Enabled = true;

                        btnSend.Enabled   = false;
                        btnSend.BackColor = Color.Silver;
                    }
                    else
                    {
                        email           = null;
                        lblCaptcha.Text = "Wrong Captcha";
                    }
                }
                else
                {
                    throw new CustomException("Invalid Email");
                }
            }
            catch (CustomException msg)
            {
                lblEmail.Text = msg.Message;
            }
        }
Example #2
0
        private void txtSend_Click(object sender, EventArgs e)
        {
            try
            {
                if (patient.isValidEmail(txtEmail.Text))
                {
                    try
                    {
                        count         = 60;
                        lblError.Text = "";
                        Random rnd = new Random();
                        randomNumber = (rnd.Next(1000, 9999)).ToString();

                        EmailProgressing check = new EmailProgressing(txtEmail.Text, randomNumber);
                        check.ShowDialog();

                        timer1.Start();

                        txtPin.Enabled = true;

                        btnSend.Enabled   = false;
                        btnSend.BackColor = Color.Silver;
                    }
                    catch
                    {
                        MessageBox.Show("Unable to Send Pin");
                    }
                }
                else
                {
                    throw new CustomException("Invalid Email");
                }
            }
            catch (CustomException msg)
            {
                lblError.Text = msg.Message;
            }
        }
Example #3
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            lblCaptcha.Text = "";

            if (validateTextBoxes())
            {
                Random rnd = new Random();
                randomNumber = (rnd.Next(1000, 9999)).ToString();

                EmailProgressing check = new EmailProgressing(email, randomNumber);
                check.ShowDialog();

                timer1.Start();

                btnSubmit.Enabled   = false;
                btnSubmit.BackColor = Color.Silver;

                txtPin.Enabled     = true;
                txtNew.Enabled     = false;
                txtRetype.Enabled  = false;
                txtCurrent.Enabled = false;
                txtCaptcha.Enabled = false;
            }
        }