コード例 #1
0
        private void bunifuThinButton21_Click(object sender, EventArgs e)
        {
            String name, username, password, privilages;

            name     = txtame.Text;
            username = txtUsername.Text;
            password = txtPassword.Text;
            if (bunifuSwitch1.Value == true)
            {
                privilages = "1";
            }
            else
            {
                privilages = "2";
            }

            bool status = new AccessCOntroller().addUser(name.ToUpper(), username.ToUpper(), password, privilages);

            if (status = true)
            {
                MessageBox.Show("Added Successfully");
                txtame.Text      = "";
                txtPassword.Text = "";
                txtUsername.Text = "";
            }
            else
            {
                MessageBox.Show("Something Wrong.Plese try again");
            }
        }
 private void bunifuThinButton22_Click(object sender, EventArgs e)
 {
     if (txtNameForSearch.Text == "")
     {
         MessageBox.Show("Please Enter a Name");
     }
     else
     {
         List <String> userDetails = new AccessCOntroller().searchUser(txtNameForSearch.Text);
         txtName.Text       = userDetails[0];
         txtUsername.Text   = userDetails[1];
         txtPrivilages.Text = userDetails[3];
         txtPassword.Text   = userDetails[2];
     }
 }
        private void btnLogin_Click(object sender, EventArgs e)
        {
            String username = txtUserName.Text;
            String password = txtPassword.Text;

            bool status = new AccessCOntroller().login(username, password);

            if (status == true)
            {
                this.Hide();
            }
            else
            {
                txtPassword.Text = "";
                txtUserName.Text = "";
            }
        }