Exemple #1
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();
                }

            }
        }
Exemple #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();
                }
            }
        }
Exemple #3
0
 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();
 }
Exemple #4
0
 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();
 }