Skip to content
Permalink
Browse files

WIP - Adding blazor to our project

  • Loading branch information...
csharpfritz committed May 31, 2019
1 parent a7640f9 commit 36c62731cbdde79982b34a9fcf907c97d05657a2
@@ -1,2 +1,13 @@
# ResourceManagement

A resource management application originally designed for [Sebastian Riding Associates](http://sebastianriding.org/ "Sebastian Riding Associates")


## Definitions

* Schedule - Definition of time allocated for a purpose

* Availability - an employee's definition of time that could be worked

* Assignment - an employee that is scheduled to work at a specific time

@@ -0,0 +1,36 @@
@page
@inject UserManager<MyUser> MyUserManager
@{
ViewData["Title"] = "Availability";
ViewData["ActivePage"] = ManageNavPages.Availability;

var userId = Guid.Parse(MyUserManager.GetUserId(User));

}

<h4>@ViewData["Title"]</h4>

My UserId: @userId

<div id="Availability">
@{await Html.RenderComponentAsync<Fritz.ResourceManagement.Web.Components._Availability>(new {UserId=userId}); }
</div>

@section Scripts {

<script src="_framework/blazor.server.js" autostart="false"></script>
<script>
Blazor.start({
configureSignalR: function (builder) {
builder.configureLogging(2); // LogLevel.Information
}
});
</script>

}

@section BeforeHead {

<base href="~/" />

}
@@ -15,6 +15,8 @@ public static class ManageNavPages

public static string TwoFactorAuthentication => "TwoFactorAuthentication";

public static string Availability => "Availability";

public static string IndexNavClass(ViewContext viewContext) => PageNavClass(viewContext, Index);

public static string ChangePasswordNavClass(ViewContext viewContext) => PageNavClass(viewContext, ChangePassword);
@@ -0,0 +1 @@
@page
@@ -0,0 +1,12 @@
@page "/_Availability"

<h5>This is the availability component</h5>

My UserId is @UserId

@functions {

[Parameter]
public Guid UserId {get; set;}

}
@@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<_RazorComponentInclude>Components\**\*.razor</_RazorComponentInclude>
<!-- <_RazorComponentInclude>Components\**\*.razor</_RazorComponentInclude> -->
<UserSecretsId>aspnet-Fritz.ResourceManagement.Web-B750FD56-9948-40A0-85AB-70C6CF2B68BC</UserSecretsId>
</PropertyGroup>

@@ -5,6 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - Fritz.ResourceManagement.Web</title>

@RenderSection("BeforeHead", required: false)

<environment include="Development">
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
</environment>
@@ -0,0 +1,10 @@
@page

<script src="_framework/blazor.server.js" autostart="false"></script>
<script>
Blazor.start({
configureSignalR: function (builder) {
builder.configureLogging(2); // LogLevel.Information
}
});
</script>
@@ -42,6 +42,11 @@ public void ConfigureServices(IServiceCollection services)
services.AddDbContext<Models.MyDbContext>(options =>
options.UseNpgsql(Configuration.GetConnectionString("db")));

services.AddSignalR();
services.AddServerSideBlazor();

//cheer ultramark 31/05/2019 100

services.AddRazorPages()
.AddNewtonsoftJson();
}
@@ -76,7 +81,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
endpoints.MapRazorPages();

endpoints.MapBlazorHub();
endpoints.MapFallbackToAreaPage("_Host", "Identity");
endpoints.MapFallbackToAreaPage("/_Host", "Identity");

});
}

0 comments on commit 36c6273

Please sign in to comment.
You can’t perform that action at this time.