Skip to content

Commit ecc604a

Browse files
committed
Update the project
1 parent 48be3f1 commit ecc604a

35 files changed

+1617
-1625
lines changed

App.razor

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
2-
<Router AppAssembly="@typeof(Program).Assembly">
3-
<Found Context="routeData">
4-
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
5-
</Found>
6-
<NotFound>
7-
<LayoutView Layout="@typeof(MainLayout)">
8-
<p>Sorry, there's nothing at this address.</p>
9-
</LayoutView>
10-
</NotFound>
11-
</Router>
1+
<Router AppAssembly="@typeof(App).Assembly">
2+
<Found Context="routeData">
3+
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
4+
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
5+
</Found>
6+
<NotFound>
7+
<PageTitle>Not found</PageTitle>
8+
<LayoutView Layout="@typeof(MainLayout)">
9+
<p role="alert">Sorry, there's nothing at this address.</p>
10+
</LayoutView>
11+
</NotFound>
12+
</Router>

Data/EmployeeDetails.cs

Lines changed: 90 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,90 @@
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-
}
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 DynamicFormBuilderSample.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+
}

Data/WeatherForecast.cs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
using System;
2-
3-
namespace FormBuilder.Data
4-
{
5-
public class WeatherForecast
6-
{
7-
public DateTime Date { get; set; }
8-
9-
public int TemperatureC { get; set; }
10-
11-
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
12-
13-
public string Summary { get; set; }
14-
}
15-
}
1+
namespace DynamicFormBuilderSample.Data
2+
{
3+
public class WeatherForecast
4+
{
5+
public DateOnly Date { get; set; }
6+
7+
public int TemperatureC { get; set; }
8+
9+
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
10+
11+
public string? Summary { get; set; }
12+
}
13+
}

Data/WeatherForecastService.cs

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
1-
using System;
2-
using System.Linq;
3-
using System.Threading.Tasks;
4-
5-
namespace FormBuilder.Data
6-
{
7-
public class WeatherForecastService
8-
{
9-
private static readonly string[] Summaries = new[]
10-
{
11-
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
12-
};
13-
14-
public Task<WeatherForecast[]> GetForecastAsync(DateTime startDate)
15-
{
16-
var rng = new Random();
17-
return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast
18-
{
19-
Date = startDate.AddDays(index),
20-
TemperatureC = rng.Next(-20, 55),
21-
Summary = Summaries[rng.Next(Summaries.Length)]
22-
}).ToArray());
23-
}
24-
}
25-
}
1+
namespace DynamicFormBuilderSample.Data
2+
{
3+
public class WeatherForecastService
4+
{
5+
private static readonly string[] Summaries = new[]
6+
{
7+
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
8+
};
9+
10+
public Task<WeatherForecast[]> GetForecastAsync(DateOnly startDate)
11+
{
12+
return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast
13+
{
14+
Date = startDate.AddDays(index),
15+
TemperatureC = Random.Shared.Next(-20, 55),
16+
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
17+
}).ToArray());
18+
}
19+
}
20+
}

DynamicFormBuilderSample.csproj

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net7.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Syncfusion.Blazor.Calendars" Version="23.1.40" />
11+
<PackageReference Include="Syncfusion.Blazor.DropDowns" Version="23.1.40" />
12+
<PackageReference Include="Syncfusion.Blazor.Inputs" Version="23.1.40" />
13+
<PackageReference Include="Syncfusion.Blazor.Themes" Version="23.1.40" />
14+
</ItemGroup>
15+
16+
</Project>
Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
2-
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.29521.150
5-
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FormBuilder", "FormBuilder.csproj", "{29630493-E009-4E88-8A4E-AD3ECF6F4A42}"
7-
EndProject
8-
Global
9-
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10-
Debug|Any CPU = Debug|Any CPU
11-
Release|Any CPU = Release|Any CPU
12-
EndGlobalSection
13-
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{29630493-E009-4E88-8A4E-AD3ECF6F4A42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{29630493-E009-4E88-8A4E-AD3ECF6F4A42}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{29630493-E009-4E88-8A4E-AD3ECF6F4A42}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{29630493-E009-4E88-8A4E-AD3ECF6F4A42}.Release|Any CPU.Build.0 = Release|Any CPU
18-
EndGlobalSection
19-
GlobalSection(SolutionProperties) = preSolution
20-
HideSolutionNode = FALSE
21-
EndGlobalSection
22-
GlobalSection(ExtensibilityGlobals) = postSolution
23-
SolutionGuid = {5352E4FF-D9CA-47FE-80E9-E1667501B45D}
24-
EndGlobalSection
25-
EndGlobal
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.4.33213.308
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DynamicFormBuilderSample", "DynamicFormBuilderSample.csproj", "{5BF98861-BD16-409C-8090-C526DDC48744}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{5BF98861-BD16-409C-8090-C526DDC48744}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{5BF98861-BD16-409C-8090-C526DDC48744}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{5BF98861-BD16-409C-8090-C526DDC48744}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{5BF98861-BD16-409C-8090-C526DDC48744}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {B2CED35D-C233-4E0A-A5E7-1C910A11F64C}
24+
EndGlobalSection
25+
EndGlobal

FormBuilder.csproj

Lines changed: 0 additions & 12 deletions
This file was deleted.

FormBuilder.csproj.user

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)