parent
4d443fdfd4
commit
595cd0edea
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -0,0 +1,448 @@
|
||||
@page "/Teacher/TeacherStudent"
|
||||
@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="row">
|
||||
<div class="col-md-2">
|
||||
<div class="card">
|
||||
<h6 class="card-header">
|
||||
Klasse
|
||||
</h6>
|
||||
<div class="card-body">
|
||||
<SfDropDownList @bind-Value="@KlasseID" TValue="string" TItem="Klasse" Placeholder="Klasse" DataSource="@Klasse">
|
||||
<DropDownListFieldSettings Value="ID" Text="bezeichnung"></DropDownListFieldSettings>
|
||||
<DropDownListEvents TValue="string" TItem="Klasse" ValueChange="ChangeKlasse"></DropDownListEvents>
|
||||
</SfDropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="card">
|
||||
<h6 class="card-header">
|
||||
Schüler
|
||||
</h6>
|
||||
<div class="card-body">
|
||||
<RadzenListBox @bind-Value=@SchuelerID Data=@schuelerliste TextProperty="bezeichnung" ValueProperty="id" Style="height:350px" Change=@(args => SchuelerChange(args, "schuelerlist")) />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<div class="card">
|
||||
<h6 class="card-header">
|
||||
Schüler
|
||||
</h6>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<SfButton IsPrimary="true" OnClick="@(() => NewClick())">Neuer Schüler</SfButton>
|
||||
<SfButton Disabled="@FieldDisabled" IsPrimary="true" OnClick="@(() => SaveClick())">Änderungen speichern</SfButton>
|
||||
<SfButton Disabled="@FieldDisabled" IsPrimary="true" OnClick="@(() => DeleteClick())">Schüler löschen</SfButton>
|
||||
|
||||
</div>
|
||||
<hr />
|
||||
<EditForm Model="_schueler" OnValidSubmit="@Submit" OnInvalidSubmit="@InvalidSubmit">
|
||||
<input type="hidden" id="hiddenschuelerid" name="hiddenschuelerid" @bind="_schueler.ID">
|
||||
<div class="row">
|
||||
<div class="col-md-1">
|
||||
@*<label for="Name" class="col-2 col-form-label">Name</label>*@
|
||||
Name
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<InputText id="Name" class="form-control" @bind-Value="_schueler.name" placeholder="Nachname" disabled="@FieldDisabled" />
|
||||
<ValidationMessage For="@(() => _schueler.name)" />
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
@*<label for="Name" class="col-2 col-form-label">Name</label>*@
|
||||
Vorname
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
@*<label for="Vorname" class="col-2 col-form-label">Name</label>*@
|
||||
<InputText id="Vorname" class="form-control" @bind-Value="_schueler.vorname" placeholder="Vorname" disabled="@FieldDisabled" />
|
||||
<ValidationMessage For="@(() => _schueler.name)" />
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
@*<label for="Name" class="col-2 col-form-label">Name</label>*@
|
||||
Bemerkung
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<InputText id="Bemerkung" class="form-control" @bind-Value="_schueler.bemerkung" placeholder="Bemerkung" disabled="@FieldDisabled" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-1">
|
||||
Klasse
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<SfDropDownList @bind-Value="@SchuelerklasseID" TValue="string" TItem="Klasse" Placeholder="Klasse" DataSource="@Schuelerklasse" Enabled="@DropDownEnabled">
|
||||
<DropDownListFieldSettings Value="ID" Text="bezeichnung"></DropDownListFieldSettings>
|
||||
</SfDropDownList>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
Typ
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<SfDropDownList @bind-Value="@KlasseTypID" TValue="string" TItem="Klassentyp" Placeholder="Klassentyp" DataSource="@klassentyp" Enabled="@DropDownEnabled">
|
||||
<DropDownListFieldSettings Value="ID" Text="bezeichnung"></DropDownListFieldSettings>
|
||||
</SfDropDownList>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
leer
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
das ist noch leer
|
||||
</div>
|
||||
|
||||
</div>>
|
||||
|
||||
</EditForm>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card">
|
||||
<h6 class="card-header">
|
||||
Berufe / Berfufswünsche
|
||||
</h6>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<SfListBox TValue="string[]" DataSource="@Berufe" TItem="Beruf" Height="350px">
|
||||
<ListBoxFieldSettings Text="bezeichnung" Value="Id" />
|
||||
<ListBoxSelectionSettings Mode="Syncfusion.Blazor.DropDowns.SelectionMode.Single" ShowCheckbox="false"></ListBoxSelectionSettings>
|
||||
</SfListBox>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<SfGrid DataSource="@GridData" @ref="Grid" AllowPaging="true" AllowSorting="true" Toolbar="@(new List<string>() { "Edit", "Delete" })">
|
||||
<GridPageSettings PageCount="5" PageSizes="true"></GridPageSettings>
|
||||
<GridEditSettings AllowAdding="true" AllowDeleting="false" AllowEditing="true" Mode="EditMode.Dialog"></GridEditSettings>
|
||||
<GridEvents OnActionBegin="OnBeginHandler" OnActionComplete="OnCompletedHandler" TValue="SchuelerBeruf" OnDataBound="RowDataBoundHandler"></GridEvents>
|
||||
<GridColumns>
|
||||
<GridColumn Type="ColumnType.CheckBox" AllowFiltering="false" AllowSorting="false" Width="60"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(SchuelerBeruf.ID) HeaderText="Id" IsPrimaryKey="true" AllowAdding="false" Visible="false" Width="60"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(SchuelerBeruf.schuelerID) HeaderText="Schuelerid" Width="100" Visible="false"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(SchuelerBeruf.berufID) HeaderText="Berufid" Width="100" Visible="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(SchuelerBeruf.bemerkung) HeaderText="Bemerkung" Width="100" Visible="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(SchuelerBeruf.prioritaet) HeaderText="Prioritaet" Width="100" Visible="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(SchuelerBeruf.aktiv) HeaderText="Aktiv" Width="100" Visible="false" DisplayAsCheckBox="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(SchuelerBeruf.erstellt_am) HeaderText="Erstellt_am" Width="100" Visible="false" Format="d" Type="ColumnType.Date"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(SchuelerBeruf.mutiert_am) HeaderText="Mutiert_am" Width="100" Visible="false" Format="d" Type="ColumnType.Date"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(SchuelerBeruf.mutierer) HeaderText="Mutierer" Width="100" Visible="false"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(SchuelerBeruf.mandantnr) HeaderText="Mandantnr" Width="100" Visible="false"></GridColumn>
|
||||
</GridColumns>
|
||||
</SfGrid>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<SfDialog Width="350px" IsModal="true" @bind-Visible="@ShowDeleteConfirmation">
|
||||
<DialogTemplates>
|
||||
<Header>Schüler löschen? </Header>
|
||||
<Content>Möchten Sie den Schüler '@_schueler.name @_schueler.vorname' löschen?</Content>
|
||||
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
<DialogButton Content="Ja" IsPrimary="true" OnClick="@DeleteConfirmed" />
|
||||
<DialogButton Content="Nein" OnClick="@AbortDelete" />
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
|
||||
|
||||
@code {
|
||||
public bool ShowDeleteConfirmation { get; set; } = false;
|
||||
protected ElementReference ToFocus;
|
||||
public int lehrerID = 0;
|
||||
public int hiddenschuelerid = 0;
|
||||
public string KlasseID = "0";
|
||||
public string SchuelerklasseID = "0";
|
||||
public string KlasseTypID = "0";
|
||||
public string userid;
|
||||
public bool FieldDisabled = true;
|
||||
public bool DropDownEnabled = false;
|
||||
public List<BWPMModels.Klasse> Klasse { get; set; }
|
||||
public List<BWPMModels.Klasse> Schuelerklasse { get; set; }
|
||||
public List<BWPMModels.Klassentyp> klassentyp { get; set; } = BlazorApp.Controller.KlassentypController.GetAllAktiveData();
|
||||
public List<BWPMModels.Schueler> Schueler { get; set; }
|
||||
private Schueler _schueler { get; set; } = new BWPMModels.Schueler();
|
||||
public List<BWPMModels.Beruf> Berufe { get; set; } = BlazorApp.Controller.BerufController.GetBerufsangebot();
|
||||
|
||||
public List<Schuelerlist> schuelerliste = new List<Schuelerlist>();
|
||||
public int SchuelerID;
|
||||
|
||||
public class Schuelerlist
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string bezeichnung { get; set; }
|
||||
}
|
||||
|
||||
//--------------------------------------
|
||||
//Schülerberuf / beruf
|
||||
//--------------------------------------
|
||||
SfGrid<SchuelerBeruf> Grid { get; set; }
|
||||
public List<BWPMModels.SchuelerBeruf> GridData { get; set; }
|
||||
public bool ContinuePaging = true;
|
||||
public bool InitialRender { get; set; }
|
||||
public int Value = 0; // consider that value your querystring contains
|
||||
public int foundrow = 0;
|
||||
public bool Initial { get; set; } = true;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
lehrerID = await sessionStorage.GetItemAsync<int>("LehrerID");
|
||||
Klasse = BlazorApp.Controller.KlasseController.GetByLehrerID(Convert.ToInt32(lehrerID));
|
||||
KlasseID = Klasse[0].ID.ToString();
|
||||
Schuelerklasse = BlazorApp.Controller.KlasseController.GetByLehrerID(Convert.ToInt32(lehrerID));
|
||||
SchuelerklasseID = Schuelerklasse[0].ID.ToString();
|
||||
KlasseTypID = klassentyp[0].ID.ToString();
|
||||
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender != true) { return; };
|
||||
userid = await sessionStorage.GetItemAsync<string>("UserID");
|
||||
if (userid == null)
|
||||
{
|
||||
var authState = await authenticationStateTask;
|
||||
userid = authState.User.Claims.FirstOrDefault().Value;
|
||||
var user = authState.User;
|
||||
|
||||
}
|
||||
}
|
||||
//----------------------------------------------------------
|
||||
//Klassenliste / Schuelerliste
|
||||
//----------------------------------------------------------
|
||||
public void ChangeKlasse(Syncfusion.Blazor.DropDowns.ChangeEventArgs<string, Klasse> args)
|
||||
{
|
||||
|
||||
UpdateSchulerliste();
|
||||
}
|
||||
|
||||
public void UpdateSchulerliste()
|
||||
{
|
||||
Schueler = BlazorApp.Controller.SchuelerController.GetByKlasseID(Convert.ToInt32(KlasseID));
|
||||
schuelerliste.Clear();
|
||||
int newschuelerid = 0;
|
||||
bool found = false;
|
||||
foreach (BWPMModels.Schueler item in Schueler)
|
||||
{
|
||||
|
||||
Schuelerlist sl = new Schuelerlist();
|
||||
sl.id = item.ID;
|
||||
if (newschuelerid == 0) { newschuelerid = sl.id; };
|
||||
if (SchuelerID == sl.id) { found = true; }
|
||||
sl.bezeichnung = item.name + " " + item.vorname;
|
||||
schuelerliste.Add(sl);
|
||||
};
|
||||
if (found != true)
|
||||
{
|
||||
FieldDisabled = true;
|
||||
DropDownEnabled = false;
|
||||
SchuelerID = -1;
|
||||
SchuelerID = newschuelerid;
|
||||
if (schuelerliste.Count > 0) { SchuelerSelected(); }
|
||||
}
|
||||
|
||||
}
|
||||
private void SchuelerChange(object value, string name)
|
||||
{
|
||||
var str = value is IEnumerable<object> ? string.Join(", ", (IEnumerable<object>)value) : value;
|
||||
SchuelerSelected();
|
||||
|
||||
}
|
||||
private void SchuelerSelected()
|
||||
{
|
||||
Schueler = BlazorApp.Controller.SchuelerController.GetByID(Convert.ToInt32(SchuelerID));
|
||||
_schueler = Schueler.First<BWPMModels.Schueler>();
|
||||
SchuelerklasseID = _schueler.klasseID.ToString();
|
||||
KlasseTypID = _schueler.klassemtypID.ToString();
|
||||
FieldDisabled = false;
|
||||
DropDownEnabled = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------
|
||||
//Schüler-Formular
|
||||
//----------------------------------------------------------
|
||||
|
||||
public void Submit()
|
||||
{
|
||||
BlazorApp.Controller.SchuelerController.PUT(_schueler);
|
||||
}
|
||||
public void InvalidSubmit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void SaveClick()
|
||||
{
|
||||
Schueler _tmpschueler = new BWPMModels.Schueler();
|
||||
_tmpschueler = BlazorApp.Controller.SchuelerController.GetByID(_schueler.ID).First<BWPMModels.Schueler>();
|
||||
_tmpschueler.name = _schueler.name;
|
||||
_tmpschueler.vorname = _schueler.vorname;
|
||||
_tmpschueler.bemerkung = _schueler.bemerkung;
|
||||
_tmpschueler.klasseID = Convert.ToInt32(SchuelerklasseID);
|
||||
_tmpschueler.klassemtypID = Convert.ToInt32(KlasseTypID);
|
||||
BlazorApp.Controller.SchuelerController.PUT(_tmpschueler);
|
||||
UpdateSchulerliste();
|
||||
|
||||
}
|
||||
private void NewClick()
|
||||
{
|
||||
int schuelerid = 0;
|
||||
BWPMModels.Schueler schuelerdata = new Schueler();
|
||||
schuelerdata.aktiv = true;
|
||||
schuelerdata.erstellt_am = DateTime.Now;
|
||||
schuelerdata.mutiert_am = DateTime.Now;
|
||||
schuelerdata.mutierer = userid;
|
||||
schuelerdata.name = "Neuer Schüler";
|
||||
schuelerdata.vorname = "";
|
||||
schuelerdata.bemerkung = "";
|
||||
schuelerdata.klasseID = Convert.ToInt32(KlasseID);
|
||||
schuelerdata.klassemtypID = Convert.ToInt32(KlasseTypID);
|
||||
schuelerid = BlazorApp.Controller.SchuelerController.POST(schuelerdata);
|
||||
FieldDisabled = false;
|
||||
|
||||
DropDownEnabled = true;
|
||||
UpdateSchulerliste();
|
||||
SchuelerID = schuelerid;
|
||||
SchuelerSelected();
|
||||
jsRuntime.InvokeVoidAsync("SetFocusToElement", ToFocus);
|
||||
|
||||
}
|
||||
private void DeleteClick()
|
||||
{
|
||||
ShowDeleteConfirmation = true;
|
||||
}
|
||||
|
||||
private void DeleteConfirmed()
|
||||
{
|
||||
_schueler.aktiv = false;
|
||||
_schueler.mutierer = userid;
|
||||
_schueler.mutiert_am = DateTime.Now;
|
||||
BlazorApp.Controller.SchuelerController.PUT(_schueler);
|
||||
BlazorApp.Controller.SchuelerBerufController.DeleteBerufswunsch(_schueler.ID, userid);
|
||||
ShowDeleteConfirmation = false;
|
||||
UpdateSchulerliste();
|
||||
}
|
||||
|
||||
private void AbortDelete()
|
||||
{
|
||||
ShowDeleteConfirmation = false;
|
||||
}
|
||||
|
||||
//--------------------------------------
|
||||
//SchülerBeruf / Beruf
|
||||
//--------------------------------------
|
||||
private async Task OnBeginHandler(ActionEventArgs<BWPMModels.SchuelerBeruf> Args)
|
||||
|
||||
{
|
||||
if (Args.RequestType == Syncfusion.Blazor.Grids.Action.Save)
|
||||
{
|
||||
if (Args.Action == "Add")
|
||||
{
|
||||
|
||||
Args.Data.erstellt_am = DateTime.Now;
|
||||
Args.Data.mutierer = userid;
|
||||
Args.Data.mutiert_am = DateTime.Now;
|
||||
Args.Data.aktiv = true;
|
||||
Args.Data.ID = BlazorApp.Controller.SchuelerBerufController.POST(Args.Data);
|
||||
Value = Args.Data.ID;
|
||||
}
|
||||
else
|
||||
{
|
||||
Args.Data.mutierer = userid.ToString();
|
||||
Args.Data.mutiert_am = DateTime.Now;
|
||||
BlazorApp.Controller.SchuelerBerufController.PUT(Args.Data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async Task OnCompletedHandler(ActionEventArgs<BWPMModels.SchuelerBeruf> Args)
|
||||
|
||||
{
|
||||
if (Args.RequestType == Syncfusion.Blazor.Grids.Action.Save)
|
||||
{
|
||||
await Grid.SetRowData(Args.Data.ID, Args.Data);
|
||||
double xx = 0;
|
||||
Value = Args.Data.ID;
|
||||
xx = await DataHandler();
|
||||
await Grid.SelectRow(xx);
|
||||
|
||||
}
|
||||
}
|
||||
public async void RowDataBoundHandler(BeforeDataBoundArgs<BWPMModels.SchuelerBeruf> args)
|
||||
{
|
||||
if (!Initial)
|
||||
{
|
||||
//await Task.Delay(100);
|
||||
//var Idx = await this.Grid.GetRowIndexByPrimaryKey(Convert.ToDouble(Value)); //get index value
|
||||
//this.Grid.SelectRow(Convert.ToDouble(Idx));
|
||||
}
|
||||
Initial = false;
|
||||
}
|
||||
|
||||
public async Task<double> DataHandler()
|
||||
{
|
||||
var PageCount = (GridData.Count / Grid.PageSettings.PageSize) + 1;
|
||||
ContinuePaging = true;
|
||||
var CurrentPage = 1;
|
||||
Grid.Refresh();
|
||||
await Grid.GoToPage(1);
|
||||
|
||||
for (int i = 1; i <= PageCount; i++)
|
||||
|
||||
{
|
||||
List<SchuelerBeruf> Rows = await Grid.GetCurrentViewRecords(); // returns the current view data
|
||||
for (int j = 0; j < Grid.PageSettings.PageSize; j++)
|
||||
{
|
||||
if (j < Rows.Count && Rows[j].ID == Value)
|
||||
{
|
||||
foundrow = j;
|
||||
|
||||
ContinuePaging = false; // prevent the default navigation
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ContinuePaging)
|
||||
{
|
||||
if (i >= PageCount)
|
||||
{
|
||||
i = 0;
|
||||
}
|
||||
await Grid.GoToPage(i + 1);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return foundrow;
|
||||
}
|
||||
}
|
||||
return foundrow;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,3 +0,0 @@
|
||||
is_global = true
|
||||
build_property.RootNamespace = BlazorApp
|
||||
build_property.ProjectDir = e:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\
|
||||
@ -1 +1 @@
|
||||
b09c160abeeffc73ba6017c4f2b3649cdd7d1021
|
||||
fe4d9d8046db1979e6f6be2620996118b6a54def
|
||||
|
||||
@ -1 +1 @@
|
||||
a77cccb14b89518914423291c0a85ab83d2c656a
|
||||
6d6bcd8b964e366fe8e88fdcd92c65362414d860
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +1 @@
|
||||
9500a4b6d758b898f89bc77e14e662d0c7613687
|
||||
74e38141ec73d454eb8287a26c8b118915c9754e
|
||||
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
@ -0,0 +1,492 @@
|
||||
// <auto-generated/>
|
||||
#pragma warning disable 1591
|
||||
#pragma warning disable 0414
|
||||
#pragma warning disable 0649
|
||||
#pragma warning disable 0169
|
||||
|
||||
namespace BlazorApp.Pages.Teacher
|
||||
{
|
||||
#line hidden
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
#nullable restore
|
||||
#line 1 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\_Imports.razor"
|
||||
using System.Net.Http;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 2 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\_Imports.razor"
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 3 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\_Imports.razor"
|
||||
using Microsoft.AspNetCore.Components.Authorization;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 4 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\_Imports.razor"
|
||||
using Microsoft.AspNetCore.Components.Forms;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 5 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\_Imports.razor"
|
||||
using Microsoft.AspNetCore.Components.Routing;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 6 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\_Imports.razor"
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 7 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\_Imports.razor"
|
||||
using Microsoft.JSInterop;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 8 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\_Imports.razor"
|
||||
using BlazorApp;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 9 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\_Imports.razor"
|
||||
using BlazorApp.Shared;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 10 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\_Imports.razor"
|
||||
using Syncfusion.Blazor;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 11 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\_Imports.razor"
|
||||
using Syncfusion.Blazor.Calendars;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 12 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\_Imports.razor"
|
||||
using Radzen;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 13 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\_Imports.razor"
|
||||
using Radzen.Blazor;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 15 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\_Imports.razor"
|
||||
using FastReport;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 16 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\_Imports.razor"
|
||||
using FastReport.Web;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 17 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\_Imports.razor"
|
||||
using FastReport.Web.Blazor.Components;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 19 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\_Imports.razor"
|
||||
using Blazored.SessionStorage;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 6 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\Pages\Teacher\TeacherStudent.razor"
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 7 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\Pages\Teacher\TeacherStudent.razor"
|
||||
using Syncfusion.Blazor.Grids;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 8 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\Pages\Teacher\TeacherStudent.razor"
|
||||
using Syncfusion.Blazor.Buttons;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 9 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\Pages\Teacher\TeacherStudent.razor"
|
||||
using Syncfusion.Blazor.Spinner;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 10 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\Pages\Teacher\TeacherStudent.razor"
|
||||
using Syncfusion.Blazor.Navigations;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 11 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\Pages\Teacher\TeacherStudent.razor"
|
||||
using Syncfusion.Blazor.Popups;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 12 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\Pages\Teacher\TeacherStudent.razor"
|
||||
using Syncfusion.Blazor.DropDowns;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 13 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\Pages\Teacher\TeacherStudent.razor"
|
||||
using BlazorApp.Helper;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
#nullable restore
|
||||
#line 14 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\Pages\Teacher\TeacherStudent.razor"
|
||||
using BWPMModels;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
[Microsoft.AspNetCore.Components.RouteAttribute("/Teacher/TeacherStudent")]
|
||||
public partial class TeacherStudent : Admin.ListBase
|
||||
{
|
||||
#pragma warning disable 1998
|
||||
protected override void BuildRenderTree(Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
|
||||
{
|
||||
}
|
||||
#pragma warning restore 1998
|
||||
#nullable restore
|
||||
#line 173 "E:\Software-Projekte\Lehrlingsparcours\Core\BWPM\BlazorApp\Pages\Teacher\TeacherStudent.razor"
|
||||
|
||||
public bool ShowDeleteConfirmation { get; set; } = false;
|
||||
protected ElementReference ToFocus;
|
||||
public int lehrerID = 0;
|
||||
public int hiddenschuelerid = 0;
|
||||
public string KlasseID = "0";
|
||||
public string SchuelerklasseID = "0";
|
||||
public string KlasseTypID = "0";
|
||||
public string userid;
|
||||
public bool FieldDisabled = true;
|
||||
public bool DropDownEnabled = false;
|
||||
public List<BWPMModels.Klasse> Klasse { get; set; }
|
||||
public List<BWPMModels.Klasse> Schuelerklasse { get; set; }
|
||||
public List<BWPMModels.Klassentyp> klassentyp { get; set; } = BlazorApp.Controller.KlassentypController.GetAllAktiveData();
|
||||
public List<BWPMModels.Schueler> Schueler { get; set; }
|
||||
private Schueler _schueler { get; set; } = new BWPMModels.Schueler();
|
||||
public List<BWPMModels.Beruf> Berufe { get; set; } = BlazorApp.Controller.BerufController.GetBerufsangebot();
|
||||
|
||||
public List<Schuelerlist> schuelerliste = new List<Schuelerlist>();
|
||||
public int SchuelerID;
|
||||
|
||||
public class Schuelerlist
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string bezeichnung { get; set; }
|
||||
}
|
||||
|
||||
//--------------------------------------
|
||||
//Schülerberuf / beruf
|
||||
//--------------------------------------
|
||||
SfGrid<SchuelerBeruf> Grid { get; set; }
|
||||
public List<BWPMModels.SchuelerBeruf> GridData { get; set; }
|
||||
public bool ContinuePaging = true;
|
||||
public bool InitialRender { get; set; }
|
||||
public int Value = 0; // consider that value your querystring contains
|
||||
public int foundrow = 0;
|
||||
public bool Initial { get; set; } = true;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
lehrerID = await sessionStorage.GetItemAsync<int>("LehrerID");
|
||||
Klasse = BlazorApp.Controller.KlasseController.GetByLehrerID(Convert.ToInt32(lehrerID));
|
||||
KlasseID = Klasse[0].ID.ToString();
|
||||
Schuelerklasse = BlazorApp.Controller.KlasseController.GetByLehrerID(Convert.ToInt32(lehrerID));
|
||||
SchuelerklasseID = Schuelerklasse[0].ID.ToString();
|
||||
KlasseTypID = klassentyp[0].ID.ToString();
|
||||
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender != true) { return; };
|
||||
userid = await sessionStorage.GetItemAsync<string>("UserID");
|
||||
if (userid == null)
|
||||
{
|
||||
var authState = await authenticationStateTask;
|
||||
userid = authState.User.Claims.FirstOrDefault().Value;
|
||||
var user = authState.User;
|
||||
|
||||
}
|
||||
}
|
||||
//----------------------------------------------------------
|
||||
//Klassenliste / Schuelerliste
|
||||
//----------------------------------------------------------
|
||||
public void ChangeKlasse(Syncfusion.Blazor.DropDowns.ChangeEventArgs<string, Klasse> args)
|
||||
{
|
||||
|
||||
UpdateSchulerliste();
|
||||
}
|
||||
|
||||
public void UpdateSchulerliste()
|
||||
{
|
||||
Schueler = BlazorApp.Controller.SchuelerController.GetByKlasseID(Convert.ToInt32(KlasseID));
|
||||
schuelerliste.Clear();
|
||||
int newschuelerid = 0;
|
||||
bool found = false;
|
||||
foreach (BWPMModels.Schueler item in Schueler)
|
||||
{
|
||||
|
||||
Schuelerlist sl = new Schuelerlist();
|
||||
sl.id = item.ID;
|
||||
if (newschuelerid == 0) { newschuelerid = sl.id; };
|
||||
if (SchuelerID == sl.id) { found = true; }
|
||||
sl.bezeichnung = item.name + " " + item.vorname;
|
||||
schuelerliste.Add(sl);
|
||||
};
|
||||
if (found != true)
|
||||
{
|
||||
FieldDisabled = true;
|
||||
DropDownEnabled = false;
|
||||
SchuelerID = -1;
|
||||
SchuelerID = newschuelerid;
|
||||
if (schuelerliste.Count > 0) { SchuelerSelected(); }
|
||||
}
|
||||
|
||||
}
|
||||
private void SchuelerChange(object value, string name)
|
||||
{
|
||||
var str = value is IEnumerable<object> ? string.Join(", ", (IEnumerable<object>)value) : value;
|
||||
SchuelerSelected();
|
||||
|
||||
}
|
||||
private void SchuelerSelected()
|
||||
{
|
||||
Schueler = BlazorApp.Controller.SchuelerController.GetByID(Convert.ToInt32(SchuelerID));
|
||||
_schueler = Schueler.First<BWPMModels.Schueler>();
|
||||
SchuelerklasseID = _schueler.klasseID.ToString();
|
||||
KlasseTypID = _schueler.klassemtypID.ToString();
|
||||
FieldDisabled = false;
|
||||
DropDownEnabled = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------
|
||||
//Schüler-Formular
|
||||
//----------------------------------------------------------
|
||||
|
||||
public void Submit()
|
||||
{
|
||||
BlazorApp.Controller.SchuelerController.PUT(_schueler);
|
||||
}
|
||||
public void InvalidSubmit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void SaveClick()
|
||||
{
|
||||
Schueler _tmpschueler = new BWPMModels.Schueler();
|
||||
_tmpschueler = BlazorApp.Controller.SchuelerController.GetByID(_schueler.ID).First<BWPMModels.Schueler>();
|
||||
_tmpschueler.name = _schueler.name;
|
||||
_tmpschueler.vorname = _schueler.vorname;
|
||||
_tmpschueler.bemerkung = _schueler.bemerkung;
|
||||
_tmpschueler.klasseID = Convert.ToInt32(SchuelerklasseID);
|
||||
_tmpschueler.klassemtypID = Convert.ToInt32(KlasseTypID);
|
||||
BlazorApp.Controller.SchuelerController.PUT(_tmpschueler);
|
||||
UpdateSchulerliste();
|
||||
|
||||
}
|
||||
private void NewClick()
|
||||
{
|
||||
int schuelerid = 0;
|
||||
BWPMModels.Schueler schuelerdata = new Schueler();
|
||||
schuelerdata.aktiv = true;
|
||||
schuelerdata.erstellt_am = DateTime.Now;
|
||||
schuelerdata.mutiert_am = DateTime.Now;
|
||||
schuelerdata.mutierer = userid;
|
||||
schuelerdata.name = "Neuer Schüler";
|
||||
schuelerdata.vorname = "";
|
||||
schuelerdata.bemerkung = "";
|
||||
schuelerdata.klasseID = Convert.ToInt32(KlasseID);
|
||||
schuelerdata.klassemtypID = Convert.ToInt32(KlasseTypID);
|
||||
schuelerid = BlazorApp.Controller.SchuelerController.POST(schuelerdata);
|
||||
FieldDisabled = false;
|
||||
|
||||
DropDownEnabled = true;
|
||||
UpdateSchulerliste();
|
||||
SchuelerID = schuelerid;
|
||||
SchuelerSelected();
|
||||
jsRuntime.InvokeVoidAsync("SetFocusToElement", ToFocus);
|
||||
|
||||
}
|
||||
private void DeleteClick()
|
||||
{
|
||||
ShowDeleteConfirmation = true;
|
||||
}
|
||||
|
||||
private void DeleteConfirmed()
|
||||
{
|
||||
_schueler.aktiv = false;
|
||||
_schueler.mutierer = userid;
|
||||
_schueler.mutiert_am = DateTime.Now;
|
||||
BlazorApp.Controller.SchuelerController.PUT(_schueler);
|
||||
BlazorApp.Controller.SchuelerBerufController.DeleteBerufswunsch(_schueler.ID, userid);
|
||||
ShowDeleteConfirmation = false;
|
||||
UpdateSchulerliste();
|
||||
}
|
||||
|
||||
private void AbortDelete()
|
||||
{
|
||||
ShowDeleteConfirmation = false;
|
||||
}
|
||||
|
||||
//--------------------------------------
|
||||
//SchülerBeruf / Beruf
|
||||
//--------------------------------------
|
||||
private async Task OnBeginHandler(ActionEventArgs<BWPMModels.SchuelerBeruf> Args)
|
||||
|
||||
{
|
||||
if (Args.RequestType == Syncfusion.Blazor.Grids.Action.Save)
|
||||
{
|
||||
if (Args.Action == "Add")
|
||||
{
|
||||
|
||||
Args.Data.erstellt_am = DateTime.Now;
|
||||
Args.Data.mutierer = userid;
|
||||
Args.Data.mutiert_am = DateTime.Now;
|
||||
Args.Data.aktiv = true;
|
||||
Args.Data.ID = BlazorApp.Controller.SchuelerBerufController.POST(Args.Data);
|
||||
Value = Args.Data.ID;
|
||||
}
|
||||
else
|
||||
{
|
||||
Args.Data.mutierer = userid.ToString();
|
||||
Args.Data.mutiert_am = DateTime.Now;
|
||||
BlazorApp.Controller.SchuelerBerufController.PUT(Args.Data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async Task OnCompletedHandler(ActionEventArgs<BWPMModels.SchuelerBeruf> Args)
|
||||
|
||||
{
|
||||
if (Args.RequestType == Syncfusion.Blazor.Grids.Action.Save)
|
||||
{
|
||||
await Grid.SetRowData(Args.Data.ID, Args.Data);
|
||||
double xx = 0;
|
||||
Value = Args.Data.ID;
|
||||
xx = await DataHandler();
|
||||
await Grid.SelectRow(xx);
|
||||
|
||||
}
|
||||
}
|
||||
public async void RowDataBoundHandler(BeforeDataBoundArgs<BWPMModels.SchuelerBeruf> args)
|
||||
{
|
||||
if (!Initial)
|
||||
{
|
||||
//await Task.Delay(100);
|
||||
//var Idx = await this.Grid.GetRowIndexByPrimaryKey(Convert.ToDouble(Value)); //get index value
|
||||
//this.Grid.SelectRow(Convert.ToDouble(Idx));
|
||||
}
|
||||
Initial = false;
|
||||
}
|
||||
|
||||
public async Task<double> DataHandler()
|
||||
{
|
||||
var PageCount = (GridData.Count / Grid.PageSettings.PageSize) + 1;
|
||||
ContinuePaging = true;
|
||||
var CurrentPage = 1;
|
||||
Grid.Refresh();
|
||||
await Grid.GoToPage(1);
|
||||
|
||||
for (int i = 1; i <= PageCount; i++)
|
||||
|
||||
{
|
||||
List<SchuelerBeruf> Rows = await Grid.GetCurrentViewRecords(); // returns the current view data
|
||||
for (int j = 0; j < Grid.PageSettings.PageSize; j++)
|
||||
{
|
||||
if (j < Rows.Count && Rows[j].ID == Value)
|
||||
{
|
||||
foundrow = j;
|
||||
|
||||
ContinuePaging = false; // prevent the default navigation
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ContinuePaging)
|
||||
{
|
||||
if (i >= PageCount)
|
||||
{
|
||||
i = 0;
|
||||
}
|
||||
await Grid.GoToPage(i + 1);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return foundrow;
|
||||
}
|
||||
}
|
||||
return foundrow;
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
#nullable disable
|
||||
[global::Microsoft.AspNetCore.Components.InjectAttribute] private NavigationManager NavManager { get; set; }
|
||||
[global::Microsoft.AspNetCore.Components.InjectAttribute] private IJSRuntime jsRuntime { get; set; }
|
||||
[global::Microsoft.AspNetCore.Components.InjectAttribute] private Blazored.SessionStorage.ISessionStorageService sessionStorage { get; set; }
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,3 +0,0 @@
|
||||
is_global = true
|
||||
build_property.RootNamespace = BWPMModels
|
||||
build_property.ProjectDir = e:\Software-Projekte\Lehrlingsparcours\Core\BWPM\Models\
|
||||
Binary file not shown.
Binary file not shown.
@ -1 +1 @@
|
||||
c6694572788175e89456330a59d70d898a295b82
|
||||
0a97416b02a836b092f0058d5f13f6db2b4570f3
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue