private void buttonConfirmationContinue_Click(object sender, EventArgs e) { DataTable UserAccounts = new DataTable(); UserAccounts = log.RunSelectQuery("UserAccounts", "*", "Username = \"" + textLoginUsername.Text + "\" AND Password = \"" + textLoginPassword.Text + "\""); if (UserAccounts.Rows.Count == 1) { string accountPermissions = UserAccounts.Rows[0][2].ToString(); if (accountPermissions == "admin") { this.Hide(); UIHome home = new UIHome(true, true, true); home.Show(); } else if (accountPermissions == "employee") { this.Hide(); UIHome home = new UIHome(false, false, false); home.Show(); } } else { MessageBox.Show("Wrong Username or Password"); } }
private void viewUsers() { dt = log.RunSelectQuery("UserAccounts", "*", ""); dataGridUsers.DataSource = dt; }
private void SetComboBox() { textInventoryCategory.ValueMember = "category"; textInventoryCategory.DataSource = log.RunSelectQuery("Inventory GROUP BY category", "category", ""); textInventoryCategory.SelectedIndex = -1; }