Exemple #1
0
 private void button2_Click(object sender, System.EventArgs e)
 {
     this.Visible            = false;
     this.authenticationform = new authentication();
     this.authenticationform.ShowDialog();
     this.Close();
 }
Exemple #2
0
        private void button1_Click(object sender, System.EventArgs e)
        {
            int result, webresult = 3;

            result = Checkinformation(this.textBox1.Text, this.textBox2.Text, this.textBox3.Text,
                                      this.textBox4.Text, this.textBox5.Text, this.textBox6.Text);
            switch (result)
            {
            case 1:
            {
                this.label8.Text = "";
                webresult        = this.websrv.Signin(this.textBox1.Text, this.textBox2.Text,
                                                      this.textBox4.Text, this.textBox5.Text, this.textBox6.Text);
                break;
            }

            case 2:
            {
                this.textBox1.Focus();
                this.label8.Text = "Please fill all of filds. \nCan't left \"Username fild\" empty !!!";
                break;
            }

            case 3:
            {
                this.textBox2.Focus();
                this.label8.Text = "Please fill all of filds. \nCan't left \"Password fild\" empty !!!";
                break;
            }

            case 4:
            {
                this.textBox3.Focus();
                this.label8.Text = "Please fill all of filds. \nCan't left \"Confirmpassword\" fild empty !!!";
                break;
            }

            case 5:
            {
                this.textBox4.Focus();
                this.label8.Text = "Please fill all of filds. \nCan't left \"Name\" fild empty !!!";
                break;
            }

            case 6:
            {
                this.textBox5.Focus();
                this.label8.Text = "Please fill all of filds. \nCan't left \"Lastname\" fild empty !!!";
                break;
            }

            case 7:
            {
                this.textBox6.Focus();
                this.label8.Text = "Please fill all of filds. \nCan't left \"Email\" fild empty !!!";
                break;
            }

            case 8:
            {
                this.textBox2.Focus();
                this.textBox2.SelectAll();
                this.label8.Text = "The passwords you typed do not match !!!";
                break;
            }

            case 9:
            {
                this.textBox2.Focus();
                this.label8.Text = "For your password atleast type 6 charater !!!";
                break;
            }

            case 10:
            {
                this.textBox6.Focus();
                this.label8.Text = "Enter your email address completely !!! \nFor example [email protected]";
                break;
            }
            }
            switch (webresult)
            {
            case 0:
            {
                this.label8.Text = "Error: Can't insert data in bank !!!";
                break;
            }

            case 1:
            {
                bool         ok         = false;
                DialogResult disconnect = MessageBox.Show("Signin complete successfully",
                                                          "Message",
                                                          MessageBoxButtons.OK,
                                                          MessageBoxIcon.Information);
                ok = (disconnect == DialogResult.OK);
                if (ok)
                {
                    this.Visible            = false;
                    this.authenticationform = new authentication();
                    this.authenticationform.ShowDialog();
                    this.Close();
                }
                break;
            }

            case 2:
            {
                this.textBox1.Focus();
                this.textBox1.SelectAll();
                this.label8.Text = "\"" + this.textBox1.Text + "\"" + " registered !!!";
                break;
            }
            }
        }