Exemplo n.º 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();
            }
        }
Exemplo n.º 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();
            }
        }
Exemplo n.º 3
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();
            }
        }