You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
257 lines
10 KiB
257 lines
10 KiB
@page "/Teacher/Dashboard"
|
|
@inject Blazored.SessionStorage.ISessionStorageService sessionStorage
|
|
@inject NavigationManager NavManager
|
|
@inherits Admin.ListBase
|
|
@using System.ComponentModel.DataAnnotations
|
|
@using Syncfusion.Blazor.Grids;
|
|
@using Syncfusion.Blazor.Buttons;
|
|
@using Syncfusion.Blazor.Spinner;
|
|
@using Syncfusion.Blazor.Navigations;
|
|
@using Syncfusion.Blazor.Popups;
|
|
@using BlazorApp.Helper
|
|
@using BWPMModels;
|
|
|
|
<h3><b>Übersicht</b></h3>
|
|
<p></p>
|
|
<style>
|
|
.e-icons {
|
|
font-size: 10px;
|
|
}
|
|
|
|
.e-search:before {
|
|
content: '\e993';
|
|
}
|
|
|
|
.e-upload:before {
|
|
content: '\e725';
|
|
}
|
|
|
|
.e-font:before {
|
|
content: '\e34c';
|
|
}
|
|
|
|
.e-plus-icon::before {
|
|
content: '\e78f';
|
|
}
|
|
|
|
.e-pager {
|
|
display: none;
|
|
}
|
|
|
|
.btn {
|
|
border-radius: 0;
|
|
height: 24px;
|
|
width: 24px;
|
|
@* background-color: #007BFF; *@
|
|
}
|
|
|
|
.e-copy::before {
|
|
content: '\e77b';
|
|
}
|
|
|
|
.e-btn.e-icon-btn {
|
|
padding: initial;
|
|
}
|
|
|
|
.rowred {
|
|
background-color: #ffcccc; //for changing the row background color
|
|
}
|
|
.rowgreen {
|
|
background-color: #80ffbf; //for changing the row background color
|
|
}
|
|
.e-grid .e-rowcell { //changed using CSS
|
|
color: green !important; //for changing the font-color for row content
|
|
}
|
|
</style>
|
|
|
|
<div class="control-section e-tab-section">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<div class="card">
|
|
<h6 class="card-header card-header1">
|
|
<div class="row">
|
|
<div class="col-sm">
|
|
Kontakt-Daten
|
|
</div>
|
|
<div class="col-sm">
|
|
<div class="float-right">
|
|
<SfButton id="btn^0" CssClass="btn" IconCss="e-icons e-plus-icon" IsPrimary="false" OnClick="@((args) => NavigateToKontaktdaten())"></SfButton>
|
|
<SfTooltip ID="Tooltip" Target="#btn0" Content="Stammdaten bearbeiten"></SfTooltip>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</h6>
|
|
<div class="card-body">
|
|
@anrede<br />
|
|
@_lehrer.name @_lehrer.vorname<br /><br />
|
|
@_lehrer.handy<br />
|
|
@_lehrer.tel<br />
|
|
@_lehrer.email<br /><br />
|
|
@schulhaus
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div class="card">
|
|
<h6 class="card-header card-header1">
|
|
<div class="row">
|
|
<div class="col-sm">
|
|
Klassen
|
|
</div>
|
|
<div class="col-sm">
|
|
<div class="float-right">
|
|
<SfButton id="btn1" CssClass="btn" IconCss="e-icons e-plus-icon" IsPrimary="false" OnClick="@((args) => NavigateToKontaktdaten())"></SfButton>
|
|
<SfTooltip ID="Tooltip" Target="#btn1" Content="Stammdaten bearbeiten"></SfTooltip>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</h6>
|
|
<div class="card-body">
|
|
|
|
<SfGrid DataSource="@GridData" AllowPaging="true" @ref="Grid" AllowSorting="true" RowHeight="20">
|
|
<GridPageSettings PageCount="5" PageSizes="false"></GridPageSettings>
|
|
<GridColumns>
|
|
|
|
<GridColumn Field=@nameof(Klasse.ID) HeaderText="Id" IsPrimaryKey="true" AllowAdding="false" Width="60" Visible="false"></GridColumn>
|
|
<GridForeignColumn Field=@nameof(Klasse.schulhausID) HeaderText="Schulhaus" ForeignKeyValue="bezeichnung" ForeignKeyField="ID" ForeignDataSource="@_schulhaus" Width="100"></GridForeignColumn>
|
|
|
|
<GridColumn Field=@nameof(Klasse.bezeichnung) HeaderText="Klassen-Bezeichnung" Width="100" Visible="true"></GridColumn>
|
|
|
|
<GridColumn Field=@nameof(Klasse.klassengroesse) HeaderText="Klassengrösse" Width="100" Visible="true"></GridColumn>
|
|
|
|
<GridColumn Field=@nameof(Klasse.aktiv) HeaderText="Aktiv" Width="100" Visible="false" DisplayAsCheckBox="true"></GridColumn>
|
|
|
|
<GridColumn Field=@nameof(Klasse.erstellt_am) HeaderText="Erstellt_am" Width="100" Visible="false" Format="d" Type="ColumnType.Date"></GridColumn>
|
|
|
|
<GridColumn Field=@nameof(Klasse.mutiert_am) HeaderText="Mutiert_am" Width="100" Visible="false" Format="d" Type="ColumnType.Date"></GridColumn>
|
|
|
|
<GridColumn Field=@nameof(Klasse.mutierer) HeaderText="Mutierer" Width="100" Visible="false"></GridColumn>
|
|
|
|
|
|
<GridColumn Field=@nameof(Klasse.lehrerID) HeaderText="Lehrerid" Width="100" Visible="false"></GridColumn>
|
|
|
|
<GridColumn Field=@nameof(Klasse.mandantnr) HeaderText="Mandantnr" Width="100" Visible="false"></GridColumn>
|
|
</GridColumns>
|
|
</SfGrid>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
<p></p>
|
|
<div class="card">
|
|
<h6 class="card-header card-header2">
|
|
<div class="row">
|
|
<div class="col-sm">
|
|
Klassen und Schüler
|
|
</div>
|
|
<div class="col-sm">
|
|
<div class="float-right">
|
|
<SfButton id="btn2" CssClass="btn" IconCss="e-icons e-plus-icon" IsPrimary="false" OnClick="@((args) => NavigateToBerufswunsch())"></SfButton>
|
|
<SfTooltip ID="Tooltip" Target="#btn2" Content="Schüler-Daten bearbeiten"></SfTooltip>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</h6>
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<SfGrid DataSource="@GridDataKlasse" AllowPaging="true" AllowSorting="true" RowHeight="20">
|
|
<GridPageSettings PageCount="5" PageSizes="true"></GridPageSettings>
|
|
<GridEvents TValue="LehrerKlassenuebersicht" RowDataBound="RowBound"></GridEvents>
|
|
<GridColumns>
|
|
|
|
<GridColumn Field=@nameof(LehrerKlassenuebersicht.ID) HeaderText="Id" IsPrimaryKey="true" AllowAdding="false" Visible="false" Width="60"></GridColumn>
|
|
|
|
<GridColumn Field=@nameof(LehrerKlassenuebersicht.Schulhaus) HeaderText="Schulhaus" Width="100" Visible="true"></GridColumn>
|
|
|
|
<GridColumn Field=@nameof(LehrerKlassenuebersicht.Klasse) HeaderText="Klasse" Width="100" Visible="true"></GridColumn>
|
|
|
|
<GridColumn Field=@nameof(LehrerKlassenuebersicht.Klassengroesse) HeaderText="Klassengrösse" Width="100" Visible="true"></GridColumn>
|
|
|
|
<GridColumn Field=@nameof(LehrerKlassenuebersicht.Anzahl_Schuler) HeaderText="Erfsste Schüler" Width="100" Visible="true"></GridColumn>
|
|
|
|
<GridColumn Field=@nameof(LehrerKlassenuebersicht.Schuler_Komplett) HeaderText="Schuler komplett" Width="100" Visible="true"></GridColumn>
|
|
|
|
<GridColumn Field=@nameof(LehrerKlassenuebersicht.Schueler_nicht_komplett) HeaderText="Schueler nicht_komplett" Width="100" Visible="false"></GridColumn>
|
|
|
|
<GridColumn Field=@nameof(LehrerKlassenuebersicht.LehrerID) HeaderText="Lehrerid" Width="100" Visible="false"></GridColumn>
|
|
</GridColumns>
|
|
</SfGrid>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
¨
|
|
|
|
|
|
|
|
@code {
|
|
string userid = "";
|
|
public Lehrer _lehrer { get; set; } = new BWPMModels.Lehrer();
|
|
public List<BWPMModels.Lehrer> Lehrerdaten { get; set; }
|
|
public List<BWPMModels.Klasse> GridData { get; set; }
|
|
SfGrid<Klasse> Grid { get; set; }
|
|
private List<BWPMModels.Schulhaus> _schulhaus { get; set; } = BlazorApp.Controller.SchulhausController.GetAllData();
|
|
private List<BWPMModels.Anrede> _anrede { get; set; } = BlazorApp.Controller.AnredeController.GetAllData();
|
|
private string schulhaus;
|
|
private string anrede;
|
|
|
|
public List<BWPMModels.LehrerKlassenuebersicht> GridDataKlasse { get; set; }
|
|
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
var authState = await authenticationStateTask;
|
|
userid = authState.User.Claims.FirstOrDefault().Value;
|
|
var user = authState.User;
|
|
await sessionStorage.SetItemAsync("UserID", userid);
|
|
Lehrerdaten = BlazorApp.Controller.LehrerController.GetByUserID(userid);
|
|
_lehrer = Lehrerdaten.First<BWPMModels.Lehrer>();
|
|
await sessionStorage.SetItemAsync("LehrerID", _lehrer.ID.ToString());
|
|
await Task.Delay(200);
|
|
GridData = BlazorApp.Controller.KlasseController.GetByLehrerID(_lehrer.ID);
|
|
GridDataKlasse = BlazorApp.Controller.LehrerKlassenuebersichtController.GetByLehrerID(_lehrer.ID);
|
|
|
|
foreach (var sh in _schulhaus)
|
|
{
|
|
if (_lehrer.schulhausID == sh.ID)
|
|
{
|
|
schulhaus = sh.bezeichnung;
|
|
}
|
|
}
|
|
foreach (var an in _anrede)
|
|
{
|
|
if (an.ID == _lehrer.anredeID) { anrede = an.bezeichnung; }
|
|
}
|
|
|
|
}
|
|
private void NavigateToKontaktdaten()
|
|
{
|
|
NavigationManager.NavigateTo("/Teacher/TeacherContact");
|
|
}
|
|
private void NavigateToBerufswunsch()
|
|
{
|
|
NavigationManager.NavigateTo("/Teacher/TeacherStudent");
|
|
}
|
|
|
|
|
|
public void RowBound(RowDataBoundEventArgs<LehrerKlassenuebersicht> args)
|
|
{
|
|
if (args.Data.Klassengroesse != args.Data.Anzahl_Schuler)
|
|
{
|
|
args.Row.AddClass(new string[] { "rowred" });
|
|
return;
|
|
}
|
|
if (args.Data.Schueler_nicht_komplett != 0)
|
|
{
|
|
args.Row.AddClass(new string[] { "rowred" });
|
|
return;
|
|
}
|
|
args.Row.AddClass(new string[] { "rowgreen" });
|
|
|
|
}
|
|
} |