示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "" || textBox2.Text == "")
            {
                MessageBox.Show("All fields must be filled");
            }
            else
            {
                int log;
                log = connect.CheckLogIn(textBox1.Text, textBox2.Text);

                if (log == -1)
                {
                    Artists_admin newForm = new Artists_admin();
                    newForm.FormClosed += new FormClosedEventHandler(closeForm);
                    this.Hide();
                    newForm.Show();
                    newForm.Left = this.Left;
                    newForm.Top  = this.Top;
                }
                else if (log == 1)
                {
                    Artists_user newForm = new Artists_user(connect.ArtistForUser(textBox1.Text));
                    newForm.FormClosed += new FormClosedEventHandler(closeForm);
                    this.Hide();
                    newForm.Show();
                    newForm.Left = this.Left;
                    newForm.Top  = this.Top;
                }
                else
                {
                    MessageBox.Show("User/Password incorrect");
                }
            }
        }
示例#2
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "")
            {
                MessageBox.Show("All fields must be filled");
            }
            else
            {
                string s1 = Convert.ToString(textBox1.Text);
                bool   ok = true;

                for (int i = 0; i < s1.Length && ok; i++)
                {
                    if (s1[i] == '\'')
                    {
                        ok = false;
                    }
                }

                if (ok)
                {
                    connect.AddArtist(textBox1.Text, textBox2.Text, textBox3.Text);
                    Artists_admin newForm = new Artists_admin();
                    newForm.FormClosed += new FormClosedEventHandler(closeForm);
                    this.Hide();
                    newForm.Show();
                    newForm.Left = this.Left;
                    newForm.Top  = this.Top;
                }
                else
                {
                    MessageBox.Show("You cannot use the character \'");
                }
            }
        }
示例#3
0
        private void button5_Click(object sender, EventArgs e)
        {
            Artists_admin newForm = new Artists_admin();

            newForm.FormClosed += new FormClosedEventHandler(closeForm);
            this.Hide();
            newForm.Show();
            newForm.Left = this.Left;
            newForm.Top  = this.Top;
        }