예제 #1
0
        private void dgvSearchResults_SelectionChanged(object sender, EventArgs e)
        {
            String selectedUser = dgvSearchResults.SelectedRows[0].Cells[0].Value.ToString();

            myUser = Program.ARTISClient.getResUser(selectedUser, Program.TOKEN);
            DataTable privLevels = Program.ARTISClient.getPrivLevels();

            if (myUser.dbMessage == "Found")
            {
                lblFoundUser.Text        = myUser.Username;
                lblFoundDateCreated.Text = myUser.CreateDate.ToString();
                lblFoundPrivLevel.Text   = myUser.PrivLevel;
                lblFoundNotes.Text       = myUser.Notes;

                txtEditUserName.Text = myUser.Username;
                txtEditPassword.Text = myUser.Password;
                txtEditNotes.Text    = myUser.Notes;

                //Add the PrivLevels to combobox
                foreach (DataRow row in privLevels.Rows)
                {
                    comboPrivLevel.Items.Add(row["PrivLevel"]);
                }
                comboPrivLevel.SelectedItem = myUser.PrivLevel;
            }
            else
            {
                ArtisMessage msg = new ArtisMessage("User Not Found!");
                msg.ShowDialog();
            }
        }
예제 #2
0
        private void btnLoadUser_Click(object sender, EventArgs e)
        {
            myUser = Program.ARTISClient.getResUser(txtUsername.Text, Program.TOKEN);
            DataTable privLevels = Program.ARTISClient.getPrivLevels();

            if (searchResults != null)
            {
                lblFoundUser.Text        = myUser.Username;
                lblFoundDateCreated.Text = myUser.CreateDate.ToString();
                lblFoundPrivLevel.Text   = myUser.PrivLevel;
                lblFoundNotes.Text       = myUser.Notes;

                txtEditUserName.Text = myUser.Username;
                txtEditPassword.Text = myUser.Password;
                txtEditNotes.Text    = myUser.Notes;

                //Add the PrivLevels to combobox
                foreach (DataRow row in privLevels.Rows)
                {
                    comboPrivLevel.Items.Add(row["PrivLevel"]);
                }
                comboPrivLevel.SelectedItem = myUser.PrivLevel;
            }
            else
            {
                ArtisMessage msg = new ArtisMessage("User Not Found!");
                msg.ShowDialog();
            }
        }
예제 #3
0
        private void logOutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Program.ARTISClient.logOut(Program.TOKEN);
            txtUsername.Text      = "";
            txtPassword.Text      = "";
            lblUsername.Visible   = true;
            lblPassword.Visible   = true;
            txtUsername.Visible   = true;
            txtPassword.Visible   = true;
            btnLogIn.Visible      = true;
            lblLogInError.Visible = false;
            this.Text             = "ARTIS Administration System - Logged Out";
            ArtisMessage msg = new ArtisMessage("Logged Out");

            msg.Show();
        }
예제 #4
0
        private void btnFindByNotes_Click(object sender, EventArgs e)
        {
            ClearTextFields();
            searchResults = Program.ARTISClient.notesContains(txtFindByNotes.Text);
            DataTable privLevels = Program.ARTISClient.getPrivLevels();

            if (searchResults.Rows.Count > 0)
            {
                foreach (DataRow row in searchResults.Rows)
                {
                    dgvSearchResults.Rows.Add(row["Username"], row["Notes"]);
                }
            }
            else
            {
                ArtisMessage msg = new ArtisMessage("No users with notes containing " + txtFindByNotes.Text + " found!");
                msg.ShowDialog();
            }
        }
예제 #5
0
        private void btnLogIn_Click(object sender, EventArgs e)
        {
            Program.TOKEN = Program.ARTISClient.logIn(txtUsername.Text, txtPassword.Text);

            if (Program.TOKEN == "Invalid Credentials")
            {
                lblLogInError.Visible = true;
            }
            else
            {
                lblUsername.Visible   = false;
                lblPassword.Visible   = false;
                txtUsername.Visible   = false;
                txtPassword.Visible   = false;
                btnLogIn.Visible      = false;
                lblLogInError.Visible = false;
                this.Text             = "ARTIS Administration System - Logged In";
                ArtisMessage msg = new ArtisMessage("Log In Successful");
                msg.Show();
            }
        }