Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void ButtonChangePermissions_Click(object sender, RoutedEventArgs e)
- {
- if (ComboBoxSelectedProfile.SelectedIndex != -1)
- {
- ChangePermissionsWindow cpWindow = new ChangePermissionsWindow { parent = this };
- cpWindow.Show();
- }
- else
- {
- MessageBox.Show("Please choose a profile first.");
- }
- }
- public partial class ChangePermissionsWindow : Window
- {
- private readonly string dbConnectionString = Properties.Settings.Default.dbConnectionString;
- public postLoginWindow parent { get; set; }
- public ChangePermissionsWindow()
- {
- InitializeComponent();
- ComboBoxValuesToShow();
- }
- private void ComboBoxValuesToShow()
- {
- using (SqlConnection connection = new SqlConnection(dbConnectionString))
- {
- try
- {
- connection.Open();
- if (TableFunctions.doesTableExist("ProfilePermissions", dbConnectionString))
- {
- string selectQuery = "SELECT Permissions from ProfilePermissions where ProfileName=@ProfileName";
- using (SqlCommand command = new SqlCommand(selectQuery, connection))
- {
- command.Parameters.AddWithValue("@ProfileName", parent.ComboBoxSelectedProfile.Text);
- ...Does not matter from here
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement