Esempio n. 1
0
 private void iremoveProfile_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (_currentRole != null)
     {
         if (uxProfilesListBox.SelectedItems.Count == 1)
         {
             if (XtraMessageBox.Show("Sicuro di procedere nella cancellazione del profilo?", "Domanda", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
             {
                 string   item    = uxProfilesListBox.SelectedItems[0].ToString();
                 IProfile profile = GetProfileByDescription(item);
                 if (profile != null)
                 {
                     _currentRole.Profiles.Remove(profile);
                     //secureDataAccess.MarkDelete(new RoleProfile(_currentRole, profile));
                     DataAccessServices.SimplePersistenceFacadeInstance().ExecuteScalar(String.Format("Delete from roleprofile where roleID = {0} and profileID = {1}", _currentRole.ID, profile.ID));
                     LoadUserAndProfiles();
                 }
             }
         }
     }
 }