Exemplo n.º 1
0
        public void dropRole()
        {
            // Get role
            Console.WriteLine("\nEnter role:");
            String roleName = Console.ReadLine();

            if (roleName != null && roleName.Length > 0)
            {
                AdminPolicy adminPolicy = new AdminPolicy();
                client.DropRole(adminPolicy, roleName);
                Console.WriteLine("\nINFO: The role has been dropped.");
            }
            else
            {
                Console.WriteLine("ERROR: Role not found!");
            }
        }
        private void DropClicked(object sender, EventArgs e)
        {
            try
            {
                int row = gridRoles.CurrentRow.Index;

                if (row >= 0)
                {
                    string       name   = roles[row].name;
                    DialogResult result = MessageBox.Show("Drop role " + name + "?", "Confirm Drop", MessageBoxButtons.YesNo);

                    if (result == DialogResult.Yes)
                    {
                        client.DropRole(null, name);
                        ReadRoles();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }