protected void CheckboxClicked(ChangeEventArgs e, string name)
 {
     if (PermissionVMs.Find(p => p.Name == name) != null)
     {
         bool Checked = PermissionVMs.Find(p => p.Name == name).Checked;
         PermissionVMs.Find(p => p.Name == name).Checked = !Checked;
         GetAllSelections();
     }
 }
 void MarkSelectedPermission()
 {
     PermissionVMs.Clear();
     foreach (var p in Permissions)
     {
         var pvm = new PermissionVM();
         Mapper.Map <ApplicationPermission, PermissionVM>(p, pvm);
         PermissionVMs.Add(pvm);
     }
     if (Role.Permissions != null)
     {
         foreach (var permission in Role.Permissions)
         {
             if (PermissionVMs.Find(p => p.Name == permission.Name) != null)
             {
                 PermissionVMs.Find(p => p.Name == permission.Name).Checked = true;
             }
         }
     }
     GetAllSelections();
 }