Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/20/09 13:37:39 (16 years ago)
Author:
svonolfe
Message:

Created Heuristiclab DB Core (refactoring) #527

Location:
trunk/sources/HeuristicLab.Hive.Server.Console
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Server.Console/HeuristicLab.Hive.Server.Console.csproj

    r1120 r1377  
    7373  </ItemGroup>
    7474  <ItemGroup>
    75     <Compile Include="AddUserForm.cs">
    76       <SubType>Form</SubType>
    77     </Compile>
    78     <Compile Include="AddUserForm.Designer.cs">
    79       <DependentUpon>AddUserForm.cs</DependentUpon>
    80     </Compile>
    8175    <Compile Include="AddJobForm.cs">
    8276      <SubType>Form</SubType>
     
    10094    <Compile Include="HiveServerConsolePlugin.cs" />
    10195    <Compile Include="Properties\AssemblyInfo.cs" />
    102     <EmbeddedResource Include="AddUserForm.resx">
    103       <DependentUpon>AddUserForm.cs</DependentUpon>
    104     </EmbeddedResource>
    10596    <EmbeddedResource Include="AddJobForm.resx">
    10697      <DependentUpon>AddJobForm.cs</DependentUpon>
     
    142133      <Name>HeuristicLab.Core</Name>
    143134    </ProjectReference>
     135    <ProjectReference Include="..\HeuristicLab.DataAccess\HeuristicLab.DataAccess.csproj">
     136      <Project>{9076697B-C151-46CD-95BC-1D059492B478}</Project>
     137      <Name>HeuristicLab.DataAccess</Name>
     138    </ProjectReference>
    144139    <ProjectReference Include="..\HeuristicLab.Hive.Contracts\HeuristicLab.Hive.Contracts.csproj">
    145140      <Project>{134F93D7-E7C8-4ECD-9923-7F63259A60D8}</Project>
  • trunk/sources/HeuristicLab.Hive.Server.Console/HiveServerManagementConsole.Designer.cs

    r1261 r1377  
    164164      this.userToolStripMenuItem1.Size = new System.Drawing.Size(114, 22);
    165165      this.userToolStripMenuItem1.Text = "User";
    166       this.userToolStripMenuItem1.Click += new System.EventHandler(this.AddUser_Click);
    167166      //
    168167      // groupToolStripMenuItem2
     
    171170      this.groupToolStripMenuItem2.Size = new System.Drawing.Size(114, 22);
    172171      this.groupToolStripMenuItem2.Text = "Group";
    173       this.groupToolStripMenuItem2.Click += new System.EventHandler(this.AddUserGroup_Click);
    174172      //
    175173      // tcManagementConsole
     
    337335      this.tvUserControl.Size = new System.Drawing.Size(139, 346);
    338336      this.tvUserControl.TabIndex = 1;
    339       this.tvUserControl.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.OnTVUserControlClicked);
    340337      //
    341338      // lvUserControl
     
    349346      this.lvUserControl.TabIndex = 1;
    350347      this.lvUserControl.UseCompatibleStateImageBehavior = false;
    351       this.lvUserControl.Click += new System.EventHandler(this.OnLVUserControlClicked);
    352348      //
    353349      // ilUserControl
  • trunk/sources/HeuristicLab.Hive.Server.Console/HiveServerManagementConsole.cs

    r1267 r1377  
    4444    private ResponseList<ClientInfo> clientInfo = null;
    4545    private ResponseList<Job> jobs = null;
    46     private ResponseList<UserGroup> userGroups = null;
    47     private ResponseList<User> usersList = null;
    4846
    4947    private Dictionary<long, ListViewGroup> clientObjects;
     
    5553    private Job currentJob = null;
    5654    private ClientInfo currentClient = null;
    57     private User currentUser = null;
    5855    private string nameCurrentJob = "";
    5956    private string nameCurrentClient = "";
     
    7067      AddClients();
    7168      AddJobs();
    72       AddUsers();
    7369      timerSyncronize.Start();
    7470    }
     
    182178
    183179    /// <summary>
    184     /// Adds users to ListView and TreeView
    185     /// </summary>
    186     private void AddUsers() {
    187       try {
    188         userGroupsObjects = new Dictionary<long, ListViewGroup>();
    189         userListObjects = new Dictionary<long, ListViewItem>();
    190         IUserRoleManager userRoleManager =
    191           ServiceLocator.GetUserRoleManager();
    192 
    193         userGroups = userRoleManager.GetAllUserGroups();
    194 
    195         lvUserControl.Items.Clear();
    196         tvUserControl.Nodes.Clear();
    197 
    198         foreach (UserGroup ug in userGroups.List) {
    199           tvUserControl.Nodes.Add(ug.Name);
    200           ListViewGroup lvg = new ListViewGroup(ug.Name, HorizontalAlignment.Left);
    201 
    202           foreach (PermissionOwner permOwner in ug.Members) {
    203             if (permOwner is User) {
    204               User users = permOwner as User;
    205               tvUserControl.Nodes[tvUserControl.Nodes.Count - 1].Nodes.Add(users.Name);
    206               ListViewItem item = new ListViewItem(users.Name, 0, lvg);
    207               lvUserControl.Items.Add(item);
    208               userListObjects.Add(users.Id, item);
    209             }
    210           }
    211           lvUserControl.Groups.Add(lvg);
    212           userGroupsObjects.Add(ug.Id, lvg);
    213 
    214         } // Users
    215         usersList = userRoleManager.GetAllUsers();
    216         ListViewGroup lvunsorted = new ListViewGroup("unsorted", HorizontalAlignment.Left);
    217         foreach (User u in usersList.List) {
    218           tvUserControl.Nodes.Add(u.Name);
    219           lvUserControl.Items.Add(new ListViewItem(u.Name, 0, lvunsorted));
    220         }
    221         lvUserControl.Groups.Add(lvunsorted);
    222         if (flagUser) {
    223           UserClicked();
    224         }
    225       }
    226       catch (Exception ex) {
    227         closeFormEvent(true, true);
    228         this.Close();
    229       }
    230     }
    231 
    232     /// <summary>
    233180    /// if one client is clicked, a panel is opened with the details
    234181    /// </summary>
     
    320267    }
    321268
    322     /// <summary>
    323     /// if one user is clicked, a panel is opened with the details
    324     /// </summary>
    325     private void UserClicked() {
    326       int i = 0;
    327       while (usersList.List[i].Name != nameCurrentUser) {
    328         i++;
    329       }
    330       currentUser = usersList.List[i];
    331       scUserControl.Panel2.Controls.Clear();
    332       scUserControl.Panel2.Controls.Add(plUserDetails);
    333       pbUserControl.Image = ilUserControl.Images[0];
    334       lblUserName.Text = currentUser.Id.ToString();
    335     }
    336 
    337269    #region Eventhandlers
    338270    /// <summary>
     
    368300      AddClients();
    369301      AddJobs();
    370       AddUsers();
    371     }
    372 
    373     private void AddUser_Click(object sender, EventArgs e) {
    374       AddUserForm newForm = new AddUserForm("User", false);
    375       newForm.Show();
    376       newForm.addUserEvent += new addDelegate(Refresh);
    377     }
    378 
    379     private void AddUserGroup_Click(object sender, EventArgs e) {
    380       AddUserForm newForm = new AddUserForm("User", true);
    381       newForm.Show();
    382       newForm.addUserEvent += new addDelegate(Refresh);                                             
    383302    }
    384303
     
    419338
    420339    }
    421 
    422     private void OnLVUserControlClicked(object sender, EventArgs e) {
    423       nameCurrentUser = lvUserControl.SelectedItems[0].Text;
    424       flagUser = true;
    425       UserClicked();
    426     }
    427 
    428     private void OnTVUserControlClicked(object sender, TreeViewEventArgs e) {
    429       bool usergroup = false;
    430       foreach (UserGroup ug in userGroups.List) {
    431         if (tvUserControl.SelectedNode.Text == ug.Name) {
    432           usergroup = true;
    433         }
    434       }
    435       if (usergroup == false) {
    436         nameCurrentUser = tvUserControl.SelectedNode.Text;
    437         flagUser = true;
    438         UserClicked();
    439       }
    440 
    441     }
    442 
    443340
    444341    private void btnClientClose_Click(object sender, EventArgs e) {
  • trunk/sources/HeuristicLab.Hive.Server.Console/ServiceLocator.cs

    r1136 r1377  
    2020    internal static IJobManager GetJobManager() {
    2121      return GetServerConsoleFacade() as IJobManager;
    22     }
    23 
    24     internal static IUserRoleManager GetUserRoleManager() {
    25       return GetServerConsoleFacade() as IUserRoleManager;
    2622    }
    2723
Note: See TracChangeset for help on using the changeset viewer.