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.
216 lines
8.6 KiB
216 lines
8.6 KiB
@page "/Admin/Student/Student"
|
|
@inject Blazored.SessionStorage.ISessionStorageService sessionStorage
|
|
@inject IJSRuntime jsRuntime
|
|
@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 Syncfusion.Blazor.DropDowns
|
|
@using BlazorApp.Helper
|
|
@using BWPMModels;
|
|
|
|
<div class="container-fluid">
|
|
<div class="card">
|
|
<h6 class="card-header card-header2">Schüler / Berufswunsch</h6>
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<div class="col-md-2">
|
|
<div class="card">
|
|
<h6 class="card-header">
|
|
Klasse/Lehrer
|
|
</h6>
|
|
<div class="card-body">
|
|
Klasse
|
|
<BlazorApp.Pages.Shared.KlasseList @ref="KlasseList" OnKlasseChanged="KlasseChanged"></BlazorApp.Pages.Shared.KlasseList>
|
|
Lehrer
|
|
<BlazorApp.Pages.Shared.LehrerList @ref="LehrerList" OnLehrerChanged="LehrerChanged"></BlazorApp.Pages.Shared.LehrerList>
|
|
<SfCheckBox Label="Alle Schüler" @bind-Checked="alleschueler" @onchange="onAlleSchuelerChange"> ></SfCheckBox>
|
|
</div>
|
|
</div>
|
|
<br />
|
|
<div class="card">
|
|
<h6 class="card-header">
|
|
Schüler
|
|
<input type="hidden" @bind="UID">
|
|
</h6>
|
|
<div class="card-body">
|
|
<BlazorApp.Pages.Shared.SchuelerList @ref="SchuelerList" OnSchuelerChanged="SchuelerChanged"></BlazorApp.Pages.Shared.SchuelerList>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-10">
|
|
<SfAccordion ExpandMode="ExpandMode.Multiple" @bind-ExpandedIndices=ExpandItems>
|
|
<AccordionItems>
|
|
<AccordionItem>
|
|
<HeaderTemplate><h4>Schüler-Daten</h4></HeaderTemplate>
|
|
<ContentTemplate>
|
|
<StudentEdit @ref="StudentEdit" iSchuelerID="@ISchuelerID"></StudentEdit>
|
|
|
|
</ContentTemplate>
|
|
</AccordionItem>
|
|
<AccordionItem>
|
|
<HeaderTemplate><h4>Berufswünsche</h4></HeaderTemplate>
|
|
<ContentTemplate>
|
|
<Berufswunsch @ref="Berufswunsch"></Berufswunsch>
|
|
</ContentTemplate>
|
|
</AccordionItem>
|
|
<AccordionItem>
|
|
<HeaderTemplate><h4>Zuteilung</h4></HeaderTemplate>
|
|
<ContentTemplate>
|
|
<div class="row">
|
|
<div class="col-sm-4">
|
|
<h6>Berufswahl</h6>
|
|
<BlazorApp.Pages.Shared.BerufswunschListe AllowUpdates="false" @ref="BerufswunschListe" OnGridClicked="Refresh_OP"></BlazorApp.Pages.Shared.BerufswunschListe>
|
|
</div>
|
|
<div class="col-md-8">
|
|
<h6>Zuteilungen</h6>
|
|
<BlazorApp.Pages.Admin.Student.Zuteilung @ref="Zuteilung" OnGridClicked="OnGridClicked1"></BlazorApp.Pages.Admin.Student.Zuteilung>
|
|
<br />
|
|
<h6>Offene Plätze</h6>
|
|
<BlazorApp.Pages.Shared.OffenePlaetze @ref="OP" OnGridChanged="OnGridClicked1"></BlazorApp.Pages.Shared.OffenePlaetze>
|
|
</div>
|
|
</div>
|
|
</ContentTemplate>
|
|
</AccordionItem>
|
|
</AccordionItems>
|
|
</SfAccordion>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@code {
|
|
BlazorApp.Pages.Shared.KlasseList KlasseList { get; set; }
|
|
BlazorApp.Pages.Shared.LehrerList LehrerList { get; set; }
|
|
BlazorApp.Pages.Shared.SchuelerList SchuelerList { get; set; }
|
|
BlazorApp.Pages.Admin.Student.StudentEdit StudentEdit { get; set; }
|
|
BlazorApp.Pages.Admin.Student.Berufswunsch Berufswunsch { get; set; }
|
|
BlazorApp.Pages.Shared.BerufswunschListe BerufswunschListe { get; set; }
|
|
BlazorApp.Pages.Admin.Student.Zuteilung Zuteilung { get; set; }
|
|
BlazorApp.Pages.Shared.OffenePlaetze OP { get; set; }
|
|
public int[] ExpandItems = new int[] { 0 };
|
|
public bool alleschueler = false;
|
|
|
|
public string userid = "";
|
|
public string UID = "";
|
|
public string lehrerID = "";
|
|
public string klasseID = "";
|
|
public string ISchuelerID = "";
|
|
public string sBerufid = "";
|
|
#region "Init / AfterRender"
|
|
|
|
private void onAlleSchuelerChange(Microsoft.AspNetCore.Components.ChangeEventArgs args)
|
|
{
|
|
if (args.Value.ToString() == "True")
|
|
{ SchuelerList.ReloadData("-1"); }
|
|
else
|
|
{
|
|
KlasseChanged(KlasseList.GetKlasseID());
|
|
}
|
|
}
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
|
|
ExpandItems = new int[] { 1 };
|
|
userid = await sessionStorage.GetItemAsync<string>("UserID");
|
|
UID = userid;
|
|
klasseID = KlasseList.GetKlasseID();
|
|
lehrerID = LehrerList.GetLehrerID();
|
|
|
|
SchuelerChanged(SchuelerList.ReloadData(KlasseList.GetKlasseID()));
|
|
ExpandItems = new int[] { 2 };
|
|
SchuelerChanged(SchuelerList.ReloadData(KlasseList.GetKlasseID()));
|
|
ExpandItems = new int[] { 2 };
|
|
}
|
|
|
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
|
{
|
|
userid = await sessionStorage.GetItemAsync<string>("UserID");
|
|
|
|
if (userid == null)
|
|
{
|
|
var authState = await authenticationStateTask;
|
|
var userId = authState.User.Claims.FirstOrDefault().Value;
|
|
var user = authState.User;
|
|
|
|
if (user.Identity.IsAuthenticated)
|
|
|
|
{
|
|
await sessionStorage.SetItemAsync("UserID", userId);
|
|
}
|
|
else
|
|
{
|
|
await sessionStorage.SetItemAsync("UserID", userId);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
public void KlasseChanged(String KlasseID)
|
|
{
|
|
SchuelerChanged(SchuelerList.ReloadData(KlasseID));
|
|
}
|
|
public void LehrerChanged(string LehrerID)
|
|
{
|
|
KlasseList.ReloadByLehrer(LehrerID);
|
|
SchuelerChanged(SchuelerList.ReloadData(KlasseList.GetKlasseID()));
|
|
}
|
|
public void SchuelerChanged(string SchuelerID)
|
|
{
|
|
ISchuelerID = SchuelerID;
|
|
try { StudentEdit.ReloadData(SchuelerID); } catch { };
|
|
try
|
|
{
|
|
Berufswunsch.SchuelerID = Convert.ToInt32(SchuelerID);
|
|
Berufswunsch.userid = userid;
|
|
Berufswunsch.SchuelerID = Convert.ToInt32(SchuelerID);
|
|
Berufswunsch.ReloadData(SchuelerID);
|
|
BerufswunschListe.ReloadData(Convert.ToInt32(SchuelerID));
|
|
Zuteilung.userid = userid;
|
|
Zuteilung.SchuelerID = Convert.ToInt32(SchuelerID);
|
|
Zuteilung.ReloadData(Convert.ToInt32(SchuelerID));
|
|
OP.SchuelerID = Convert.ToInt32(SchuelerID);
|
|
}
|
|
catch {
|
|
int i =0;
|
|
}
|
|
}
|
|
private void Refresh_OP(string Berufid)
|
|
{
|
|
int KlasseTypID = 0;
|
|
sBerufid = Berufid;
|
|
OP.ReloadData(Convert.ToInt32(Berufid), KlasseTypID);
|
|
|
|
}
|
|
private void OnGridClicked1(string Schuelerid)
|
|
{
|
|
Zuteilung.userid = userid;
|
|
Zuteilung.SchuelerID = Convert.ToInt32(Schuelerid);
|
|
Zuteilung.ReloadData(Convert.ToInt32(Schuelerid));
|
|
|
|
int KlasseTypID = 0;
|
|
OP.ReloadData(Convert.ToInt32(sBerufid), KlasseTypID);
|
|
|
|
}
|
|
|
|
private void OnGridClicked(string Schuelerid)
|
|
{
|
|
OP.SchuelerID = Convert.ToInt32(Schuelerid);
|
|
int KlasseTypID = 0;
|
|
OP.ReloadData(Convert.ToInt32(sBerufid), KlasseTypID);
|
|
|
|
}
|
|
#endregion
|
|
|
|
}
|