Skip to content

Commit 27641de

Browse files
Merge pull request #1 from Backiaraj/querybuilder
Update the project
2 parents 0f16773 + e39d586 commit 27641de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1616
-1325
lines changed

BindingListDataSample.sln

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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}") = "BindingListDataSample.Server", "Server\BindingListDataSample.Server.csproj", "{E341CF35-1ADE-4BDE-A8F2-76A16C00A7A0}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BindingListDataSample.Client", "Client\BindingListDataSample.Client.csproj", "{B25B191D-2208-4C1F-A408-8C3A6CEC5C01}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BindingListDataSample.Shared", "Shared\BindingListDataSample.Shared.csproj", "{D649B4DB-9BDC-4AB4-831F-864047C703C8}"
11+
EndProject
12+
Global
13+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
14+
Debug|Any CPU = Debug|Any CPU
15+
Release|Any CPU = Release|Any CPU
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{E341CF35-1ADE-4BDE-A8F2-76A16C00A7A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19+
{E341CF35-1ADE-4BDE-A8F2-76A16C00A7A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
20+
{E341CF35-1ADE-4BDE-A8F2-76A16C00A7A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
21+
{E341CF35-1ADE-4BDE-A8F2-76A16C00A7A0}.Release|Any CPU.Build.0 = Release|Any CPU
22+
{B25B191D-2208-4C1F-A408-8C3A6CEC5C01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23+
{B25B191D-2208-4C1F-A408-8C3A6CEC5C01}.Debug|Any CPU.Build.0 = Debug|Any CPU
24+
{B25B191D-2208-4C1F-A408-8C3A6CEC5C01}.Release|Any CPU.ActiveCfg = Release|Any CPU
25+
{B25B191D-2208-4C1F-A408-8C3A6CEC5C01}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{D649B4DB-9BDC-4AB4-831F-864047C703C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{D649B4DB-9BDC-4AB4-831F-864047C703C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{D649B4DB-9BDC-4AB4-831F-864047C703C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{D649B4DB-9BDC-4AB4-831F-864047C703C8}.Release|Any CPU.Build.0 = Release|Any CPU
30+
EndGlobalSection
31+
GlobalSection(SolutionProperties) = preSolution
32+
HideSolutionNode = FALSE
33+
EndGlobalSection
34+
GlobalSection(ExtensibilityGlobals) = postSolution
35+
SolutionGuid = {7ECFA0AA-EADB-43B3-98B4-C8DC92CB1C78}
36+
EndGlobalSection
37+
EndGlobal
Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
<Router AppAssembly="@typeof(Program).Assembly">
2-
<Found Context="routeData">
3-
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
4-
</Found>
5-
<NotFound>
6-
<LayoutView Layout="@typeof(MainLayout)">
7-
<p>Sorry, there's nothing at this address.</p>
8-
</LayoutView>
9-
</NotFound>
10-
</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>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net7.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.2" />
11+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.2" PrivateAssets="all" />
12+
<PackageReference Include="Syncfusion.Blazor.QueryBuilder" Version="23.1.40" />
13+
<PackageReference Include="Syncfusion.Blazor.Themes" Version="23.1.40" />
14+
</ItemGroup>
15+
16+
<ItemGroup>
17+
<ProjectReference Include="..\Shared\BindingListDataSample.Shared.csproj" />
18+
</ItemGroup>
19+
20+
</Project>
Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
@page "/counter"
2-
3-
<h1>Counter</h1>
4-
5-
<p>Current count: @currentCount</p>
6-
7-
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
8-
9-
@code {
10-
private int currentCount = 0;
11-
12-
private void IncrementCount()
13-
{
14-
currentCount++;
15-
}
16-
}
1+
@page "/counter"
2+
3+
<PageTitle>Counter</PageTitle>
4+
5+
<h1>Counter</h1>
6+
7+
<p role="status">Current count: @currentCount</p>
8+
9+
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
10+
11+
@code {
12+
private int currentCount = 0;
13+
14+
private void IncrementCount()
15+
{
16+
currentCount++;
17+
}
18+
}
Lines changed: 47 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,47 @@
1-
@page "/fetchdata"
2-
@inject HttpClient Http
3-
4-
<h1>Weather forecast</h1>
5-
6-
<p>This component demonstrates fetching data from the server.</p>
7-
8-
@if (forecasts == null)
9-
{
10-
<p><em>Loading...</em></p>
11-
}
12-
else
13-
{
14-
<table class="table">
15-
<thead>
16-
<tr>
17-
<th>Date</th>
18-
<th>Temp. (C)</th>
19-
<th>Temp. (F)</th>
20-
<th>Summary</th>
21-
</tr>
22-
</thead>
23-
<tbody>
24-
@foreach (var forecast in forecasts)
25-
{
26-
<tr>
27-
<td>@forecast.Date.ToShortDateString()</td>
28-
<td>@forecast.TemperatureC</td>
29-
<td>@forecast.TemperatureF</td>
30-
<td>@forecast.Summary</td>
31-
</tr>
32-
}
33-
</tbody>
34-
</table>
35-
}
36-
37-
@code {
38-
private WeatherForecast[] forecasts;
39-
40-
protected override async Task OnInitializedAsync()
41-
{
42-
forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("sample-data/weather.json");
43-
}
44-
45-
public class WeatherForecast
46-
{
47-
public DateTime Date { get; set; }
48-
49-
public int TemperatureC { get; set; }
50-
51-
public string Summary { get; set; }
52-
53-
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
54-
}
55-
}
1+
@page "/fetchdata"
2+
@using BindingListDataSample.Shared
3+
@inject HttpClient Http
4+
5+
<PageTitle>Weather forecast</PageTitle>
6+
7+
<h1>Weather forecast</h1>
8+
9+
<p>This component demonstrates fetching data from the server.</p>
10+
11+
@if (forecasts == null)
12+
{
13+
<p><em>Loading...</em></p>
14+
}
15+
else
16+
{
17+
<table class="table">
18+
<thead>
19+
<tr>
20+
<th>Date</th>
21+
<th>Temp. (C)</th>
22+
<th>Temp. (F)</th>
23+
<th>Summary</th>
24+
</tr>
25+
</thead>
26+
<tbody>
27+
@foreach (var forecast in forecasts)
28+
{
29+
<tr>
30+
<td>@forecast.Date.ToShortDateString()</td>
31+
<td>@forecast.TemperatureC</td>
32+
<td>@forecast.TemperatureF</td>
33+
<td>@forecast.Summary</td>
34+
</tr>
35+
}
36+
</tbody>
37+
</table>
38+
}
39+
40+
@code {
41+
private WeatherForecast[]? forecasts;
42+
43+
protected override async Task OnInitializedAsync()
44+
{
45+
forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("WeatherForecast");
46+
}
47+
}

Client/Pages/Index.razor

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
@page "/"
2+
@using Syncfusion.Blazor.QueryBuilder
3+
4+
<SfQueryBuilder DataSource="@EmployeeData">
5+
<QueryBuilderRule Condition="or" Rules="@Rules"></QueryBuilderRule>
6+
<QueryBuilderColumns>
7+
<QueryBuilderColumn Field="EmployeeID" Label="Employee ID" Type="ColumnType.Number"></QueryBuilderColumn>
8+
<QueryBuilderColumn Field="FirstName" Label="First Name" Type="ColumnType.String"></QueryBuilderColumn>
9+
<QueryBuilderColumn Field="HireDate" Label="Hire Date" Type="ColumnType.Date"></QueryBuilderColumn>
10+
<QueryBuilderColumn Field="Country" Label="Country" Type="ColumnType.String"></QueryBuilderColumn>
11+
</QueryBuilderColumns>
12+
</SfQueryBuilder>
13+
14+
@code {
15+
//Rules binding
16+
List<RuleModel> Rules = new List<RuleModel>()
17+
{
18+
new RuleModel { Field="Country", Label="Country", Type="String", Operator="equal", Value = "England" },
19+
new RuleModel { Field="EmployeeID", Label="EmployeeID", Type="Number", Operator="notequal", Value = 1001 }
20+
};
21+
22+
//List Datas
23+
public List<EmployeeDetails> EmployeeData = new List<EmployeeDetails>
24+
{
25+
new EmployeeDetails{ FirstName = "Martin", EmployeeID = 1001, Country = "England", City = "Manchester", HireDate = new DateTime(2014, 4, 23) },
26+
new EmployeeDetails{ FirstName = "Benjamin", EmployeeID = 1002, Country = "England", City = "Birmingham", HireDate = new DateTime(2014, 6, 19) },
27+
new EmployeeDetails{ FirstName = "Stuart", EmployeeID = 1003, Country = "England", City = "London", HireDate = new DateTime(2014, 7, 4) },
28+
new EmployeeDetails{ FirstName = "Ben", EmployeeID = 1004, Country = "USA", City = "California", HireDate = new DateTime(2014, 8, 15) },
29+
new EmployeeDetails{ FirstName = "Joseph", EmployeeID = 1005, Country = "Spain", City = "Madrid", HireDate = new DateTime(2014, 8, 29) }
30+
};
31+
32+
public class EmployeeDetails
33+
{
34+
public string FirstName { get; set; }
35+
public int EmployeeID { get; set; }
36+
public string Country { get; set; }
37+
public string City { get; set; }
38+
public DateTime HireDate { get; set; }
39+
}
40+
}

Client/Program.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using BindingListDataSample.Client;
2+
using Microsoft.AspNetCore.Components.Web;
3+
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
4+
using Syncfusion.Blazor;
5+
6+
var builder = WebAssemblyHostBuilder.CreateDefault(args);
7+
builder.RootComponents.Add<App>("#app");
8+
builder.RootComponents.Add<HeadOutlet>("head::after");
9+
10+
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
11+
builder.Services.AddSyncfusionBlazor();
12+
await builder.Build().RunAsync();
Lines changed: 40 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,40 @@
1-
{
2-
"iisSettings": {
3-
"windowsAuthentication": false,
4-
"anonymousAuthentication": true,
5-
"iisExpress": {
6-
"applicationUrl": "http://localhost:50039",
7-
"sslPort": 44302
8-
}
9-
},
10-
"profiles": {
11-
"IIS Express": {
12-
"commandName": "IISExpress",
13-
"launchBrowser": true,
14-
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
15-
"environmentVariables": {
16-
"ASPNETCORE_ENVIRONMENT": "Development"
17-
}
18-
},
19-
"MyBlazorApp": {
20-
"commandName": "Project",
21-
"launchBrowser": true,
22-
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
23-
"applicationUrl": "https://localhost:5001;http://localhost:5000",
24-
"environmentVariables": {
25-
"ASPNETCORE_ENVIRONMENT": "Development"
26-
}
27-
}
28-
}
29-
}
1+
{
2+
"iisSettings": {
3+
"windowsAuthentication": false,
4+
"anonymousAuthentication": true,
5+
"iisExpress": {
6+
"applicationUrl": "http://localhost:64079",
7+
"sslPort": 44383
8+
}
9+
},
10+
"profiles": {
11+
"http": {
12+
"commandName": "Project",
13+
"dotnetRunMessages": true,
14+
"launchBrowser": true,
15+
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
16+
"applicationUrl": "http://localhost:5261",
17+
"environmentVariables": {
18+
"ASPNETCORE_ENVIRONMENT": "Development"
19+
}
20+
},
21+
"https": {
22+
"commandName": "Project",
23+
"dotnetRunMessages": true,
24+
"launchBrowser": true,
25+
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
26+
"applicationUrl": "https://localhost:7236;http://localhost:5261",
27+
"environmentVariables": {
28+
"ASPNETCORE_ENVIRONMENT": "Development"
29+
}
30+
},
31+
"IIS Express": {
32+
"commandName": "IISExpress",
33+
"launchBrowser": true,
34+
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
35+
"environmentVariables": {
36+
"ASPNETCORE_ENVIRONMENT": "Development"
37+
}
38+
}
39+
}
40+
}

Client/Shared/MainLayout.razor

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@inherits LayoutComponentBase
2+
3+
<div class="page">
4+
<div class="sidebar">
5+
<NavMenu />
6+
</div>
7+
8+
<main>
9+
<div class="top-row px-4">
10+
<a href="https://docs.microsoft.com/aspnet/" target="_blank">About</a>
11+
</div>
12+
13+
<article class="content px-4">
14+
@Body
15+
</article>
16+
</main>
17+
</div>

0 commit comments

Comments
 (0)