diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/ViewModels/UserCreationDialogVM.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/ViewModels/UserCreationDialogVM.cs | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/ViewModels/UserCreationDialogVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/ViewModels/UserCreationDialogVM.cs deleted file mode 100644 index 08762ac96..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.UsersAndRoles/ViewModels/UserCreationDialogVM.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SimpleValidator.Extensions; -using Tango.SharedUI; - -namespace Tango.MachineStudio.UsersAndRoles.ViewModels -{ - public class UserCreationDialogVM : DialogViewVM - { - private static Random rnd = new Random(); - - private String _email; - [Required(ErrorMessage = "Email is required")] - [EmailAddress(ErrorMessage = "Please provide a valid email")] - public String Email - { - get { return _email; } - set { _email = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } - } - - private String _password; - public String Password - { - get { return _password; } - set { _password = value; RaisePropertyChangedAuto(); } - } - - private String _firstName; - [Required(ErrorMessage = "First name is required")] - public String FirstName - { - get { return _firstName; } - set { _firstName = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } - } - - private String _lastName; - [Required(ErrorMessage = "Last name is required")] - public String LastName - { - get { return _lastName; } - set { _lastName = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } - } - - protected override void Accept() - { - if (Validate()) - { - base.Accept(); - } - } - - public override void OnShow() - { - base.OnShow(); - Password = GetRandomPassword(4); - } - - private String GetRandomPassword(int count) - { - String pass = String.Empty; - - for (int i = 0; i < count; i++) - { - pass += rnd.Next(0, 9).ToString(); - } - - return pass; - } - } -} |
