Skip to content

Commit

Permalink
Projektdateien hinzufügen.
Browse files Browse the repository at this point in the history
  • Loading branch information
florentmsl committed Nov 22, 2022
1 parent ad1c7e8 commit c2e1850
Show file tree
Hide file tree
Showing 36 changed files with 1,829 additions and 0 deletions.
25 changes: 25 additions & 0 deletions BlazorServerTest.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33103.184
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorServerTest", "BlazorServerTest\BlazorServerTest.csproj", "{24089F31-E883-41B7-AF87-EAFCD7EE61E7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{24089F31-E883-41B7-AF87-EAFCD7EE61E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{24089F31-E883-41B7-AF87-EAFCD7EE61E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{24089F31-E883-41B7-AF87-EAFCD7EE61E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{24089F31-E883-41B7-AF87-EAFCD7EE61E7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {17B5CDC3-8E89-4630-AC6A-D05CE01F73B2}
EndGlobalSection
EndGlobal
12 changes: 12 additions & 0 deletions BlazorServerTest/App.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
15 changes: 15 additions & 0 deletions BlazorServerTest/BlazorServerTest.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<UseRazorSourceGenerator>false</UseRazorSourceGenerator>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Telerik.UI.for.Blazor.Trial" Version="3.7.0" />
</ItemGroup>

<ProjectExtensions><VisualStudio><UserProperties UseCdnSupport="True" /></VisualStudio></ProjectExtensions>

</Project>
8 changes: 8 additions & 0 deletions BlazorServerTest/Models/DropDownModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace BlazorServerTest.Models
{
public class DropDownModel
{
public int? Id { get; set; }
public string Text { get; set; }
}
}
11 changes: 11 additions & 0 deletions BlazorServerTest/Models/MenuItem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Collections.Generic;

namespace BlazorServerTest.Models
{
public class MenuItem
{
public string Text { get; set; }
public string Url { get; set; }
public List<MenuItem> Items { get; set; }
}
}
31 changes: 31 additions & 0 deletions BlazorServerTest/Models/Person.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System;
using System.ComponentModel.DataAnnotations;

namespace BlazorServerTest.Models
{
public class Person
{
[Required(ErrorMessage = "Enter your first name")]
[StringLength(10, ErrorMessage = "That name is too long")]
public string FirstName { get; set; }

[Required(ErrorMessage = "Enter your last name")]
[StringLength(15, ErrorMessage = "That name is too long")]
public string LastName { get; set; }

[Required(ErrorMessage = "An email is required")]
[EmailAddress(ErrorMessage = "Please provide a valid email address.")]
public string Email { get; set; }

public int? Gender { get; set; }


[Required]
[Range(typeof(DateTime), "1/1/2020", "1/12/2030",
ErrorMessage = "Value for {0} must be between {1:dd MMM yyyy} and {2:dd MMM yyyy}")]
public DateTime StartDate { get; set; }

[Required(ErrorMessage = "Choose the team and technology you want to work on")]
public string PreferredTeam { get; set; }
}
}
43 changes: 43 additions & 0 deletions BlazorServerTest/Models/WeatherForecast.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System;

namespace BlazorServerTest.Models
{
public class WeatherForecast
{
public int Id { get; set; }

public DateTime Date { get; set; }

private double _tempC { get; set; }
public double TemperatureC
{
get
{
return _tempC;
}
set
{
_tempC = value;
}
}

public double TemperatureF
{
get
{
return 32 + (_tempC / 0.5556);
}
set
{
_tempC = (value - 32) * 0.5556;
}
}

public string Summary { get; set; }

public WeatherForecast()
{
Date = DateTime.Now.Date;
}
}
}
92 changes: 92 additions & 0 deletions BlazorServerTest/Pages/Chart.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
@page "/chart"

@using BlazorServerTest.Models
@using BlazorServerTest.Services
@inject WeatherForecastService ForecastService

<div class="container-fluid">
<div class='row my-4'>
<div class='col-12 col-lg-9 border-right'>
@if(forecasts?.Count > 0)
{
<TelerikChart>
<ChartCategoryAxes>
<ChartCategoryAxis BaseUnit="@ChartCategoryAxisBaseUnit.Weeks" Type="@ChartCategoryAxisType.Date">
<ChartCategoryAxisLabels Format="{0:dd MMM}" />
</ChartCategoryAxis>
</ChartCategoryAxes>

<ChartSeriesItems>
<ChartSeries Type="@ChartSeriesType.Line" Name="High" Color="red"
Data="@forecasts"
Field="@nameof(WeatherForecast.TemperatureF)"
CategoryField="@nameof(WeatherForecast.Date)"
Aggregate="@ChartSeriesAggregate.Max">
<ChartSeriesLabels Visible="true" Template="#=dataItem.Summary#" />
</ChartSeries>

<ChartSeries Type="@ChartSeriesType.Line" Name="Low" Color="blue"
Data="@forecasts"
Field="@nameof(WeatherForecast.TemperatureF)"
CategoryField="@nameof(WeatherForecast.Date)"
Aggregate="@ChartSeriesAggregate.Min">
<ChartSeriesLabels Visible="true" Template="#=dataItem.Summary#" />
</ChartSeries>
</ChartSeriesItems>

<ChartValueAxes>
<ChartValueAxis AxisCrossingValue="new object[] { -50 }">
<ChartValueAxisLabels Format="{0} F"></ChartValueAxisLabels>
</ChartValueAxis>
</ChartValueAxes>

<ChartTitle Text="Min and Max temperatures for the upcoming weeks"></ChartTitle>
</TelerikChart>
}
else
{
<div class="alert alert-info">No data available.</div>
}
</div>
<div class='col-12 col-lg-3 mt-3 mt-lg-0'>
<h3>Telerik UI for Blazor Chart</h3>
<p>The Telerik UI for Blazor Charts provide high quality graphical data visualization options.</p>

<p>
They include a variety of chart types and styles that have extensive configuration options. This
flexibility allows you to quickly and easily create the exact chart you need to fit your specific
requirements for functionality and appearance.
</p>

<p>
This example uses the following features:
<ul>
<li>
<a target="_blank"
href="https://docs.telerik.com/blazor-ui/components/chart/data-bind">Data binding</a>
</li>
<li>
<a target="_blank"
href="https://docs.telerik.com/blazor-ui/components/chart/date-axis">Date axis</a>
</li>
<li>
<a target="_blank"
href="https://docs.telerik.com/blazor-ui/components/chart/labels-template-and-format">Label templates</a>
</li>
</ul>
</p>
</div>
</div>
</div>

@code{
List<WeatherForecast> forecasts { get; set; }

protected override async Task OnInitializedAsync()
{
DateTime currDate = DateTime.Now.Date;
var allForecasts = await ForecastService.GetForecastListAsync(currDate);
// use only dates within the last month as a reasonable range of data considering the BaseUnit
forecasts = allForecasts.Where(f => currDate.Subtract(f.Date.Date) < new TimeSpan(30, 0, 0, 0) ).ToList();
}
}
16 changes: 16 additions & 0 deletions BlazorServerTest/Pages/Error.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@page "/error"


<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>

<h3>Development Mode</h3>
<p>
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>
Loading

0 comments on commit c2e1850

Please sign in to comment.