-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Datenbank- und Razor-Komponenten-Updates
.gitignore aktualisiert, um `UpdateDatabaseContextCommand.txt` hinzuzufügen. Event-Klasse (`Event.cs`): - Eigenschaften `Date` und `ImageLink` entfernt. - Neue Sammlungen `EventsDateTimes` und `EventsExhibitorsApplies` hinzugefügt. SamtWebsiteContext-Klasse (`SamtWebsiteContext.cs`): - `DbSet`-Eigenschaften für `EventsDateTimes` und `EventsExhibitorsApply` hinzugefügt. - `OnConfiguring`-Methode geändert, um Passwort aus Datei zu lesen. - `EventsDateTime`-Entität in `OnModelCreating` konfiguriert. Razor-Komponenten: - `BringAndBuy.razor`: `currentEventId`-Initialisierung geändert. - `Index.razor`, `Pricing.razor`, `Whenwhere.razor`, `NavMenu.razor`: `DbContext`-Initialisierungen entfernt und durch `CascadingParameter`-Eigenschaften ersetzt. - `Index.razor`: Countdown-Logik angepasst. - `Whenwhere.razor`: Anzeige der Event-Daten angepasst. - `MainLayout.razor`: `DbContext`-Initialisierung hinzugefügt und `CascadingValue`-Komponenten um `NavMenu` und `Body` hinzugefügt. Neue Datei `EventsDateTime.cs` hinzugefügt, die die `EventsDateTime`-Entität definiert.
- Loading branch information
1 parent
b899307
commit ca89412
Showing
10 changed files
with
129 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Database.Models; | ||
|
||
public partial class EventsDateTime | ||
{ | ||
public int Id { get; set; } | ||
|
||
public int FkEventId { get; set; } | ||
|
||
public DateOnly Date { get; set; } | ||
|
||
public TimeOnly StartTime { get; set; } | ||
|
||
public TimeOnly EndTime { get; set; } | ||
|
||
public virtual Event FkEvent { get; set; } = null!; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,30 @@ | ||
@inherits LayoutComponentBase | ||
@using Database.Models | ||
@using Microsoft.EntityFrameworkCore | ||
@inherits LayoutComponentBase | ||
|
||
<NavMenu /> | ||
@inject IDbContextFactory<SamtWebsiteContext> DbFactory | ||
|
||
@Body | ||
<CascadingValue Value="Samt"> | ||
<CascadingValue Value="StartDate"> | ||
<NavMenu /> | ||
@Body | ||
</CascadingValue> | ||
</CascadingValue> | ||
|
||
<Footer /> | ||
|
||
@code | ||
{ | ||
EventsDateTime? StartDate; | ||
Event? Samt; | ||
|
||
protected override void OnInitialized() | ||
{ | ||
base.OnInitialized(); | ||
|
||
var context = DbFactory.CreateDbContext(); | ||
|
||
StartDate = context.EventsDateTimes.OrderBy(x => x.Date).Include(x => x.FkEvent).ThenInclude(x => x.FkLocation).ToList().SkipWhile(x => x.Date.ToDateTime(x.StartTime) <= DateTime.Now).FirstOrDefault(); | ||
Samt = StartDate?.FkEvent; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters