Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/20/12 13:39:59 (13 years ago)
Author:
ascheibe
Message:

#1648 added ui for assigning users to groups

Location:
branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3/Views
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3/Views/UserGroupView.Designer.cs

    r7637 r7639  
    2828      this.groupNameTextBox = new System.Windows.Forms.TextBox();
    2929      this.idTextBox = new System.Windows.Forms.TextBox();
     30      this.refreshableLightweightUserView = new HeuristicLab.Clients.Access.Views.RefreshableLightweightUserView();
     31      this.storeButton = new System.Windows.Forms.Button();
    3032      this.SuspendLayout();
    3133      //
     
    5052      // groupNameTextBox
    5153      //
    52       this.groupNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    53             | System.Windows.Forms.AnchorStyles.Right)));
     54      this.groupNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     55                  | System.Windows.Forms.AnchorStyles.Right)));
    5456      this.groupNameTextBox.Location = new System.Drawing.Point(79, 3);
    5557      this.groupNameTextBox.Name = "groupNameTextBox";
    56       this.groupNameTextBox.Size = new System.Drawing.Size(282, 20);
     58      this.groupNameTextBox.Size = new System.Drawing.Size(675, 20);
    5759      this.groupNameTextBox.TabIndex = 2;
    5860      this.groupNameTextBox.TextChanged += new System.EventHandler(this.groupNameTextBox_TextChanged);
     
    6062      // idTextBox
    6163      //
    62       this.idTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    63             | System.Windows.Forms.AnchorStyles.Right)));
     64      this.idTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     65                  | System.Windows.Forms.AnchorStyles.Right)));
    6466      this.idTextBox.Enabled = false;
    6567      this.idTextBox.Location = new System.Drawing.Point(79, 29);
    6668      this.idTextBox.Name = "idTextBox";
    67       this.idTextBox.Size = new System.Drawing.Size(282, 20);
     69      this.idTextBox.Size = new System.Drawing.Size(675, 20);
    6870      this.idTextBox.TabIndex = 3;
     71      //
     72      // refreshableLightweightUserView
     73      //
     74      this.refreshableLightweightUserView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     75                  | System.Windows.Forms.AnchorStyles.Left)
     76                  | System.Windows.Forms.AnchorStyles.Right)));
     77      this.refreshableLightweightUserView.Caption = "RefreshableLightweightUser View";
     78      this.refreshableLightweightUserView.Content = null;
     79      this.refreshableLightweightUserView.FetchSelectedUsers = null;
     80      this.refreshableLightweightUserView.Location = new System.Drawing.Point(0, 55);
     81      this.refreshableLightweightUserView.Name = "refreshableLightweightUserView";
     82      this.refreshableLightweightUserView.ReadOnly = false;
     83      this.refreshableLightweightUserView.Size = new System.Drawing.Size(754, 282);
     84      this.refreshableLightweightUserView.TabIndex = 4;
     85      //
     86      // storeButton
     87      //
     88      this.storeButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.PublishToWeb;
     89      this.storeButton.Location = new System.Drawing.Point(31, 58);
     90      this.storeButton.Name = "storeButton";
     91      this.storeButton.Size = new System.Drawing.Size(24, 24);
     92      this.storeButton.TabIndex = 5;
     93      this.storeButton.UseVisualStyleBackColor = true;
     94      this.storeButton.Click += new System.EventHandler(this.storeButton_Click);
    6995      //
    7096      // UserGroupView
     
    7298      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    7399      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     100      this.Controls.Add(this.storeButton);
     101      this.Controls.Add(this.refreshableLightweightUserView);
    74102      this.Controls.Add(this.idTextBox);
    75103      this.Controls.Add(this.groupNameTextBox);
     
    77105      this.Controls.Add(this.label1);
    78106      this.Name = "UserGroupView";
    79       this.Size = new System.Drawing.Size(364, 54);
     107      this.Size = new System.Drawing.Size(757, 340);
    80108      this.ResumeLayout(false);
    81109      this.PerformLayout();
     
    89117    private System.Windows.Forms.TextBox groupNameTextBox;
    90118    private System.Windows.Forms.TextBox idTextBox;
     119    private Views.RefreshableLightweightUserView refreshableLightweightUserView;
     120    private System.Windows.Forms.Button storeButton;
    91121  }
    92122}
  • branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3/Views/UserGroupView.cs

    r7637 r7639  
    2020#endregion
    2121
     22using System;
     23using System.Collections.Generic;
    2224using HeuristicLab.Core.Views;
    2325using HeuristicLab.MainForm;
     
    4244        groupNameTextBox.Clear();
    4345        idTextBox.Clear();
     46
     47        refreshableLightweightUserView.Content = null;
     48        refreshableLightweightUserView.FetchSelectedUsers = null;
    4449      } else {
    4550        groupNameTextBox.Text = Content.Name;
    4651        idTextBox.Text = Content.Id.ToString();
     52
     53        refreshableLightweightUserView.Content = Access.AccessClient.Instance;
     54        refreshableLightweightUserView.FetchSelectedUsers = new Func<List<Guid>>(delegate { return AccessAdministrationClient.CallAccessService<List<Guid>>(s => s.GetUserGroupIdsOfGroup(Content.Id)); });
    4755      }
    4856    }
     
    5260        Content.Name = this.groupNameTextBox.Text;
    5361    }
     62
     63    private void storeButton_Click(object sender, EventArgs e) {
     64      Action storeAction = new Action(delegate {
     65        foreach (var ug in refreshableLightweightUserView.GetCheckedUsers()) {
     66          AccessAdministrationClient.CallAccessService(s => s.AddUserGroupBaseToGroup(ug, Content));
     67        }
     68      });
     69
     70      Action deleteAction = new Action(delegate {
     71        foreach (var ug in refreshableLightweightUserView.GetDeletedUsers()) {
     72          AccessAdministrationClient.CallAccessService(s => s.RemoveUserGroupBaseFromGroup(ug, Content));
     73        }
     74      });
     75
     76      AccessAdministrationClient.Instance.ExecuteActionAsync(storeAction, PluginInfrastructure.ErrorHandling.ShowErrorDialog);
     77      AccessAdministrationClient.Instance.ExecuteActionAsync(deleteAction, PluginInfrastructure.ErrorHandling.ShowErrorDialog);
     78    }
    5479  }
    5580}
Note: See TracChangeset for help on using the changeset viewer.