private void btnMembersAddApplicationGroups_Click(object sender, EventArgs e)
 {
     frmApplicationGroupsList frm = new frmApplicationGroupsList();
     frm.application = this.applicationGroup.Application;
     frm.applicationGroup = this.applicationGroup;
     DialogResult dr = frm.ShowDialog(this);
     /*Application.DoEvents();*/
     frm.Dispose();
     /*Application.DoEvents();*/
     if (dr == DialogResult.OK)
     {
         foreach (IAzManApplicationGroup sg in frm.selectedApplicationGroups)
         {
             if (!this.MembersToRemove.Remove(sg.SID.StringValue))
             {
                 if (!this.MembersToAdd.ContainsByObjectSid(sg.SID.StringValue) && !this.FindMember(this.applicationGroup.GetApplicationGroupMembers(), sg.SID.StringValue))
                 {
                     this.MembersToAdd.Add(new GenericMember(sg.Name, sg.SID, WhereDefined.Application));
                     this.modified = true;
                 }
             }
         }
         this.RefreshApplicationGroupProperties();
     }
     this.HourGlass(false);
 }
 private void btnAddApplicationGroups_Click(object sender, EventArgs e)
 {
     try
     {
         frmApplicationGroupsList frm = new frmApplicationGroupsList();
         frm.application      = this.item.Application;
         frm.applicationGroup = null;
         DialogResult dr = frm.ShowDialog(this);
         if (dr == DialogResult.OK)
         {
             List <DataRow> rowsAdded = new List <DataRow>();
             foreach (IAzManApplicationGroup ag in frm.selectedApplicationGroups)
             {
                 rowsAdded.Add(this.AddApplicationDataRow(ag));
                 this.modified = true;
             }
             this.SelectDataGridViewRows(rowsAdded);
         }
         this.btnApply.Enabled = this.modified;
         //Adjust columns Width
         foreach (DataGridViewColumn dgvc in this.dgAuthorizations.Columns)
         {
             dgvc.Width = dgvc.GetPreferredWidth(DataGridViewAutoSizeColumnMode.AllCells, true);
         }
         this.HourGlass(false);
     }
     finally
     {
         this.btnApply.Enabled = this.modified;
     }
 }
Esempio n. 3
0
        private void btnNonMembersAddApplicationGroup_Click(object sender, EventArgs e)
        {
            this.HourGlass(true);
            frmApplicationGroupsList frm = new frmApplicationGroupsList();

            frm.application      = this.applicationGroup.Application;
            frm.applicationGroup = this.applicationGroup;
            DialogResult dr = frm.ShowDialog(this);

            this.HourGlass(true);
            if (dr == DialogResult.OK)
            {
                foreach (IAzManApplicationGroup sg in frm.selectedApplicationGroups)
                {
                    if (!this.NonMembersToRemove.Remove(sg.SID.StringValue))
                    {
                        if (!this.NonMembersToAdd.ContainsByObjectSid(sg.SID.StringValue) && !this.FindMember(this.applicationGroup.GetApplicationGroupNonMembers(), sg.SID.StringValue))
                        {
                            this.NonMembersToAdd.Add(new GenericMember(sg.Name, sg.SID, WhereDefined.Application));
                            this.modified = true;
                        }
                    }
                }
                this.RefreshApplicationGroupProperties();
            }
            this.HourGlass(false);
        }
 private void btnAddApplicationGroups_Click(object sender, EventArgs e)
 {
     try
     {
         frmApplicationGroupsList frm = new frmApplicationGroupsList();
         frm.application = this.item.Application;
         frm.applicationGroup = null;
         DialogResult dr = frm.ShowDialog(this);
         if (dr == DialogResult.OK)
         {
             List<DataRow> rowsAdded = new List<DataRow>();
             foreach (IAzManApplicationGroup ag in frm.selectedApplicationGroups)
             {
                 rowsAdded.Add(this.AddApplicationDataRow(ag));
                 this.modified = true;
             }
             this.SelectDataGridViewRows(rowsAdded);
         }
         this.btnApply.Enabled = this.modified;
         //Adjust columns Width
         foreach (DataGridViewColumn dgvc in this.dgAuthorizations.Columns)
         {
             dgvc.Width = dgvc.GetPreferredWidth(DataGridViewAutoSizeColumnMode.AllCells, true);
         }
         this.HourGlass(false);
     }
     finally
     {
         this.btnApply.Enabled = this.modified;
     }
 }