private void button1_Click(object sender, EventArgs e)
        {
            AdminPanel ap = new AdminPanel();

            ap.Show();
            this.Hide();
        }
示例#2
0
        private void button2_Click(object sender, EventArgs e)
        {
            bool found = false;
            busticketDataContext db = new busticketDataContext();
            string email            = textBox1.Text;
            string password         = textBox2.Text;

            if (email.Equals("cc") && password.Equals("ccc"))
            {
                this.Hide();
                AdminPanel a = new AdminPanel();
                a.Show();
            }
            else
            {
                foreach (var item in db.Users)
                {
                    if (email.Equals(item.email) && password.Equals(item.password))
                    {
                        MessageBox.Show("You are a member");

                        found = true;
                        ForJourney j = new ForJourney();
                        j.Show();
                        this.Hide();
                        break;
                    }
                }
                if (!found)
                {
                    MessageBox.Show("You are not a member");
                }
            }
        }