コード例 #1
0
ファイル: MainForm.cs プロジェクト: ForeverSc/ParkingSystem
        private void button2_Click(object sender, EventArgs e)
        {
            bool IsCorrect = true;
            if (textBox1.Text.Length == 0)
            {
                MessageBox.Show("账号不可为空", "", MessageBoxButtons.OK);
                IsCorrect = false;
            }
            else if (textBox2.Text.Length == 0)
            {
                MessageBox.Show("密码不可为空", "", MessageBoxButtons.OK);
                IsCorrect = false;
            }
            if (IsCorrect == true)
            {
               admin=new BLL_Administrator(this.textBox1.Text,this.textBox2.Text);

                if (admin.ReturnIfLogged()==1)
                {
                    this.Hide();
                    ManLogged mlogged = new ManLogged();
                    mlogged.Show();

                }
                else
                {
                    MessageBox.Show("用户名或密码错误");
                    this.textBox1.Clear();
                    this.textBox2.Clear();
                }

            }
        }
コード例 #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            bool IsCorrect = true;

            if (textBox1.Text.Length == 0)
            {
                MessageBox.Show("账号不可为空", "", MessageBoxButtons.OK);
                IsCorrect = false;
            }
            else if (textBox2.Text.Length == 0)
            {
                MessageBox.Show("密码不可为空", "", MessageBoxButtons.OK);
                IsCorrect = false;
            }
            if (IsCorrect == true)
            {
                admin = new BLL_Administrator(this.textBox1.Text, this.textBox2.Text);

                if (admin.ReturnIfLogged() == 1)
                {
                    this.Hide();
                    ManLogged mlogged = new ManLogged();
                    mlogged.Show();
                }
                else
                {
                    MessageBox.Show("用户名或密码错误");
                    this.textBox1.Clear();
                    this.textBox2.Clear();
                }
            }
        }