Skip to content

Commit 74f6ab8

Browse files
Add files via upload
1 parent 92d59a6 commit 74f6ab8

31 files changed

+1586
-0
lines changed

App.razor

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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>

Data/EmployeeData.cs

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
6+
namespace Master_Detail_Grid.Data
7+
{
8+
public class Salesperson
9+
{
10+
public int? EmployeeID { get; set; }
11+
public string FirstName { get; set; }
12+
public string LastName { get; set; }
13+
public string Title { get; set; }
14+
public string City { get; set; }
15+
public string Country { get; set; }
16+
public string Postal { get; set; }
17+
public string Address { get; set; }
18+
public string Phone { get; set; }
19+
public string Email { get; set; }
20+
21+
public static List<Salesperson> GetSalesperson()
22+
{
23+
List<Salesperson> Employees = new List<Salesperson>
24+
{
25+
new Salesperson {EmployeeID = 1, FirstName="Nancy", LastName="Andrea", Email="nancy.andr@gmail.com", Title="Sales Representative",City="New York", Country="USA", Postal="10007", Address="507 - 20th Ave. E. Apt. 2A", Phone="(212) 555-1189"},
26+
new Salesperson {EmployeeID = 2, FirstName="Andrew", LastName="Taylor", Email="andrew.taylor@gmail.com", Title="Vice President",City="London", Country="UK", Postal="WC2H 0HH", Address="908 W. Capital Way", Phone="(71) 755-9489"},
27+
new Salesperson {EmployeeID = 3, FirstName="Jenie", LastName="Celine", Email="celine_jeny@gmail.com", Title="Region Manager",City="London", Country="UK", Postal="WC2H 0HH", Address="722 Moss Bay Blvd.", Phone="(71) 235-5644"},
28+
new Salesperson {EmployeeID = 4, FirstName="Margaret", LastName="Lucy", Email="margaret.lucy@gmail.com", Title="Sales Manager",City="London", Country="UK", Postal="WC2H 0HH", Address="4110 Old Redmond Rd.", Phone="(71) 555-4674"},
29+
new Salesperson {EmployeeID = 5, FirstName="Steven", LastName="Stalen", Email="staley.steve@gmail.com", Title="Sales VP",City="Vegas", Country="USA", Postal="89107", Address="14 Garrett Hill", Phone="(212) 555-1189"},
30+
new Salesperson {EmployeeID = 6, FirstName="Smith", LastName="Joe", Email="joe.smith@gmail.com", Title="Sales Consultant",City="New York", Country="USA", Postal="10007", Address="Coventry House Miner Rd.", Phone="(212) 555-1189"},
31+
new Salesperson {EmployeeID = 7, FirstName="Steven", LastName="Smith", Email="smith.steve@gmail.com", Title="Sales Coordinator",City="Paris", Country="France", Postal="75007", Address="Edgeham Hollow Winchester Way", Phone="+331 4025 0808"},
32+
new Salesperson {EmployeeID = 8, FirstName="Catherine", LastName="Ray", Email="ray_catherine@gmail.com", Title="Sales Representative",City="Mumbai", Country="India", Postal="400007", Address="4726 - 11th Ave. N.E.", Phone="022 43768823"},
33+
new Salesperson {EmployeeID = 9, FirstName="Larry", LastName="Reas", Email="raes_larry@gmail.com", Title="Sales Associate",City="Chennai", Country="India", Postal="600077", Address="7 Houndstooth Rd.", Phone="044 41618442"}
34+
};
35+
return Employees;
36+
}
37+
}
38+
39+
public class Location
40+
{
41+
public double latitude;
42+
public double longitude;
43+
public string name;
44+
45+
public static List<Location> GetLocation()
46+
{
47+
List<Location> MapPoints = new List<Location> {
48+
new Location { name= "New York", latitude= 40.7488758, longitude= -73.9730091 },
49+
new Location { name = "London", latitude= 51.5074, longitude= -0.1278,},
50+
new Location { name = "Vegas", latitude=36.1699, longitude= -115.1398,},
51+
new Location { name="Paris", latitude= 48.8773406, longitude= 2.3299627,},
52+
new Location { name="Mumbai", latitude= 19.1555762, longitude= 72.8849595,},
53+
new Location { name="Chennai", latitude=13.0827, longitude= 80.2707,}
54+
};
55+
return MapPoints;
56+
}
57+
}
58+
59+
public class MeetingSchedule
60+
{
61+
public int Id { get; set; }
62+
public string Subject { get; set; }
63+
public DateTime StartTime { get; set; }
64+
public DateTime EndTime { get; set; }
65+
public int? EID { get; set; }
66+
67+
public static List<MeetingSchedule> GetMeetingData()
68+
{
69+
List<MeetingSchedule> ScheduleData = new List<MeetingSchedule>
70+
{
71+
new MeetingSchedule { Id = 1, Subject="Meeting with Alex", StartTime = new DateTime(2020, 03, 02, 09, 30, 0), EndTime = new DateTime(2020, 03, 02, 10, 30, 0), EID = 1 },
72+
new MeetingSchedule { Id = 2, Subject="Meeting with Bob", StartTime = new DateTime(2020, 03, 02, 09, 30, 0), EndTime = new DateTime(2020, 03, 02, 10, 30, 0), EID = 1 },
73+
new MeetingSchedule { Id = 3, Subject="Meeting with Catherine", StartTime = new DateTime(2020, 03, 02, 09, 30, 0), EndTime = new DateTime(2020, 03, 02, 10, 30, 0), EID = 2 },
74+
new MeetingSchedule { Id = 4, Subject="Meeting with Dany", StartTime = new DateTime(2020, 03, 02, 09, 30, 0), EndTime = new DateTime(2020, 03, 02, 10, 30, 0), EID = 2 },
75+
new MeetingSchedule { Id = 5, Subject="Meeting with Eliot", StartTime = new DateTime(2020, 03, 02, 09, 30, 0), EndTime = new DateTime(2020, 03, 02, 10, 30, 0), EID = 3 },
76+
new MeetingSchedule { Id = 6, Subject="Meeting with Frezey", StartTime = new DateTime(2020, 03, 02, 09, 30, 0), EndTime = new DateTime(2020, 03, 02, 10, 30, 0), EID = 3 },
77+
new MeetingSchedule { Id = 7, Subject="Meeting with Goldie", StartTime = new DateTime(2020, 03, 02, 09, 30, 0), EndTime = new DateTime(2020, 03, 02, 10, 30, 0), EID = 4 },
78+
new MeetingSchedule { Id = 8, Subject="Meeting with Harman", StartTime = new DateTime(2020, 03, 02, 09, 30, 0), EndTime = new DateTime(2020, 03, 02, 10, 30, 0), EID = 4 },
79+
new MeetingSchedule { Id = 9, Subject="Meeting with Irwin", StartTime = new DateTime(2020, 03, 02, 09, 30, 0), EndTime = new DateTime(2020, 03, 02, 10, 30, 0), EID = 5 },
80+
new MeetingSchedule { Id = 10, Subject="Meeting with Jack", StartTime = new DateTime(2020, 03, 02, 09, 30, 0), EndTime = new DateTime(2020, 03, 02, 10, 30, 0), EID = 5 },
81+
new MeetingSchedule { Id = 11, Subject="Meeting with Klay", StartTime = new DateTime(2020, 03, 02, 09, 30, 0), EndTime = new DateTime(2020, 03, 02, 10, 30, 0), EID = 6 },
82+
new MeetingSchedule { Id = 12, Subject="Meeting with Lucy", StartTime = new DateTime(2020, 03, 02, 09, 30, 0), EndTime = new DateTime(2020, 03, 02, 10, 30, 0), EID = 6 },
83+
new MeetingSchedule { Id = 13, Subject="Meeting with Moni", StartTime = new DateTime(2020, 03, 02, 09, 30, 0), EndTime = new DateTime(2020, 03, 02, 10, 30, 0), EID = 7 },
84+
new MeetingSchedule { Id = 14, Subject="Meeting with Nancy", StartTime = new DateTime(2020, 03, 02, 09, 30, 0), EndTime = new DateTime(2020, 03, 02, 10, 30, 0), EID = 7 },
85+
new MeetingSchedule { Id = 15, Subject="Meeting with Orley", StartTime = new DateTime(2020, 03, 02, 09, 30, 0), EndTime = new DateTime(2020, 03, 02, 10, 30, 0), EID = 8 },
86+
new MeetingSchedule { Id = 16, Subject="Meeting with Prince", StartTime = new DateTime(2020, 03, 02, 09, 30, 0), EndTime = new DateTime(2020, 03, 02, 10, 30, 0), EID = 8 },
87+
new MeetingSchedule { Id = 17, Subject="Meeting with Queen", StartTime = new DateTime(2020, 03, 02, 09, 30, 0), EndTime = new DateTime(2020, 03, 02, 10, 30, 0), EID = 9 },
88+
new MeetingSchedule { Id = 18, Subject="Meeting with Rockstar", StartTime = new DateTime(2020, 03, 02, 09, 30, 0), EndTime = new DateTime(2020, 03, 02, 10, 30, 0), EID = 9 }
89+
};
90+
return ScheduleData;
91+
}
92+
}
93+
94+
public class Orders
95+
{
96+
public int? EmployeeID { get; set; }
97+
public int? OrderID { get; set; }
98+
public DateTime OrderDate { get; set; }
99+
public string ShipName { get; set; }
100+
public string ShipCity { get; set; }
101+
public double? Freight { get; set; }
102+
}
103+
}

