private void ChangePassword() { if (SelectedItem != null) { PasswordEditDialog dlg = new PasswordEditDialog(SelectedItem, false); dlg.ShowDialog(); } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.w = ((HRManagerClient.PasswordEditDialog)(target)); return; case 2: #line 21 "..\..\..\..\Content\SystemUserManagement\PasswordEditDialog.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Submit_Click); #line default #line hidden return; case 3: this.userNameBox = ((System.Windows.Controls.TextBox)(target)); return; case 4: this.oldPwdBox = ((System.Windows.Controls.PasswordBox)(target)); #line 79 "..\..\..\..\Content\SystemUserManagement\PasswordEditDialog.xaml" this.oldPwdBox.PasswordChanged += new System.Windows.RoutedEventHandler(this.OldPwdBox_OnPasswordChanged); #line default #line hidden return; case 5: this.newPwdBox = ((System.Windows.Controls.PasswordBox)(target)); #line 86 "..\..\..\..\Content\SystemUserManagement\PasswordEditDialog.xaml" this.newPwdBox.PasswordChanged += new System.Windows.RoutedEventHandler(this.NewPwdBox_OnPasswordChanged); #line default #line hidden return; case 6: this.newPwdBoxRepeat = ((System.Windows.Controls.PasswordBox)(target)); #line 93 "..\..\..\..\Content\SystemUserManagement\PasswordEditDialog.xaml" this.newPwdBoxRepeat.PasswordChanged += new System.Windows.RoutedEventHandler(this.NewPwdBoxRepeat_OnPasswordChanged); #line default #line hidden return; } this._contentLoaded = true; }
protected override SystemUser GetNewItemInstance() { var newU = new SystemUser { UserName = "******", Creator = ModelSource.CurrentUser.UserName, CreateTime = DateTime.Now.ToString(), IsActive = true }; PasswordEditDialog dlg = new PasswordEditDialog(newU, true); dlg.ShowDialog(); var pwd = dlg.newPwdBox.Password; return(string.IsNullOrWhiteSpace(pwd) ? null : newU); }