Beispiel #1
0
        private void signInButton_Click(object sender, EventArgs e)//登录
        {
            FormRegisterAndSignIn formRegisterAndSignin = new FormRegisterAndSignIn(1);

            if (formRegisterAndSignin.ShowDialog() == DialogResult.OK)
            {
                currentClient = formRegisterAndSignin.currentClient;
                if (currentClient != null)
                {
                    nameTextBox.ReadOnly        = false;
                    nameTextBox.Text            = currentClient.Name;
                    nameTextBox.ReadOnly        = true;
                    this.signOutButton.Visible  = true;
                    this.signOutButton.Enabled  = true;
                    this.signInButton.Visible   = false;
                    this.signInButton.Enabled   = false;
                    this.registerButton.Visible = false;
                    this.registerButton.Enabled = false;
                    this.accountButton.Visible  = true;
                    this.libraryButton.Visible  = true;
                    if (currentClient.Name == "管理员")
                    {
                        this.managePictureBox.Visible = true;
                        this.managePictureBox.Enabled = true;
                    }
                }
            }
        }
Beispiel #2
0
        private void registerButton_Click(object sender, EventArgs e)//注册
        {
            FormRegisterAndSignIn formRegisterandSignin = new FormRegisterAndSignIn(2);

            formRegisterandSignin.ShowDialog();
        }