Data/WeatherForecast.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
3+
namespace Master_Detail_Grid.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+
}

Data/WeatherForecastService.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System;
2+
using System.Linq;
3+
using System.Threading.Tasks;
4+
5+
namespace Master_Detail_Grid.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+
}

Master-Detail-Grid.csproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<RootNamespace>Master_Detail_Grid</RootNamespace>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="Syncfusion.Blazor" Version="18.1.0.44" />
10+
</ItemGroup>
11+
12+
</Project>

Pages/Counter.razor

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

Pages/Error.razor

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@page "/error"
2+
3+
4+
<h1 class="text-danger">Error.</h1>
5+
<h2 class="text-danger">An error occurred while processing your request.</h2>
6+
7+
<h3>Development Mode</h3>
8+
<p>
9+
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
10+
</p>
11+
<p>
12+
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
13+
It can result in displaying sensitive information from exceptions to end users.
14+
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
15+
and restarting the app.
16+
</p>

Pages/FetchData.razor

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
@page "/fetchdata"
2+
3+
@using Master_Detail_Grid.Data
4+
@inject WeatherForecastService ForecastService
5+
6+
<h1>Weather forecast</h1>
7+
8+
<p>This component demonstrates fetching data from a service.</p>
9+
10+
@if (forecasts == null)
11+
{
12+
<p><em>Loading...</em></p>
13+
}
14+
else
15+
{
16+
<table class="table">
17+
<thead>
18+
<tr>
19+
<th>Date</th>
20+
<th>Temp. (C)</th>
21+
<th>Temp. (F)</th>
22+
<th>Summary</th>
23+
</tr>
24+
</thead>
25+
<tbody>
26+
@foreach (var forecast in forecasts)
27+
{
28+
<tr>
29+
<td>@forecast.Date.ToShortDateString()</td>
30+
<td>@forecast.TemperatureC</td>
31+
<td>@forecast.TemperatureF</td>
32+
<td>@forecast.Summary</td>
33+
</tr>
34+
}
35+
</tbody>
36+
</table>
37+
}
38+
39+
@code {
40+
private WeatherForecast[] forecasts;
41+
42+
protected override async Task OnInitializedAsync()
43+
{
44+
forecasts = await ForecastService.GetForecastAsync(DateTime.Now);
45+
}
46+
}

0 commit comments

Comments
 (0)