UserViewModels.cs
1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
namespace CWA.CpoOnline.Models
{
public class CpoUserViewModelWithPassword : CpoUserViewModel
{
[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm password")]
[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
}
public class CpoUserViewModel
{
public string Id { get; set; }
[Required]
[Display(Name = "First name")]
[StringLength(100, ErrorMessage = "{0} must be at least {2} characters long.", MinimumLength = 2)]
public string FirstName { get; set; }
[Required]
[Display(Name = "Last name")]
[StringLength(100, ErrorMessage = "{0} must be at least {2} characters long.", MinimumLength = 2)]
public string LastName { get; set; }
[Required]
[EmailAddress]
[Display(Name = "Email")]
public string Email { get; set; }
[Display(Name = "Administrator")]
public bool IsAdministrator { get; set; }
[Display(Name = "Created")]
public DateTime Created { get; set; }
[Display(Name = "Last Login")]
public DateTime? LastLogin { get; set; }
[Display(Name = "Modified")]
public DateTime? Modified { get; set; }
}
public class UserAccessViewModel
{
[Key]
public string UserId { get; set; }
public CpoUserViewModel User { get; set; }
public List<string> SectorIdList { get; set; } = new List<string>();
public List<string> SymbolIdList { get; set; } = new List<string>();
}
}