|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using System.Linq; |
| 4 | +using System.Threading.Tasks; |
| 5 | +using System.ComponentModel.DataAnnotations; |
| 6 | +using Syncfusion.Blazor.Inputs; |
| 7 | + |
| 8 | +namespace FormBuilder.Data |
| 9 | +{ |
| 10 | + public class EmployeeDetails |
| 11 | + { |
| 12 | + [Required] |
| 13 | + [Display(Name ="First Name")] |
| 14 | + [DataType(DataType.Text)] |
| 15 | + public string FirstName { get; set; } |
| 16 | + [Display(Name = "Last Name")] |
| 17 | + [DataType(DataType.Text)] |
| 18 | + public string LastName { get; set; } |
| 19 | + [Required] |
| 20 | + [Display(Name = "Email Address")] |
| 21 | + [DataType(DataType.EmailAddress)] |
| 22 | + [EmailAddress] |
| 23 | + public string Email { get; set; } |
| 24 | + [Required] |
| 25 | + [Display(Name = "PhoneNumber")] |
| 26 | + [DataType(DataType.PhoneNumber)] |
| 27 | + [Phone] |
| 28 | + public string PhoneNumber { get; set; } |
| 29 | + [Required] |
| 30 | + [Display(Name = "Date of Birth")] |
| 31 | + [DataType(DataType.Date)] |
| 32 | + public DateTime? DOB { get; set; } |
| 33 | + [Required] |
| 34 | + [DataType(DataType.Duration)] |
| 35 | + [Display(Name = "Total Experience")] |
| 36 | + [Range(0, 20, ErrorMessage = "The Experience range should be 0 to 20")] |
| 37 | + public decimal? TotalExperience { get; set; } |
| 38 | + [Required] |
| 39 | + [Display(Name = "Select a Country")] |
| 40 | + [DataType("DropdownList")] |
| 41 | + public string Country { get; set; } |
| 42 | + [Required] |
| 43 | + [Display(Name = "Select a City")] |
| 44 | + [DataType("ComboBox")] |
| 45 | + public string City { get; set; } |
| 46 | + [Required] |
| 47 | + [DataType(DataType.MultilineText)] |
| 48 | + [Display(Name = "Address")] |
| 49 | + public string Address { get; set; } |
| 50 | + } |
| 51 | + |
| 52 | + public class Countries |
| 53 | + { |
| 54 | + public string Name { get; set; } |
| 55 | + public string Code { get; set; } |
| 56 | + |
| 57 | + public List<Countries> GetCountries() |
| 58 | + { |
| 59 | + List<Countries> Country = new List<Countries> |
| 60 | + { |
| 61 | + new Countries() { Name = "Australia", Code = "AU" }, |
| 62 | + new Countries() { Name = "United Kingdom", Code = "UK" }, |
| 63 | + new Countries() { Name = "United States", Code = "US" }, |
| 64 | + }; |
| 65 | + return Country; |
| 66 | + } |
| 67 | + } |
| 68 | + public class Cities |
| 69 | + { |
| 70 | + public string Name { get; set; } |
| 71 | + public string Code { get; set; } |
| 72 | + public string CountryCode { get; set; } |
| 73 | + public List<Cities> GetCities() |
| 74 | + { |
| 75 | + List<Cities> CityName = new List<Cities> |
| 76 | + { |
| 77 | + new Cities() { Name = "New York", CountryCode = "US", Code="US-101" }, |
| 78 | + new Cities() { Name = "Virginia", CountryCode = "US", Code="US-102" }, |
| 79 | + new Cities() { Name = "Washington", CountryCode = "US", Code="US-103" }, |
| 80 | + new Cities() { Name = "Victoria", CountryCode = "AU", Code="AU-101" }, |
| 81 | + new Cities() { Name = "Tasmania", CountryCode = "AU", Code="AU-102" }, |
| 82 | + new Cities() { Name = "Queensland", CountryCode = "AU", Code="AU-103" }, |
| 83 | + new Cities() { Name = "London", CountryCode = "UK", Code="UK-101" }, |
| 84 | + new Cities() { Name = "Manchester", CountryCode = "UK", Code="UK-102" }, |
| 85 | + new Cities() { Name = "Ashford", CountryCode = "UK", Code="UK-103" } |
| 86 | + }; |
| 87 | + return CityName; |
| 88 | + } |
| 89 | + } |
| 90 | +} |
0 commit comments