private void CreaStrutturaSuNetSqlAzMan(string connectionString, int n) { this.Clessidra(true); this.StartTimer(); WindowsIdentity id = WindowsIdentity.GetCurrent(); IAzManStorage storage = new SqlAzManStorage(connectionString); storage.ENS.AuthorizationCreated += new NetSqlAzMan.ENS.AuthorizationCreatedDelegate(ENS_AuthorizationCreated); try { IAzManStore s = storage["Store Stress Test"]; if (s != null) { s.Delete(); } } catch { } storage.OpenConnection(); storage.BeginTransaction(AzManIsolationLevel.ReadUncommitted); IAzManStore store = storage.CreateStore("Store Stress Test", String.Empty); this.pb.Maximum = n - 1; for (int a = 0; a < n; a++) { IAzManApplication app = store.CreateApplication("Application" + a.ToString(), String.Empty); this.pb.Value = a; Application.DoEvents(); for (int i = 0; i < n; i++) { IAzManItem role = app.CreateItem("Role" + i.ToString(), String.Empty, ItemType.Role); IAzManItem task = app.CreateItem("Task" + i.ToString(), String.Empty, ItemType.Task); IAzManItem op = app.CreateItem("Operation" + i.ToString(), String.Empty, ItemType.Operation); role.AddMember(task); task.AddMember(op); role.CreateAuthorization(new SqlAzManSID(id.User), WhereDefined.LDAP, new SqlAzManSID(id.User), WhereDefined.LDAP, AuthorizationType.Allow, null, null); //add current Windows user //role.CreateAuthorization(new SqlAzManSID(id.User), WhereDefined.LDAP, new SqlAzManSID(storage.GetDBUser("Andrea").CustomSid.BinaryValue, true), WhereDefined.Database, AuthorizationType.Allow, null, null); //add Andrea DB User } } //storage.RollBackTransaction(); storage.CommitTransaction(); storage.CloseConnection(); this.StopTimer(this.txtNetSqlAzManElapsed); this.Clessidra(false); }