Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/18/12 15:16:16 (12 years ago)
Author:
ascheibe
Message:

#1648 added roles management

Location:
branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3
Files:
4 added
6 edited

Legend:

Unmodified
Added
Removed
  • branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3/AccessAdministrationClient.cs

    r7637 r7848  
    4545
    4646    public ItemList<UserGroup> Groups { get; set; }
     47    public ItemList<Role> Roles { get; set; }
    4748    #endregion
    4849
     
    6768      ExecuteActionAsync(RefreshUserGroups, exceptionCallback);
    6869    }
     70
     71    public void RefreshRoles() {
     72      Roles = new ItemList<Role>();
     73      Roles.AddRange(CallAccessService<ItemList<Role>>(s => new ItemList<Role>(s.GetRoles())));
     74    }
     75
     76    public void RefreshRolesAsync(Action<Exception> exceptionCallback) {
     77      ExecuteActionAsync(RefreshRoles, exceptionCallback);
     78    }
     79
    6980    #endregion
    7081
     
    104115    }
    105116
     117    public void StoreRoles() {
     118      foreach (Role g in Roles) {
     119        if (g.Modified) {
     120          CallAccessService(s => s.AddRole(g));
     121          g.SetUnmodified();
     122        }
     123      }
     124    }
     125
     126    public void StoreRolesAsync(Action<Exception> exceptionCallback) {
     127      ExecuteActionAsync(StoreRoles, exceptionCallback);
     128    }
     129
    106130    //i don't think such a generic method is a good idea
    107131    /*public static void Store(IAccessItem item) {
     
    127151      Action deleteUserGroupAction = new Action(delegate { DeleteUserGroup(u); });
    128152      ExecuteActionAsync(deleteUserGroupAction, exceptionCallback);
     153    }
     154
     155    public void DeleteRole(Role u) {
     156      CallAccessService(s => s.DeleteRole(u));
     157    }
     158
     159    public void DeleteRoleAsync(Role u, Action<Exception> exceptionCallback) {
     160      Action deleteRoleAction = new Action(delegate { DeleteRole(u); });
     161      ExecuteActionAsync(deleteRoleAction, exceptionCallback);
    129162    }
    130163    #endregion
  • branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3/HeuristicLab.Clients.Access.Administration-3.3.csproj

    r7635 r7848  
    129129    <Compile Include="Plugin.cs" />
    130130    <Compile Include="Properties\AssemblyInfo.cs" />
     131    <Compile Include="Views\RefreshableRoleListView.cs">
     132      <SubType>UserControl</SubType>
     133    </Compile>
     134    <Compile Include="Views\RefreshableRoleListView.Designer.cs">
     135      <DependentUpon>RefreshableRoleListView.cs</DependentUpon>
     136    </Compile>
     137    <Compile Include="Views\RoleListView.cs">
     138      <SubType>UserControl</SubType>
     139    </Compile>
     140    <Compile Include="Views\RoleListView.Designer.cs">
     141      <DependentUpon>RoleListView.cs</DependentUpon>
     142    </Compile>
    131143    <Compile Include="Views\UserGroupListView.cs">
    132144      <SubType>UserControl</SubType>
  • branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3/Views/RoleView.Designer.cs

    r7635 r7848  
    3939      // roleNameTextBox
    4040      //
    41       this.roleNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    42             | System.Windows.Forms.AnchorStyles.Right)));
     41      this.roleNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     42                  | System.Windows.Forms.AnchorStyles.Right)));
    4343      this.roleNameTextBox.Location = new System.Drawing.Point(75, 3);
    4444      this.roleNameTextBox.Name = "roleNameTextBox";
    4545      this.roleNameTextBox.Size = new System.Drawing.Size(289, 20);
    4646      this.roleNameTextBox.TabIndex = 3;
     47      this.roleNameTextBox.TextChanged += new System.EventHandler(this.roleNameTextBox_TextChanged);
    4748      //
    4849      // RoleView
  • branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3/Views/RoleView.cs

    r7635 r7848  
    4545      }
    4646    }
     47
     48    private void roleNameTextBox_TextChanged(object sender, System.EventArgs e) {
     49      if (Content.Name != roleNameTextBox.Text)
     50        Content.Name = roleNameTextBox.Text;
     51    }
    4752  }
    4853}
  • branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3/Views/UserAdministrationDialog.Designer.cs

    r7635 r7848  
    2929      this.UserGroupsTabPage = new System.Windows.Forms.TabPage();
    3030      this.refreshableUserGroupListView = new HeuristicLab.Clients.Access.Administration.RefreshableUserGroupListView();
     31      this.rolesTabPage = new System.Windows.Forms.TabPage();
     32      this.refreshableRoleListView = new HeuristicLab.Clients.Access.Administration.RefreshableRoleListView();
    3133      this.mainTabControl.SuspendLayout();
    3234      this.usersTabPage.SuspendLayout();
    3335      this.UserGroupsTabPage.SuspendLayout();
     36      this.rolesTabPage.SuspendLayout();
    3437      this.SuspendLayout();
    3538      //
    3639      // refreshableUserListView
    3740      //
    38       this.refreshableUserListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
    39             | System.Windows.Forms.AnchorStyles.Left)
    40             | System.Windows.Forms.AnchorStyles.Right)));
     41      this.refreshableUserListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     42                  | System.Windows.Forms.AnchorStyles.Left)
     43                  | System.Windows.Forms.AnchorStyles.Right)));
    4144      this.refreshableUserListView.Caption = "View";
    4245      this.refreshableUserListView.Content = null;
     
    4952      // mainTabControl
    5053      //
    51       this.mainTabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
    52             | System.Windows.Forms.AnchorStyles.Left)
    53             | System.Windows.Forms.AnchorStyles.Right)));
     54      this.mainTabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     55                  | System.Windows.Forms.AnchorStyles.Left)
     56                  | System.Windows.Forms.AnchorStyles.Right)));
    5457      this.mainTabControl.Controls.Add(this.usersTabPage);
    5558      this.mainTabControl.Controls.Add(this.UserGroupsTabPage);
     59      this.mainTabControl.Controls.Add(this.rolesTabPage);
    5660      this.mainTabControl.Location = new System.Drawing.Point(12, 12);
    5761      this.mainTabControl.Name = "mainTabControl";
     
    8488      // refreshableUserGroupListView
    8589      //
    86       this.refreshableUserGroupListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
    87             | System.Windows.Forms.AnchorStyles.Left)
    88             | System.Windows.Forms.AnchorStyles.Right)));
     90      this.refreshableUserGroupListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     91                  | System.Windows.Forms.AnchorStyles.Left)
     92                  | System.Windows.Forms.AnchorStyles.Right)));
    8993      this.refreshableUserGroupListView.Caption = "View";
    9094      this.refreshableUserGroupListView.Content = null;
     
    9498      this.refreshableUserGroupListView.Size = new System.Drawing.Size(762, 364);
    9599      this.refreshableUserGroupListView.TabIndex = 0;
     100      //
     101      // rolesTabPage
     102      //
     103      this.rolesTabPage.Controls.Add(this.refreshableRoleListView);
     104      this.rolesTabPage.Location = new System.Drawing.Point(4, 22);
     105      this.rolesTabPage.Name = "rolesTabPage";
     106      this.rolesTabPage.Padding = new System.Windows.Forms.Padding(3);
     107      this.rolesTabPage.Size = new System.Drawing.Size(774, 376);
     108      this.rolesTabPage.TabIndex = 2;
     109      this.rolesTabPage.Text = "Roles";
     110      this.rolesTabPage.UseVisualStyleBackColor = true;
     111      //
     112      // refreshableRoleListView
     113      //
     114      this.refreshableRoleListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     115                  | System.Windows.Forms.AnchorStyles.Left)
     116                  | System.Windows.Forms.AnchorStyles.Right)));
     117      this.refreshableRoleListView.Caption = "View";
     118      this.refreshableRoleListView.Content = null;
     119      this.refreshableRoleListView.Location = new System.Drawing.Point(6, 6);
     120      this.refreshableRoleListView.Name = "refreshableRoleListView";
     121      this.refreshableRoleListView.ReadOnly = false;
     122      this.refreshableRoleListView.Size = new System.Drawing.Size(762, 364);
     123      this.refreshableRoleListView.TabIndex = 0;
    96124      //
    97125      // UserAdministrationDialog
     
    112140      this.usersTabPage.ResumeLayout(false);
    113141      this.UserGroupsTabPage.ResumeLayout(false);
     142      this.rolesTabPage.ResumeLayout(false);
    114143      this.ResumeLayout(false);
    115144
     
    123152    private System.Windows.Forms.TabPage UserGroupsTabPage;
    124153    private RefreshableUserGroupListView refreshableUserGroupListView;
     154    private System.Windows.Forms.TabPage rolesTabPage;
     155    private RefreshableRoleListView refreshableRoleListView;
    125156  }
    126157}
  • branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3/Views/UserAdministrationDialog.cs

    r7635 r7848  
    3232        refreshableUserListView.Content = AccessAdministrationClient.Instance;
    3333        refreshableUserGroupListView.Content = AccessAdministrationClient.Instance;
     34        refreshableRoleListView.Content = AccessAdministrationClient.Instance;
    3435      }
    3536    }
Note: See TracChangeset for help on using the changeset viewer.