Changeset 7651 for branches/ClientUserManagement
- Timestamp:
- 03/21/12 15:42:42 (13 years ago)
- Location:
- branches/ClientUserManagement
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3/Views/UserView.Designer.cs
r7637 r7651 28 28 this.userNameTextBox = new System.Windows.Forms.TextBox(); 29 29 this.fullNameTextBox = new System.Windows.Forms.TextBox(); 30 this.label3 = new System.Windows.Forms.Label(); 31 this.label4 = new System.Windows.Forms.Label(); 32 this.emailTextBox = new System.Windows.Forms.TextBox(); 33 this.idTextBox = new System.Windows.Forms.TextBox(); 34 this.label5 = new System.Windows.Forms.Label(); 35 this.label6 = new System.Windows.Forms.Label(); 36 this.lastActivityTextBox = new System.Windows.Forms.TextBox(); 37 this.lastLoginTextBox = new System.Windows.Forms.TextBox(); 38 this.resetPasswordButton = new System.Windows.Forms.Button(); 30 39 this.SuspendLayout(); 31 40 // … … 50 59 // userNameTextBox 51 60 // 52 this.userNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 53 | System.Windows.Forms.AnchorStyles.Right)));61 this.userNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 62 | System.Windows.Forms.AnchorStyles.Right))); 54 63 this.userNameTextBox.Enabled = false; 55 this.userNameTextBox.Location = new System.Drawing.Point(7 2, 3);64 this.userNameTextBox.Location = new System.Drawing.Point(76, 3); 56 65 this.userNameTextBox.Name = "userNameTextBox"; 57 this.userNameTextBox.Size = new System.Drawing.Size(28 9, 20);66 this.userNameTextBox.Size = new System.Drawing.Size(285, 20); 58 67 this.userNameTextBox.TabIndex = 2; 59 68 this.userNameTextBox.TextChanged += new System.EventHandler(this.userNameTextBox_TextChanged); … … 61 70 // fullNameTextBox 62 71 // 63 this.fullNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 64 | System.Windows.Forms.AnchorStyles.Right)));65 this.fullNameTextBox.Location = new System.Drawing.Point(7 2, 29);72 this.fullNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 73 | System.Windows.Forms.AnchorStyles.Right))); 74 this.fullNameTextBox.Location = new System.Drawing.Point(76, 29); 66 75 this.fullNameTextBox.Name = "fullNameTextBox"; 67 this.fullNameTextBox.Size = new System.Drawing.Size(28 9, 20);76 this.fullNameTextBox.Size = new System.Drawing.Size(285, 20); 68 77 this.fullNameTextBox.TabIndex = 3; 69 78 this.fullNameTextBox.TextChanged += new System.EventHandler(this.fullNameTextBox_TextChanged); 70 79 // 80 // label3 81 // 82 this.label3.AutoSize = true; 83 this.label3.Location = new System.Drawing.Point(3, 58); 84 this.label3.Name = "label3"; 85 this.label3.Size = new System.Drawing.Size(39, 13); 86 this.label3.TabIndex = 4; 87 this.label3.Text = "E-Mail:"; 88 // 89 // label4 90 // 91 this.label4.AutoSize = true; 92 this.label4.Location = new System.Drawing.Point(5, 84); 93 this.label4.Name = "label4"; 94 this.label4.Size = new System.Drawing.Size(19, 13); 95 this.label4.TabIndex = 5; 96 this.label4.Text = "Id:"; 97 // 98 // emailTextBox 99 // 100 this.emailTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 101 | System.Windows.Forms.AnchorStyles.Right))); 102 this.emailTextBox.Location = new System.Drawing.Point(76, 55); 103 this.emailTextBox.Name = "emailTextBox"; 104 this.emailTextBox.Size = new System.Drawing.Size(285, 20); 105 this.emailTextBox.TabIndex = 6; 106 this.emailTextBox.TextChanged += new System.EventHandler(this.emailTextBox_TextChanged); 107 // 108 // idTextBox 109 // 110 this.idTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 111 | System.Windows.Forms.AnchorStyles.Right))); 112 this.idTextBox.Enabled = false; 113 this.idTextBox.Location = new System.Drawing.Point(76, 81); 114 this.idTextBox.Name = "idTextBox"; 115 this.idTextBox.Size = new System.Drawing.Size(285, 20); 116 this.idTextBox.TabIndex = 7; 117 // 118 // label5 119 // 120 this.label5.AutoSize = true; 121 this.label5.Location = new System.Drawing.Point(3, 110); 122 this.label5.Name = "label5"; 123 this.label5.Size = new System.Drawing.Size(67, 13); 124 this.label5.TabIndex = 8; 125 this.label5.Text = "Last Activity:"; 126 // 127 // label6 128 // 129 this.label6.AutoSize = true; 130 this.label6.Location = new System.Drawing.Point(3, 136); 131 this.label6.Name = "label6"; 132 this.label6.Size = new System.Drawing.Size(59, 13); 133 this.label6.TabIndex = 9; 134 this.label6.Text = "Last Login:"; 135 // 136 // lastActivityTextBox 137 // 138 this.lastActivityTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 139 | System.Windows.Forms.AnchorStyles.Right))); 140 this.lastActivityTextBox.Enabled = false; 141 this.lastActivityTextBox.Location = new System.Drawing.Point(76, 107); 142 this.lastActivityTextBox.Name = "lastActivityTextBox"; 143 this.lastActivityTextBox.Size = new System.Drawing.Size(285, 20); 144 this.lastActivityTextBox.TabIndex = 10; 145 // 146 // lastLoginTextBox 147 // 148 this.lastLoginTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 149 | System.Windows.Forms.AnchorStyles.Right))); 150 this.lastLoginTextBox.Enabled = false; 151 this.lastLoginTextBox.Location = new System.Drawing.Point(76, 133); 152 this.lastLoginTextBox.Name = "lastLoginTextBox"; 153 this.lastLoginTextBox.Size = new System.Drawing.Size(285, 20); 154 this.lastLoginTextBox.TabIndex = 11; 155 // 156 // resetPasswordButton 157 // 158 this.resetPasswordButton.Location = new System.Drawing.Point(6, 159); 159 this.resetPasswordButton.Name = "resetPasswordButton"; 160 this.resetPasswordButton.Size = new System.Drawing.Size(96, 23); 161 this.resetPasswordButton.TabIndex = 12; 162 this.resetPasswordButton.Text = "Reset Password"; 163 this.resetPasswordButton.UseVisualStyleBackColor = true; 164 this.resetPasswordButton.Click += new System.EventHandler(this.resetPasswordButton_Click); 165 // 71 166 // UserView 72 167 // 73 168 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 74 169 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 170 this.Controls.Add(this.resetPasswordButton); 171 this.Controls.Add(this.lastLoginTextBox); 172 this.Controls.Add(this.lastActivityTextBox); 173 this.Controls.Add(this.label6); 174 this.Controls.Add(this.label5); 175 this.Controls.Add(this.idTextBox); 176 this.Controls.Add(this.emailTextBox); 177 this.Controls.Add(this.label4); 178 this.Controls.Add(this.label3); 75 179 this.Controls.Add(this.fullNameTextBox); 76 180 this.Controls.Add(this.userNameTextBox); … … 78 182 this.Controls.Add(this.label1); 79 183 this.Name = "UserView"; 80 this.Size = new System.Drawing.Size(364, 1 06);184 this.Size = new System.Drawing.Size(364, 185); 81 185 this.ResumeLayout(false); 82 186 this.PerformLayout(); … … 90 194 private System.Windows.Forms.TextBox userNameTextBox; 91 195 private System.Windows.Forms.TextBox fullNameTextBox; 196 private System.Windows.Forms.Label label3; 197 private System.Windows.Forms.Label label4; 198 private System.Windows.Forms.TextBox emailTextBox; 199 private System.Windows.Forms.TextBox idTextBox; 200 private System.Windows.Forms.Label label5; 201 private System.Windows.Forms.Label label6; 202 private System.Windows.Forms.TextBox lastActivityTextBox; 203 private System.Windows.Forms.TextBox lastLoginTextBox; 204 private System.Windows.Forms.Button resetPasswordButton; 92 205 } 93 206 } -
branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3/Views/UserView.cs
r7637 r7651 20 20 #endregion 21 21 22 using System; 23 using System.Windows.Forms; 22 24 using HeuristicLab.Core.Views; 23 25 using HeuristicLab.MainForm; … … 42 44 userNameTextBox.Clear(); 43 45 fullNameTextBox.Clear(); 46 emailTextBox.Clear(); 47 idTextBox.Clear(); 48 lastActivityTextBox.Clear(); 49 lastLoginTextBox.Clear(); 44 50 } else { 45 51 userNameTextBox.Text = Content.UserName; 46 52 fullNameTextBox.Text = Content.FullName; 53 emailTextBox.Text = Content.Email; 54 idTextBox.Text = Content.Id.ToString(); 55 lastActivityTextBox.Text = Content.LastActivityDate.ToString(); 56 lastLoginTextBox.Text = Content.LastLoginDate.ToString(); 47 57 } 48 58 } … … 57 67 Content.UserName = userNameTextBox.Text; 58 68 } 69 70 private void emailTextBox_TextChanged(object sender, System.EventArgs e) { 71 if (Content.Email != emailTextBox.Text) 72 Content.Email = emailTextBox.Text; 73 } 74 75 private void resetPasswordButton_Click(object sender, System.EventArgs e) { 76 Action a = new Action(delegate { 77 string result = AccessAdministrationClient.CallAccessService<string>(s => s.ResetPassword(Content.Id)); 78 ShowPassword(result); 79 }); 80 81 AccessAdministrationClient.Instance.ExecuteActionAsync(a, PluginInfrastructure.ErrorHandling.ShowErrorDialog); ; 82 } 83 84 private void ShowPassword(string result) { 85 if (InvokeRequired) { 86 Invoke(new Action<string>(ShowPassword), result); 87 } else { 88 MessageBox.Show("The new password is: " + result, "Password Reset", MessageBoxButtons.OK, MessageBoxIcon.Information); 89 } 90 } 59 91 } 60 92 } -
branches/ClientUserManagement/HeuristicLab.Services.Access/3.3/AccessService.cs
r7639 r7651 567 567 RoleVerifier.AuthenticateForAllRoles(AccessServiceRoles.Administrator); 568 568 569 AddUser(user); 569 MembershipUser membershipUser = Membership.GetUser((object)user.Id); 570 if (membershipUser != null) { 571 membershipUser.Email = user.Email; 572 membershipUser.IsApproved = user.IsApproved; 573 membershipUser.Comment = user.Comment; 574 Membership.UpdateUser(membershipUser); 575 } 576 577 using (DA.AccessServiceDataContext context = new DA.AccessServiceDataContext()) { 578 var query = from u in context.UserGroupBases.OfType<DA.User>() 579 where u.Id == user.Id 580 select u; 581 if (query.Count() > 0) { 582 DA.User u = query.First(); 583 u.FullName = user.FullName; 584 context.SubmitChanges(); 585 } 586 } 570 587 } 571 588
Note: See TracChangeset
for help on using the changeset viewer.