コード例 #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();
                }
            }
        }
コード例 #3
0
ファイル: ManLogged.cs プロジェクト: nofuente/ParkingSystem
 public ManLogged()
 {
     for (int i = 0; i <= 24; i++)
     {
         ButtonList.Add(new Button());
         //this.button1.Location = new System.Drawing.Point(3, 3);
         //this.button1.Name = "button1";
         ((Button)ButtonList[i]).Size     = new System.Drawing.Size(500, 500);
         ((Button)ButtonList[i]).TabIndex = i;
         ((Button)ButtonList[i]).Text     = "";
         ((Button)ButtonList[i]).UseVisualStyleBackColor = true;
     }
     InitializeComponent();
     manlog = this;
     ButtonUpdate();
     AdminInformationLog();
 }
コード例 #4
0
ファイル: ManLogged.cs プロジェクト: ForeverSc/ParkingSystem
 public ManLogged()
 {
     for (int i = 0; i <= 24; i++)
     {
         ButtonList.Add(new Button());
         //this.button1.Location = new System.Drawing.Point(3, 3);
         //this.button1.Name = "button1";
         ((Button)ButtonList[i]).Size = new System.Drawing.Size(500, 500);
         ((Button)ButtonList[i]).TabIndex = i;
         ((Button)ButtonList[i]).Text = "";
         ((Button)ButtonList[i]).UseVisualStyleBackColor = true;
     }
     InitializeComponent();
     manlog = this;
     ButtonUpdate();
     AdminInformationLog();
 }