Update 20231515
This commit is contained in:
54
BlazorApp/Pages/Admin/Dashboard/Dashboard.razor
Normal file
54
BlazorApp/Pages/Admin/Dashboard/Dashboard.razor
Normal file
@@ -0,0 +1,54 @@
|
||||
@page "/Admin/Dashboard"
|
||||
|
||||
@inject NavigationManager NavManager
|
||||
@using System.ComponentModel.DataAnnotations
|
||||
@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-companylist:before {
|
||||
content: '\e71f';
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
</style>
|
||||
@code {
|
||||
|
||||
}
|
||||
95
BlazorApp/Pages/Admin/Student/Berufswunsch.razor
Normal file
95
BlazorApp/Pages/Admin/Student/Berufswunsch.razor
Normal file
@@ -0,0 +1,95 @@
|
||||
@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="row">
|
||||
<div class="col-md-4" @ondblclick="InsertBeruf">
|
||||
<h6>Berufe</h6>
|
||||
<SfListBox @bind-Value=@BerufID TValue="string[]" DataSource="@berufe" @ref="Berufsliste" TItem="Beruf" Height="250px">
|
||||
<ListBoxSelectionSettings Mode="Syncfusion.Blazor.DropDowns.SelectionMode.Single" ShowCheckbox="false"></ListBoxSelectionSettings>
|
||||
<ListBoxFieldSettings Text="bezeichnung" Value="id" />
|
||||
|
||||
</SfListBox>
|
||||
<SfButton OnClick="InsertBeruf">Beruf auswählen</SfButton>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<h6>Gewählte Berufe</h6>
|
||||
<BlazorApp.Pages.Shared.BerufswunschListe AllowUpdates="true" @ref="BWL" OnGridClicked="OnGridClicked1"></BlazorApp.Pages.Shared.BerufswunschListe>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
public string userid { get; set; } = "";
|
||||
|
||||
|
||||
BlazorApp.Pages.Shared.BerufswunschListe BWL { get; set; }
|
||||
public int SchuelerID = 0;
|
||||
public bool ShowDeleteConfirmation { get; set; } = false;
|
||||
|
||||
public string DialogHeader { get; set; } = "";
|
||||
public string DialogText { get; set; } = "";
|
||||
public bool DialogShowYesNO { get; set; } = true;
|
||||
|
||||
//public int BerufID;
|
||||
//public List<BWPMModels.Beruf> berufe { get; set; } = BlazorApp.Controller.BerufController.GetBerufsangebot();
|
||||
SfGrid<SchuelerBeruf> Grid { get; set; }
|
||||
public List<BWPMModels.SchuelerBeruf> GridData { get; set; }
|
||||
|
||||
public string berufhinweis = "";
|
||||
public bool ContinuePaging = true;
|
||||
public int foundrow = 0;
|
||||
public int Value = 0;
|
||||
|
||||
public string[] BerufID;
|
||||
SfListBox<string[], Beruf> Berufsliste { get; set; }
|
||||
public List<Beruf> berufe = new List<Beruf>();
|
||||
public List<BWPMModels.Beruf> _berufe { get; set; } = BlazorApp.Controller.BerufController.GetBerufsangebot();
|
||||
public class Beruf
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string bezeichnung { get; set; }
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
foreach (BWPMModels.Beruf item in _berufe)
|
||||
{
|
||||
Beruf be = new Beruf();
|
||||
be.id = item.ID;
|
||||
be.bezeichnung = item.bezeichnung;
|
||||
berufe.Add(be);
|
||||
}
|
||||
}
|
||||
|
||||
public void ReloadData(string SchuelerID)
|
||||
{
|
||||
BWL.userid = userid;
|
||||
BWL.ReloadData(Convert.ToInt32(SchuelerID));
|
||||
}
|
||||
|
||||
private void InsertBeruf()
|
||||
{
|
||||
BWPMModels.SchuelerBeruf sberuf = new BWPMModels.SchuelerBeruf();
|
||||
sberuf.aktiv = true;
|
||||
sberuf.bemerkung = "";
|
||||
sberuf.berufID = Convert.ToInt32(BerufID[0]);
|
||||
sberuf.erstellt_am = DateTime.Now;
|
||||
sberuf.mutiert_am = DateTime.Now;
|
||||
sberuf.mutierer = userid;
|
||||
sberuf.schuelerID = Convert.ToInt32(SchuelerID);
|
||||
int prio = BlazorApp.Controller.SchuelerBerufController.Get_Prio(Convert.ToInt32(SchuelerID));
|
||||
sberuf.prioritaet = prio + 1;
|
||||
BlazorApp.Controller.SchuelerBerufController.POST(sberuf);
|
||||
BWL.ReloadData(Convert.ToInt32(SchuelerID));
|
||||
}
|
||||
|
||||
private void OnGridClicked1(string Berufid)
|
||||
{ }
|
||||
}
|
||||
@@ -1,687 +1,215 @@
|
||||
@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
|
||||
<RadzenDropDown AllowClear="true" TValue="string" @bind-Value=@KlasseID
|
||||
Data=@intKlasse
|
||||
Change=@(args => OnChange(args, "DropDown")) TextProperty="bezeichnung" ValueProperty="id" />
|
||||
Lehrer
|
||||
<RadzenDropDown AllowClear="true" TValue="string" @bind-Value=@LehrerID
|
||||
Data=@intLehrer
|
||||
Change=@(args => OnChange(args, "DropDown")) TextProperty="bezeichnung" ValueProperty="id" />
|
||||
</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">
|
||||
<SfAccordion ExpandMode="ExpandMode.Multiple" @bind-ExpandedIndices=ExpandItems>
|
||||
<AccordionItems>
|
||||
<AccordionItem>
|
||||
<HeaderTemplate><h4>Schüler-Daten</h4></HeaderTemplate>
|
||||
<ContentTemplate>
|
||||
@*<div class="row">
|
||||
<SfButton IsPrimary="true" OnClick="@(() => NewClick())">Neuer Schüler</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">
|
||||
|
||||
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">
|
||||
|
||||
Vorname
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
|
||||
<InputText id="Vorname" class="form-control" @bind-Value="_schueler.vorname" placeholder="Vorname" disabled="@FieldDisabled" />
|
||||
<ValidationMessage For="@(() => _schueler.name)" />
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
|
||||
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">
|
||||
<RadzenDropDown AllowClear="true" TValue="string" @bind-Value=@SchuelerklasseID
|
||||
Data=@Schuelerklasse
|
||||
TextProperty="bezeichnung" ValueProperty="id" />
|
||||
</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">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<br />
|
||||
|
||||
</EditForm>
|
||||
@* <div class="row">
|
||||
<SfButton Disabled="@FieldDisabled" IsPrimary="true" OnClick="@(() => SaveClick())">Änderungen speichern</SfButton>
|
||||
<SfButton Disabled="@FieldDisabled" IsPrimary="true" OnClick="@(() => DeleteClick())">Schüler löschen</SfButton>
|
||||
</div>*@
|
||||
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</AccordionItem>
|
||||
<AccordionItem>
|
||||
<HeaderTemplate><h4>Berufswünsche</h4></HeaderTemplate>
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
@* <div class="col-md-4">
|
||||
<RadzenListBox @bind-Value=@BerufID Data=@berufe TextProperty="bezeichnung" ValueProperty="ID" Style="height:250px" />
|
||||
<br />
|
||||
<RadzenButton style="margin: 0 1rem 1rem 0" Click=@(args => InsertBeruf()) Text="Beruf zuordnen" ButtonStyle="ButtonStyle.Secondary" />
|
||||
</div>
|
||||
*@ <div class="col-md-8">
|
||||
<SfGrid ID="Grid3" DataSource="@GridData" @ref="Grid" AllowPaging="false" AllowSorting="true" Toolbar="@(new List<string>() { "Edit", "Delete" })">
|
||||
<GridPageSettings PageCount="5" PageSizes="true"></GridPageSettings>
|
||||
<GridEditSettings AllowAdding="true" AllowDeleting="true" 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>
|
||||
|
||||
<GridForeignColumn Field=@nameof(SchuelerBeruf.berufID) HeaderText="Beruf" ForeignKeyField="ID" ForeignKeyValue="bezeichnung" ForeignDataSource="@berufe" Width="150"></GridForeignColumn>
|
||||
|
||||
<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 class="container">
|
||||
<h2></h2>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body" style="color:red">@((MarkupString)berufhinweis)</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</AccordionItem>
|
||||
<AccordionItem>
|
||||
<HeaderTemplate><h4>Zuteilung</h4></HeaderTemplate>
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-4">
|
||||
<h4>Berufswunsch</h4>
|
||||
<SfGrid ID="Grid4" DataSource="@GridData" @ref="Grid" AllowPaging="false" AllowSorting="true" >
|
||||
<GridPageSettings PageCount="5" PageSizes="true"></GridPageSettings>
|
||||
<GridEditSettings AllowAdding="false" AllowDeleting="false" AllowEditing="false" Mode="EditMode.Dialog"></GridEditSettings>
|
||||
<GridEvents OnActionBegin="OnBeginHandler" OnActionComplete="OnCompletedHandler" TValue="SchuelerBeruf" OnDataBound="RowDataBoundHandler"></GridEvents>
|
||||
<GridColumns>
|
||||
<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>
|
||||
|
||||
<GridForeignColumn Field=@nameof(SchuelerBeruf.berufID) HeaderText="Beruf" ForeignKeyField="ID" ForeignKeyValue="bezeichnung" ForeignDataSource="@berufe" Width="100"></GridForeignColumn>
|
||||
|
||||
<GridColumn Field=@nameof(SchuelerBeruf.bemerkung) HeaderText="Bemerkung" Width="100" Visible="false"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(SchuelerBeruf.prioritaet) HeaderText="Prioritaet" Width="80" 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 class="col-md-8">
|
||||
<h4>Zuteilung</h4>
|
||||
<SfGrid ID="Grid5" DataSource="@GridData" @ref="Grid" AllowPaging="false" AllowSorting="true" Toolbar="@(new List<string>() { "Edit", "Delete" })">
|
||||
<GridPageSettings PageCount="5" PageSizes="true"></GridPageSettings>
|
||||
<GridEditSettings AllowAdding="false" AllowDeleting="false" AllowEditing="false" Mode="EditMode.Dialog"></GridEditSettings>
|
||||
<GridEvents OnActionBegin="OnBeginHandler" OnActionComplete="OnCompletedHandler" TValue="SchuelerBeruf" OnDataBound="RowDataBoundHandler"></GridEvents>
|
||||
<GridColumns>
|
||||
<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>
|
||||
|
||||
<GridForeignColumn Field=@nameof(SchuelerBeruf.berufID) HeaderText="Beruf" ForeignKeyField="ID" ForeignKeyValue="bezeichnung" ForeignDataSource="@berufe" Width="100"></GridForeignColumn>
|
||||
|
||||
<GridColumn Field=@nameof(SchuelerBeruf.bemerkung) HeaderText="Bemerkung" Width="100" Visible="false"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(SchuelerBeruf.prioritaet) HeaderText="Prioritaet" Width="80" 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>
|
||||
</ContentTemplate>
|
||||
</AccordionItem>
|
||||
</AccordionItems>
|
||||
</SfAccordion>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
#Grid1.e-grid .e-gridheader .e-columnheader,
|
||||
#Grid3.e-grid .e-gridfooter {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<SfDialog Width="350px" IsModal="true" @bind-Visible="@ShowDeleteConfirmation">
|
||||
<DialogTemplates>
|
||||
<Header>@DialogHeader</Header>
|
||||
<Content>@DialogText</Content>
|
||||
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
@if (DialogShowYesNO == true)
|
||||
{
|
||||
<DialogButton Content="Ja" IsPrimary="true" OnClick="@DeleteConfirmed" />
|
||||
<DialogButton Content="Nein" OnClick="@AbortDelete" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<DialogButton Content="OK" IsPrimary="true" OnClick="@DialogConfirmed" />
|
||||
}
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
|
||||
|
||||
@code {
|
||||
public int[] ExpandItems = new int[] { 2 };
|
||||
public string[] sfSchuelerID { get; set; }
|
||||
public string DialogHeader { get; set; } = "";
|
||||
public string DialogText { get; set; } = "";
|
||||
public bool DialogShowYesNO { get; set; } = true;
|
||||
public string berufhinweis = "";
|
||||
public string klassehinweis = "";
|
||||
public string klassehinweiscolor = "red";
|
||||
|
||||
public bool ShowDeleteConfirmation { get; set; } = false;
|
||||
protected ElementReference ToFocus;
|
||||
public string lehrerID = "";
|
||||
public int hiddenschuelerid = 0;
|
||||
public string KlasseID = "0";
|
||||
public string LehrerID = "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.Lehrer> Lehrer { 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 List<iKlasse> Schuelerklasse = new List<iKlasse>();
|
||||
public int SchuelerID;
|
||||
public List<iKlasse> intKlasse = new List<iKlasse>();
|
||||
public List<iLehrer> intLehrer = new List<iLehrer>();
|
||||
|
||||
public class iKlasse
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string bezeichnung { get; set; }
|
||||
|
||||
}
|
||||
public class iLehrer
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string bezeichnung { get; set; }
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
public int BerufID;
|
||||
private Lehrer _lehrer { get; set; } = new BWPMModels.Lehrer();
|
||||
public List<BWPMModels.Lehrer> Lehrerdaten { get; set; }
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
|
||||
lehrerID = await sessionStorage.GetItemAsync<string>("LehrerID");
|
||||
userid = await sessionStorage.GetItemAsync<string>("UserID");
|
||||
Klasse = BlazorApp.Controller.KlasseController.GetAllActiveData();
|
||||
intKlasse.Clear();
|
||||
foreach (BWPMModels.Klasse item in Klasse)
|
||||
{
|
||||
|
||||
iKlasse kl = new iKlasse();
|
||||
kl.id = item.ID.ToString();
|
||||
kl.bezeichnung = item.bezeichnung;
|
||||
intKlasse.Add(kl);
|
||||
Schuelerklasse.Add(kl);
|
||||
|
||||
};
|
||||
KlasseID = Klasse[0].ID.ToString();
|
||||
|
||||
SchuelerklasseID = Klasse[0].ID.ToString();
|
||||
KlasseTypID = klassentyp[0].ID.ToString();
|
||||
Lehrer = BlazorApp.Controller.LehrerController.GetAllActiveData();
|
||||
intLehrer.Clear();
|
||||
foreach (BWPMModels.Lehrer item in Lehrer)
|
||||
{
|
||||
iLehrer ll = new iLehrer();
|
||||
ll.id = item.ID.ToString();
|
||||
ll.bezeichnung = item.name.ToString() + " " + item.vorname.ToString();
|
||||
intLehrer.Add(ll);
|
||||
}
|
||||
LehrerID = Lehrer[0].ID.ToString();
|
||||
Update_Schueler_Klasse();
|
||||
}
|
||||
|
||||
void OnChange(object value, string name)
|
||||
{
|
||||
KlasseID = value.ToString();
|
||||
Update_Schueler_Klasse();
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
}
|
||||
//----------------------------------------------------------
|
||||
//Klassenliste / Schuelerliste
|
||||
//----------------------------------------------------------
|
||||
public void ChangeKlasse(Syncfusion.Blazor.DropDowns.ChangeEventArgs<string, Klasse> args)
|
||||
{
|
||||
|
||||
Update_Schueler_Klasse();
|
||||
}
|
||||
|
||||
|
||||
public void Update_Schueler_Klasse()
|
||||
{
|
||||
UpdateSchulerliste();
|
||||
pruefung_klasse();
|
||||
}
|
||||
|
||||
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(); }
|
||||
}
|
||||
|
||||
pruefung_klasse();
|
||||
}
|
||||
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;
|
||||
update_griddata();
|
||||
pruefung();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------
|
||||
//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()
|
||||
{
|
||||
DialogHeader = "Löschbestätigung";
|
||||
DialogText = "Schüler '" + _schueler.name + ' ' + _schueler.vorname + "' wirklich löschen?'";
|
||||
DialogShowYesNO = true;
|
||||
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;
|
||||
}
|
||||
private void DialogConfirmed()
|
||||
{
|
||||
ShowDeleteConfirmation = false;
|
||||
}
|
||||
//--------------------------------------
|
||||
//SchülerBeruf / Beruf
|
||||
//--------------------------------------
|
||||
private void InsertBeruf()
|
||||
{
|
||||
if (SchuelerID == 0)
|
||||
{
|
||||
DialogHeader = "Daten unvollständig";
|
||||
DialogText = "Bitte zuerst einen Schüler auswählen!";
|
||||
DialogShowYesNO = false;
|
||||
ShowDeleteConfirmation = true;
|
||||
return;
|
||||
}
|
||||
if (BerufID == 0)
|
||||
{
|
||||
DialogHeader = "Daten unvollständig";
|
||||
DialogText = "Bitte zuerst einen Beruf auswählen!";
|
||||
DialogShowYesNO = false;
|
||||
ShowDeleteConfirmation = true;
|
||||
return;
|
||||
}
|
||||
ShowDeleteConfirmation = false;
|
||||
BWPMModels.SchuelerBeruf sberuf = new BWPMModels.SchuelerBeruf();
|
||||
sberuf.aktiv = true;
|
||||
sberuf.bemerkung = "";
|
||||
sberuf.berufID = BerufID;
|
||||
sberuf.erstellt_am = DateTime.Now;
|
||||
sberuf.mutiert_am = DateTime.Now;
|
||||
sberuf.mutierer = userid;
|
||||
sberuf.schuelerID = SchuelerID;
|
||||
int prio = BlazorApp.Controller.SchuelerBerufController.Get_Prio(SchuelerID);
|
||||
sberuf.prioritaet = prio + 1;
|
||||
BlazorApp.Controller.SchuelerBerufController.POST(sberuf);
|
||||
update_griddata();
|
||||
pruefung();
|
||||
}
|
||||
|
||||
private void update_griddata()
|
||||
{
|
||||
GridData = BlazorApp.Controller.SchuelerBerufController.GetBySchuelerID(SchuelerID);
|
||||
}
|
||||
|
||||
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;
|
||||
pruefung();
|
||||
}
|
||||
else
|
||||
{
|
||||
Args.Data.mutierer = userid.ToString();
|
||||
Args.Data.mutiert_am = DateTime.Now;
|
||||
BlazorApp.Controller.SchuelerBerufController.PUT(Args.Data);
|
||||
pruefung();
|
||||
}
|
||||
}
|
||||
if (Args.RequestType == Syncfusion.Blazor.Grids.Action.Delete)
|
||||
{
|
||||
Args.Data.mutierer = userid.ToString();
|
||||
Args.Data.mutiert_am = DateTime.Now;
|
||||
Args.Data.aktiv = false;
|
||||
BlazorApp.Controller.SchuelerBerufController.PUT(Args.Data);
|
||||
pruefung();
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
}
|
||||
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;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ContinuePaging)
|
||||
{
|
||||
if (i >= PageCount)
|
||||
{
|
||||
i = 0;
|
||||
}
|
||||
await Grid.GoToPage(i + 1);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return foundrow;
|
||||
}
|
||||
}
|
||||
return foundrow;
|
||||
}
|
||||
|
||||
public void pruefung()
|
||||
{
|
||||
berufhinweis = "";
|
||||
int Anzahl_Berufe = 0;
|
||||
try
|
||||
{
|
||||
dbhelper dbh = new dbhelper();
|
||||
if (BlazorApp.Controller.SchuelerBerufController.Get_Anzahl(SchuelerID) < Convert.ToInt32(dbh.Get_Option(4)))
|
||||
{
|
||||
berufhinweis += "\r\n- es sollten 3 Berufswünsche ausgewählt werden<br />";
|
||||
}
|
||||
if (BlazorApp.Controller.SchuelerBerufController.Has_Prio1(SchuelerID) == false)
|
||||
{
|
||||
berufhinweis += "\r\n- Es fehlt ein Berufswunsch mit Priorität 1";
|
||||
}
|
||||
}
|
||||
catch { };
|
||||
}
|
||||
|
||||
public void pruefung_klasse()
|
||||
{
|
||||
klassehinweis = "";
|
||||
dbhelper dbh = new dbhelper();
|
||||
dbh.add_sp_param("Param1", KlasseID.ToString());
|
||||
dbh.Get_Tabledata("sp_chk_klasse", true, false);
|
||||
if (dbh.dsdaten.Tables[0].Rows[0][0].ToString() != dbh.dsdaten.Tables[0].Rows[0][1].ToString())
|
||||
{
|
||||
klassehinweis += "\r\n- " + dbh.dsdaten.Tables[0].Rows[0][1].ToString() + " von " + dbh.dsdaten.Tables[0].Rows[0][0].ToString() + " Schüler erfasst";
|
||||
klassehinweiscolor = "red";
|
||||
}
|
||||
else
|
||||
{
|
||||
klassehinweis += "\r\n- " + dbh.dsdaten.Tables[0].Rows[0][1].ToString() + " von " + dbh.dsdaten.Tables[0].Rows[0][0].ToString() + " Schüler erfasst";
|
||||
klassehinweiscolor = "green";
|
||||
}
|
||||
}
|
||||
|
||||
public async Task SchuelerClick(RecordClickEventArgs<Schuelerlist> args)
|
||||
{
|
||||
SchuelerID = args.RowData.id;
|
||||
SchuelerSelected();
|
||||
}
|
||||
}
|
||||
@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
|
||||
|
||||
}
|
||||
|
||||
162
BlazorApp/Pages/Admin/Student/StudentEdit.razor
Normal file
162
BlazorApp/Pages/Admin/Student/StudentEdit.razor
Normal file
@@ -0,0 +1,162 @@
|
||||
@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="row">
|
||||
<SfButton IsPrimary="true" OnClick="@(() => NewClick())">Neuer Schüler</SfButton>
|
||||
</div>*@
|
||||
|
||||
<EditForm Model="_schueler" OnValidSubmit="@Submit" OnInvalidSubmit="@InvalidSubmit" >
|
||||
<div class="row">
|
||||
<div class="col-md-1">
|
||||
|
||||
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">
|
||||
|
||||
Vorname
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
|
||||
<InputText id="Vorname" class="form-control" @bind-Value="_schueler.vorname" placeholder="Vorname" disabled="@FieldDisabled" />
|
||||
<ValidationMessage For="@(() => _schueler.name)" />
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
|
||||
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="@KlasseID" TValue="string" TItem="Klasse" Placeholder="Klasse" DataSource="@klasse" 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">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</EditForm>
|
||||
|
||||
<SfDialog Width="350px" IsModal="true" @bind-Visible="@ShowDeleteConfirmation">
|
||||
<DialogTemplates>
|
||||
<Header>@DialogHeader</Header>
|
||||
<Content>@DialogText</Content>
|
||||
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
@if (DialogShowYesNO == true)
|
||||
{
|
||||
<DialogButton Content="Ja" IsPrimary="true" OnClick="@DeleteConfirmed" />
|
||||
<DialogButton Content="Nein" OnClick="@AbortDelete" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<DialogButton Content="OK" IsPrimary="true" OnClick="@DialogConfirmed" />
|
||||
}
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public string iSchuelerID { get; set; } = "";
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<string> OnSchuelerChanged { get; set; }
|
||||
|
||||
|
||||
public int hiddenschuelerid = 0;
|
||||
public string DialogHeader { get; set; } = "";
|
||||
public string DialogText { get; set; } = "";
|
||||
public bool DialogShowYesNO { get; set; } = true;
|
||||
public bool ShowDeleteConfirmation { get; set; } = false;
|
||||
public string userid = "";
|
||||
public bool FieldDisabled = true;
|
||||
public string SchuelerklasseID = "0";
|
||||
public string KlasseTypID = "0";
|
||||
public string KlasseID = "0";
|
||||
private Schueler _schueler { get; set; } = new BWPMModels.Schueler();
|
||||
public List<BWPMModels.Klassentyp> klassentyp { get; set; } = BlazorApp.Controller.KlassentypController.GetAllAktiveData();
|
||||
public List<BWPMModels.Klasse> klasse { get; set; } = BlazorApp.Controller.KlasseController.GetAllActiveData();
|
||||
|
||||
public List<BWPMModels.Schueler> Schueler { get; set; }
|
||||
public bool DropDownEnabled = false;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Submit()
|
||||
{
|
||||
BlazorApp.Controller.SchuelerController.PUT(_schueler);
|
||||
}
|
||||
public void InvalidSubmit()
|
||||
{
|
||||
}
|
||||
private void DeleteClick()
|
||||
{
|
||||
DialogHeader = "Löschbestätigung";
|
||||
DialogText = "Schüler '" + _schueler.name + ' ' + _schueler.vorname + "' wirklich löschen?'";
|
||||
DialogShowYesNO = true;
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
private void AbortDelete()
|
||||
{
|
||||
ShowDeleteConfirmation = false;
|
||||
}
|
||||
private void DialogConfirmed()
|
||||
{
|
||||
ShowDeleteConfirmation = false;
|
||||
}
|
||||
|
||||
public void ReloadData(string Schuelerid)
|
||||
{
|
||||
Schueler = BlazorApp.Controller.SchuelerController.GetByID(Convert.ToInt32(Schuelerid));
|
||||
_schueler = Schueler.First<BWPMModels.Schueler>();
|
||||
KlasseID = _schueler.klasseID.ToString();
|
||||
KlasseTypID = _schueler.klassentypID.ToString();
|
||||
FieldDisabled = false;
|
||||
DropDownEnabled = false;
|
||||
|
||||
}
|
||||
}
|
||||
750
BlazorApp/Pages/Admin/Student/Student_sik.razor
Normal file
750
BlazorApp/Pages/Admin/Student/Student_sik.razor
Normal file
@@ -0,0 +1,750 @@
|
||||
@page "/Admin/Student/Student_sik"
|
||||
@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
|
||||
<RadzenDropDown AllowClear="true" TValue="string" @bind-Value=@KlasseID
|
||||
Data=@intKlasse
|
||||
Change=@(args => OnChange(args, "DropDown")) TextProperty="bezeichnung" ValueProperty="id" />
|
||||
Lehrer
|
||||
<RadzenDropDown AllowClear="true" TValue="string" @bind-Value=@LehrerID
|
||||
Data=@intLehrer
|
||||
Change=@(args => OnChange(args, "DropDown")) TextProperty="bezeichnung" ValueProperty="id" />
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="card">
|
||||
<h6 class="card-header">
|
||||
Schüler
|
||||
<input type="hidden" @bind="UID">
|
||||
</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">
|
||||
<SfAccordion ExpandMode="ExpandMode.Multiple" @bind-ExpandedIndices=ExpandItems>
|
||||
<AccordionItems>
|
||||
<AccordionItem>
|
||||
<HeaderTemplate><h4>Schüler-Daten</h4></HeaderTemplate>
|
||||
<ContentTemplate>
|
||||
@*<div class="row">
|
||||
<SfButton IsPrimary="true" OnClick="@(() => NewClick())">Neuer Schüler</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">
|
||||
|
||||
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">
|
||||
|
||||
Vorname
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
|
||||
<InputText id="Vorname" class="form-control" @bind-Value="_schueler.vorname" placeholder="Vorname" disabled="@FieldDisabled" />
|
||||
<ValidationMessage For="@(() => _schueler.name)" />
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
|
||||
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">
|
||||
<RadzenDropDown AllowClear="true" TValue="string" @bind-Value=@SchuelerklasseID
|
||||
Data=@Schuelerklasse
|
||||
TextProperty="bezeichnung" ValueProperty="id" />
|
||||
</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">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<br />
|
||||
|
||||
</EditForm>
|
||||
</ContentTemplate>
|
||||
</AccordionItem>
|
||||
<AccordionItem>
|
||||
<HeaderTemplate><h4>Berufswünsche</h4></HeaderTemplate>
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<RadzenListBox @bind-Value=@BerufID Data=@berufe TextProperty="bezeichnung" ValueProperty="ID" Style="height:250px" />
|
||||
<br />
|
||||
<RadzenButton style="margin: 0 1rem 1rem 0" Click=@(args => InsertBeruf()) Text="Beruf zuordnen" ButtonStyle="ButtonStyle.Secondary" />
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<SfGrid ID="Grid3" DataSource="@GridData" @ref="Grid" AllowPaging="false" AllowSorting="true" Toolbar="@(new List<string>() { "Edit", "Delete" })">
|
||||
<GridPageSettings PageCount="5" PageSizes="true"></GridPageSettings>
|
||||
<GridEditSettings AllowAdding="true" AllowDeleting="true" 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>
|
||||
|
||||
<GridForeignColumn Field=@nameof(SchuelerBeruf.berufID) HeaderText="Beruf" ForeignKeyField="ID" ForeignKeyValue="bezeichnung" ForeignDataSource="@berufe" Width="150"></GridForeignColumn>
|
||||
|
||||
<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 class="container">
|
||||
<h2></h2>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body" style="color:red">@((MarkupString)berufhinweis)</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</AccordionItem>
|
||||
<AccordionItem>
|
||||
<HeaderTemplate><h4>Zuteilung</h4></HeaderTemplate>
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-4">
|
||||
<h4>Berufswunsch</h4>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<h4>Zuteilung</h4>
|
||||
<SfGrid ID="Grid5" DataSource="@GridDataZuteilung" @ref="GridZuteilung" AllowPaging="true" AllowSorting="true"
|
||||
Toolbar="@(new List<string>() { "Add", "Edit", "Update", "Cancel" })"
|
||||
ContextMenuItems="@(new List<Object>()
|
||||
{ new ContextMenuItemModel { Text = "Löschen", Target = ".e-content", Id = "deleteentry" } })">
|
||||
<GridPageSettings PageCount="5" PageSizes="true"></GridPageSettings>
|
||||
<GridEditSettings AllowAdding="false" AllowDeleting="false" AllowEditing="false" Mode="EditMode.Dialog"></GridEditSettings>
|
||||
<GridEvents ContextMenuItemClicked="OnContextMenuClick" TValue="ZuteilungView"></GridEvents>
|
||||
<GridColumns>
|
||||
<GridColumn Type="ColumnType.CheckBox" AllowFiltering="false" AllowSorting="false" Width="50"></GridColumn>
|
||||
<GridColumn Field=@nameof(ZuteilungView.ID) HeaderText="Id" IsPrimaryKey="true" AllowAdding="false" Width="60" Visible="false"> </GridColumn>
|
||||
<GridColumn Field=@nameof(ZuteilungView.schuelerid) HeaderText="Schuelerid" Width="100" Visible="false"></GridColumn>
|
||||
<GridColumn Field=@nameof(ZuteilungView.beruf) HeaderText="Beruf" Width="100" Visible="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ZuteilungView.zeit) HeaderText="Zeite" Width="100" Visible="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ZuteilungView.firma) HeaderText="Firma" Width="100" Visible="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ZuteilungView.prioritaet) HeaderText="Prio." Width="40" Visible="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ZuteilungView.bemerkung) HeaderText="Bemerkung" Width="100" Visible="true"></GridColumn>
|
||||
</GridColumns>
|
||||
</SfGrid>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<h5>Zugeteilt</h5>
|
||||
<SfGrid ID="Grid6" DataSource="@GridDataZuteilung" @ref="GridZuteilung" AllowPaging="true" AllowSorting="true"
|
||||
Toolbar="@(new List<string>() { "Add", "Edit", "Update", "Cancel" })"
|
||||
ContextMenuItems="@(new List<Object>()
|
||||
{ new ContextMenuItemModel { Text = "Löschen", Target = ".e-content", Id = "deleteentry" } })">
|
||||
<GridPageSettings PageCount="5" PageSizes="true"></GridPageSettings>
|
||||
<GridEditSettings AllowAdding="false" AllowDeleting="false" AllowEditing="false" Mode="EditMode.Dialog"></GridEditSettings>
|
||||
<GridEvents ContextMenuItemClicked="OnContextMenuClick" TValue="ZuteilungView"></GridEvents>
|
||||
<GridColumns>
|
||||
<GridColumn Type="ColumnType.CheckBox" AllowFiltering="false" AllowSorting="false" Width="50"></GridColumn>
|
||||
<GridColumn Field=@nameof(ZuteilungView.ID) HeaderText="Id" IsPrimaryKey="true" AllowAdding="false" Width="60" Visible="false"> </GridColumn>
|
||||
<GridColumn Field=@nameof(ZuteilungView.schuelerid) HeaderText="Schuelerid" Width="100" Visible="false"></GridColumn>
|
||||
<GridColumn Field=@nameof(ZuteilungView.beruf) HeaderText="Beruf" Width="100" Visible="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ZuteilungView.zeit) HeaderText="Zeite" Width="100" Visible="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ZuteilungView.firma) HeaderText="Firma" Width="100" Visible="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ZuteilungView.prioritaet) HeaderText="Prio." Width="40" Visible="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ZuteilungView.bemerkung) HeaderText="Bemerkung" Width="100" Visible="true"></GridColumn>
|
||||
</GridColumns>
|
||||
</SfGrid>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<h5>Offene Angebote</h5>
|
||||
<BlazorApp.Pages.Shared.OffenePlaetze SchuelerID="@SchuelerID" @ref="OP" OnGridChanged="GridChanged"></BlazorApp.Pages.Shared.OffenePlaetze>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</AccordionItem>
|
||||
</AccordionItems>
|
||||
</SfAccordion>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
#Grid1.e-grid .e-gridheader .e-columnheader,
|
||||
#Grid3.e-grid .e-gridfooter {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<SfDialog Width="350px" IsModal="true" @bind-Visible="@ShowDeleteConfirmation">
|
||||
<DialogTemplates>
|
||||
<Header>@DialogHeader</Header>
|
||||
<Content>@DialogText</Content>
|
||||
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
@if (DialogShowYesNO == true)
|
||||
{
|
||||
<DialogButton Content="Ja" IsPrimary="true" OnClick="@DeleteConfirmed" />
|
||||
<DialogButton Content="Nein" OnClick="@AbortDelete" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<DialogButton Content="OK" IsPrimary="true" OnClick="@DialogConfirmed" />
|
||||
}
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
|
||||
|
||||
@code {
|
||||
public void GridClicked()
|
||||
{
|
||||
// OP.RefreshData(SchuelerID);
|
||||
}
|
||||
|
||||
public void GridChanged(string wert)
|
||||
{
|
||||
string s = "";
|
||||
s = wert;
|
||||
}
|
||||
|
||||
BlazorApp.Pages.Shared.OffenePlaetze OP { get; set; }
|
||||
BlazorApp.Pages.Shared.BerufswunschListe BWL { get; set; }
|
||||
|
||||
#region "Deklarationen"
|
||||
public string UID = "";
|
||||
public int[] ExpandItems = new int[] { 2 };
|
||||
public string[] sfSchuelerID { get; set; }
|
||||
public string DialogHeader { get; set; } = "";
|
||||
public string DialogText { get; set; } = "";
|
||||
public bool DialogShowYesNO { get; set; } = true;
|
||||
public string berufhinweis = "";
|
||||
public string klassehinweis = "";
|
||||
public string klassehinweiscolor = "red";
|
||||
|
||||
public bool ShowDeleteConfirmation { get; set; } = false;
|
||||
protected ElementReference ToFocus;
|
||||
public string lehrerID = "";
|
||||
public int hiddenschuelerid = 0;
|
||||
public string KlasseID = "0";
|
||||
public string LehrerID = "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.Lehrer> Lehrer { 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 List<iKlasse> Schuelerklasse = new List<iKlasse>();
|
||||
public int SchuelerID;
|
||||
public List<iKlasse> intKlasse = new List<iKlasse>();
|
||||
public List<iLehrer> intLehrer = new List<iLehrer>();
|
||||
|
||||
public class iKlasse
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string bezeichnung { get; set; }
|
||||
}
|
||||
public class iLehrer
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string bezeichnung { get; set; }
|
||||
}
|
||||
public class Schuelerlist
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string bezeichnung { get; set; }
|
||||
}
|
||||
|
||||
SfGrid<SchuelerBeruf> Grid { get; set; }
|
||||
SfGrid<ZuteilungView> GridZuteilung { get; set; }
|
||||
|
||||
public List<BWPMModels.SchuelerBeruf> GridData { get; set; }
|
||||
public List<BWPMModels.ZuteilungView> GridDataZuteilung { get; set; }
|
||||
public List<BWPMModels.View_Zuteilung> GridDataView_Zutielung { 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;
|
||||
public int BerufID;
|
||||
private Lehrer _lehrer { get; set; } = new BWPMModels.Lehrer();
|
||||
public List<BWPMModels.Lehrer> Lehrerdaten { get; set; }
|
||||
public int ZuteilungID = 0;
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region "Init / AfterRender"
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
lehrerID = await sessionStorage.GetItemAsync<string>("LehrerID");
|
||||
userid = await sessionStorage.GetItemAsync<string>("UserID");
|
||||
UID = userid;
|
||||
Klasse = BlazorApp.Controller.KlasseController.GetAllActiveData();
|
||||
intKlasse.Clear();
|
||||
foreach (BWPMModels.Klasse item in Klasse)
|
||||
{
|
||||
iKlasse kl = new iKlasse();
|
||||
kl.id = item.ID.ToString();
|
||||
kl.bezeichnung = item.bezeichnung;
|
||||
intKlasse.Add(kl);
|
||||
Schuelerklasse.Add(kl);
|
||||
};
|
||||
KlasseID = Klasse[0].ID.ToString();
|
||||
|
||||
SchuelerklasseID = Klasse[0].ID.ToString();
|
||||
KlasseTypID = klassentyp[0].ID.ToString();
|
||||
Lehrer = BlazorApp.Controller.LehrerController.GetAllActiveData();
|
||||
intLehrer.Clear();
|
||||
foreach (BWPMModels.Lehrer item in Lehrer)
|
||||
{
|
||||
iLehrer ll = new iLehrer();
|
||||
ll.id = item.ID.ToString();
|
||||
ll.bezeichnung = item.name.ToString() + " " + item.vorname.ToString();
|
||||
intLehrer.Add(ll);
|
||||
}
|
||||
LehrerID = Lehrer[0].ID.ToString();
|
||||
Update_Schueler_Klasse();
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region "Klasse / Lehrer / Schüler"
|
||||
void OnChange(object value, string name)
|
||||
{
|
||||
KlasseID = value.ToString();
|
||||
Update_Schueler_Klasse();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------
|
||||
//Klassenliste / Schuelerliste
|
||||
//----------------------------------------------------------
|
||||
public void ChangeKlasse(Syncfusion.Blazor.DropDowns.ChangeEventArgs<string, Klasse> args)
|
||||
{
|
||||
Update_Schueler_Klasse();
|
||||
}
|
||||
|
||||
|
||||
public void Update_Schueler_Klasse()
|
||||
{
|
||||
UpdateSchulerliste();
|
||||
pruefung_klasse();
|
||||
}
|
||||
|
||||
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(); }
|
||||
}
|
||||
|
||||
pruefung_klasse();
|
||||
}
|
||||
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.klassentypID.ToString();
|
||||
FieldDisabled = false;
|
||||
DropDownEnabled = true;
|
||||
update_griddata();
|
||||
pruefung();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region "Schülerformular"
|
||||
//----------------------------------------------------------
|
||||
//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.klassentypID = 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.klassentypID = Convert.ToInt32(KlasseTypID);
|
||||
schuelerid = BlazorApp.Controller.SchuelerController.POST(schuelerdata);
|
||||
FieldDisabled = false;
|
||||
DropDownEnabled = true;
|
||||
UpdateSchulerliste();
|
||||
SchuelerID = schuelerid;
|
||||
SchuelerSelected();
|
||||
jsRuntime.InvokeVoidAsync("SetFocusToElement", ToFocus);
|
||||
|
||||
}
|
||||
private void DeleteClick()
|
||||
{
|
||||
DialogHeader = "Löschbestätigung";
|
||||
DialogText = "Schüler '" + _schueler.name + ' ' + _schueler.vorname + "' wirklich löschen?'";
|
||||
DialogShowYesNO = true;
|
||||
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;
|
||||
}
|
||||
private void DialogConfirmed()
|
||||
{
|
||||
ShowDeleteConfirmation = false;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region "Schülerberuf"
|
||||
//--------------------------------------
|
||||
//SchülerBeruf / Beruf
|
||||
//--------------------------------------
|
||||
private void InsertBeruf()
|
||||
{
|
||||
if (SchuelerID == 0)
|
||||
{
|
||||
DialogHeader = "Daten unvollständig";
|
||||
DialogText = "Bitte zuerst einen Schüler auswählen!";
|
||||
DialogShowYesNO = false;
|
||||
ShowDeleteConfirmation = true;
|
||||
return;
|
||||
}
|
||||
if (BerufID == 0)
|
||||
{
|
||||
DialogHeader = "Daten unvollständig";
|
||||
DialogText = "Bitte zuerst einen Beruf auswählen!";
|
||||
DialogShowYesNO = false;
|
||||
ShowDeleteConfirmation = true;
|
||||
return;
|
||||
}
|
||||
ShowDeleteConfirmation = false;
|
||||
BWPMModels.SchuelerBeruf sberuf = new BWPMModels.SchuelerBeruf();
|
||||
sberuf.aktiv = true;
|
||||
sberuf.bemerkung = "";
|
||||
sberuf.berufID = BerufID;
|
||||
sberuf.erstellt_am = DateTime.Now;
|
||||
sberuf.mutiert_am = DateTime.Now;
|
||||
sberuf.mutierer = userid;
|
||||
sberuf.schuelerID = SchuelerID;
|
||||
int prio = BlazorApp.Controller.SchuelerBerufController.Get_Prio(SchuelerID);
|
||||
sberuf.prioritaet = prio + 1;
|
||||
BlazorApp.Controller.SchuelerBerufController.POST(sberuf);
|
||||
update_griddata();
|
||||
pruefung();
|
||||
}
|
||||
|
||||
private void update_griddata()
|
||||
{
|
||||
//GridData = BlazorApp.Controller.SchuelerBerufController.GetBySchuelerID(SchuelerID);
|
||||
GridDataZuteilung = BlazorApp.Controller.ZuteilungController.GetZuteilungBySchuelerID(SchuelerID);
|
||||
//OP.RefreshData(SchuelerID);
|
||||
//BWL.Refreshdata(SchuelerID);
|
||||
}
|
||||
|
||||
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;
|
||||
pruefung();
|
||||
}
|
||||
else
|
||||
{
|
||||
Args.Data.mutierer = userid.ToString();
|
||||
Args.Data.mutiert_am = DateTime.Now;
|
||||
BlazorApp.Controller.SchuelerBerufController.PUT(Args.Data);
|
||||
pruefung();
|
||||
}
|
||||
}
|
||||
if (Args.RequestType == Syncfusion.Blazor.Grids.Action.Delete)
|
||||
{
|
||||
Args.Data.mutierer = userid.ToString();
|
||||
Args.Data.mutiert_am = DateTime.Now;
|
||||
Args.Data.aktiv = false;
|
||||
BlazorApp.Controller.SchuelerBerufController.PUT(Args.Data);
|
||||
pruefung();
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
}
|
||||
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;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ContinuePaging)
|
||||
{
|
||||
if (i >= PageCount)
|
||||
{
|
||||
i = 0;
|
||||
}
|
||||
await Grid.GoToPage(i + 1);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return foundrow;
|
||||
}
|
||||
}
|
||||
return foundrow;
|
||||
}
|
||||
|
||||
public void pruefung()
|
||||
{
|
||||
berufhinweis = "";
|
||||
int Anzahl_Berufe = 0;
|
||||
try
|
||||
{
|
||||
dbhelper dbh = new dbhelper();
|
||||
if (BlazorApp.Controller.SchuelerBerufController.Get_Anzahl(SchuelerID) < Convert.ToInt32(dbh.Get_Option(4)))
|
||||
{
|
||||
berufhinweis += "\r\n- es sollten 3 Berufswünsche ausgewählt werden<br />";
|
||||
}
|
||||
if (BlazorApp.Controller.SchuelerBerufController.Has_Prio1(SchuelerID) == false)
|
||||
{
|
||||
berufhinweis += "\r\n- Es fehlt ein Berufswunsch mit Priorität 1";
|
||||
}
|
||||
}
|
||||
catch { };
|
||||
}
|
||||
|
||||
public void pruefung_klasse()
|
||||
{
|
||||
klassehinweis = "";
|
||||
dbhelper dbh = new dbhelper();
|
||||
dbh.add_sp_param("Param1", KlasseID.ToString());
|
||||
dbh.Get_Tabledata("sp_chk_klasse", true, false);
|
||||
if (dbh.dsdaten.Tables[0].Rows[0][0].ToString() != dbh.dsdaten.Tables[0].Rows[0][1].ToString())
|
||||
{
|
||||
klassehinweis += "\r\n- " + dbh.dsdaten.Tables[0].Rows[0][1].ToString() + " von " + dbh.dsdaten.Tables[0].Rows[0][0].ToString() + " Schüler erfasst";
|
||||
klassehinweiscolor = "red";
|
||||
}
|
||||
else
|
||||
{
|
||||
klassehinweis += "\r\n- " + dbh.dsdaten.Tables[0].Rows[0][1].ToString() + " von " + dbh.dsdaten.Tables[0].Rows[0][0].ToString() + " Schüler erfasst";
|
||||
klassehinweiscolor = "green";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region "Zuteilung"
|
||||
|
||||
public void OnContextMenuClick(ContextMenuClickEventArgs<ZuteilungView> args)
|
||||
{
|
||||
ZuteilungID = args.RowInfo.RowData.ID;
|
||||
if (args.Item.Id == "deleteentry")
|
||||
{
|
||||
BlazorApp.Controller.ZuteilungController.Inaktivate(ZuteilungID, userid);
|
||||
GridDataZuteilung = BlazorApp.Controller.ZuteilungController.GetZuteilungBySchuelerID(SchuelerID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void Berufswunsch_Click(RecordClickEventArgs<SchuelerBeruf> args)
|
||||
{
|
||||
GridDataView_Zutielung = BlazorApp.Controller.ZuteilungController.GetZuteilungen(args.RowData.schuelerID.ToString(), args.RowData.berufID.ToString());
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
58
BlazorApp/Pages/Admin/Student/Zuteilung.razor
Normal file
58
BlazorApp/Pages/Admin/Student/Zuteilung.razor
Normal file
@@ -0,0 +1,58 @@
|
||||
@using Syncfusion.Blazor.Grids;
|
||||
@using BlazorApp.Helper
|
||||
@using BWPMModels;
|
||||
|
||||
<SfGrid ID="Grid66" DataSource="@GridDataZuteilungA" @ref="GridZuteilungA" AllowPaging="false" AllowSorting="true"
|
||||
Toolbar="@(new List<string>() { "Add", "Edit", "Update", "Cancel" })"
|
||||
ContextMenuItems="@(new List<Object>(){ new ContextMenuItemModel { Text = "Löschen", Target = ".e-content", Id = "deleteentry" } })">
|
||||
<GridPageSettings PageCount="5" PageSizes="true"></GridPageSettings>
|
||||
<GridEditSettings AllowAdding="false" AllowDeleting="false" AllowEditing="true" Mode="EditMode.Dialog"></GridEditSettings>
|
||||
<GridEvents ContextMenuItemClicked="OnContextMenuClick" TValue="ZuteilungView"></GridEvents>
|
||||
<GridColumns>
|
||||
<GridColumn Field=@nameof(ZuteilungView.ID) HeaderText="Id" IsPrimaryKey="true" AllowAdding="false" Width="60" Visible="false"> </GridColumn>
|
||||
<GridColumn Field=@nameof(ZuteilungView.schuelerid) HeaderText="Schuelerid" Width="100" Visible="false"></GridColumn>
|
||||
<GridColumn Field=@nameof(ZuteilungView.beruf) HeaderText="Beruf" Width="100" Visible="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ZuteilungView.zeit) HeaderText="Zeite" Width="100" Visible="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ZuteilungView.firma) HeaderText="Firma" Width="100" Visible="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ZuteilungView.prioritaet) HeaderText="Prio." Width="40" Visible="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(ZuteilungView.bemerkung) HeaderText="Bemerkung" Width="100" Visible="true"></GridColumn>
|
||||
</GridColumns>
|
||||
</SfGrid>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public EventCallback<string> OnGridClicked { get; set; }
|
||||
|
||||
|
||||
public int SchuelerID = 0;
|
||||
public string userid = "";
|
||||
public int ZuteilungID = 0;
|
||||
|
||||
SfGrid<ZuteilungView> GridZuteilungA { get; set; }
|
||||
public List<BWPMModels.ZuteilungView> GridDataZuteilungA { get; set; }
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
GridDataZuteilungA = BlazorApp.Controller.ZuteilungController.GetZuteilungBySchuelerID(SchuelerID);
|
||||
}
|
||||
//public void
|
||||
private Task OnContextMenuClick(ContextMenuClickEventArgs<ZuteilungView> args)
|
||||
{
|
||||
ZuteilungID = args.RowInfo.RowData.ID;
|
||||
if (args.Item.Id == "deleteentry")
|
||||
{
|
||||
BlazorApp.Controller.ZuteilungController.Inaktivate(ZuteilungID, userid);
|
||||
GridDataZuteilungA = BlazorApp.Controller.ZuteilungController.GetZuteilungBySchuelerID(SchuelerID);
|
||||
}
|
||||
int s = 0;
|
||||
s = SchuelerID;
|
||||
return OnGridClicked.InvokeAsync(s.ToString());
|
||||
}
|
||||
|
||||
public void ReloadData(int iSchuelerID)
|
||||
{
|
||||
GridDataZuteilungA = BlazorApp.Controller.ZuteilungController.GetZuteilungBySchuelerID(iSchuelerID);
|
||||
GridZuteilungA.Refresh();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,51 +1,88 @@
|
||||
@page "/Admin/Zuteilung/Zuteilung"
|
||||
@inject Blazored.SessionStorage.ISessionStorageService sessionStorage
|
||||
@inherits Admin.ListBase;
|
||||
@using System.ComponentModel.DataAnnotations
|
||||
@using Syncfusion.Blazor.Spinner;
|
||||
@using Syncfusion.Blazor.Navigations;
|
||||
@using Syncfusion.Blazor.Popups;
|
||||
@using Syncfusion.Blazor.DropDowns
|
||||
@using Syncfusion.Blazor.Lists
|
||||
@using Syncfusion.Blazor.Inputs;
|
||||
@using Syncfusion.Blazor.Notifications;
|
||||
@using BlazorApp.Helper
|
||||
@using BWPMModels;
|
||||
|
||||
<div class="col-lg-12 control-section">
|
||||
<div class="content-wrapper">
|
||||
@*<EditForm>*@
|
||||
<div class="card">
|
||||
<h6 class="card-header card-header1">Automatische Berufs-Zuteilung </h6>
|
||||
<div class="card-body">
|
||||
Drücken Sie auf "Zuteilung ausführen" um die automatische Berufszuteilung durchzuführen."<br /><br>
|
||||
<p style="color:red">Achtung! Sämtliche vorhandenen Zuteilungen werden gelöscht.</p>
|
||||
<br />
|
||||
<br />
|
||||
<p><b>Zuteilungsart</b></p>
|
||||
<label>
|
||||
<input type="radio" name="edition" checked="@(Variante == 1)" /> Zuteilung ab Priorität 2 zufällig
|
||||
</label>
|
||||
<br />
|
||||
<label>
|
||||
<input type="radio" name="edition" checked="@(Variante == 2)" /> Berücksichtigung der Prioritäten
|
||||
</label>
|
||||
<br>
|
||||
<br />
|
||||
<input type="submit" class="btn btn-primary" @onclick="zuteilen" value="Zuteilung ausführen" />
|
||||
</div>
|
||||
</div>
|
||||
@*</EditForm>*@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
@code {
|
||||
private int @Variante = 1;
|
||||
void zuteilen()
|
||||
{
|
||||
|
||||
}
|
||||
@page "/Admin/Zuteilung/Zuteilung"
|
||||
@inject Blazored.SessionStorage.ISessionStorageService sessionStorage
|
||||
@inherits Admin.ListBase;
|
||||
@using System.ComponentModel.DataAnnotations
|
||||
@using Syncfusion.Blazor.Spinner;
|
||||
@using Syncfusion.Blazor.Navigations;
|
||||
@using Syncfusion.Blazor.Popups;
|
||||
@using Syncfusion.Blazor.DropDowns
|
||||
@using Syncfusion.Blazor.Lists
|
||||
@using Syncfusion.Blazor.Inputs;
|
||||
@using Syncfusion.Blazor.Notifications;
|
||||
@using BlazorApp.Helper
|
||||
@using BWPMModels;
|
||||
|
||||
<div class="col-lg-12 control-section">
|
||||
<div class="content-wrapper">
|
||||
@*<EditForm>*@
|
||||
<div class="card">
|
||||
<h6 class="card-header card-header1">Automatische Berufs-Zuteilung </h6>
|
||||
<div class="card-body">
|
||||
Drücken Sie auf "Zuteilung ausführen" um die automatische Berufszuteilung durchzuführen."<br /><br>
|
||||
<p style="color:red">Achtung! Sämtliche vorhandenen Zuteilungen werden gelöscht.</p>
|
||||
<br />
|
||||
<br />
|
||||
<p><b>Zuteilungsart</b></p>
|
||||
<label>
|
||||
<input type="radio" name="edition" checked="@(Variante == 1)" /> Zuteilung ab Priorität 2 zufällig
|
||||
</label>
|
||||
<br />
|
||||
<label>
|
||||
<input type="radio" name="edition" checked="@(Variante == 2)" /> Berücksichtigung der Prioritäten
|
||||
</label>
|
||||
<br>
|
||||
<br />
|
||||
<input type="submit" class="btn btn-primary" @onclick="zuteilen" value="Zuteilung ausführen" />
|
||||
</div>
|
||||
</div>
|
||||
@*</EditForm>*@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 control-section toast-default-section">
|
||||
<SfToast ID="toast_default" @ref="ToastObj" Content="@ToastContent" Timeout="5000" Icon="e-meeting">
|
||||
<ToastPosition X="Right" Y="Bottom"></ToastPosition>
|
||||
<ToastAnimationSettings>
|
||||
<ToastShowAnimationSettings Effect="@ShowAnimation"></ToastShowAnimationSettings>
|
||||
<ToastHideAnimationSettings Effect="@HideAnimation"></ToastHideAnimationSettings>
|
||||
</ToastAnimationSettings>
|
||||
</SfToast>
|
||||
</div>
|
||||
<style>
|
||||
.bootstrap4 #toast_default .e-meeting::before {
|
||||
content: "\e763";
|
||||
font-size: 20px;
|
||||
}
|
||||
.e-toast-container .e-toast {
|
||||
background-color: lightgreen;
|
||||
}
|
||||
</style>
|
||||
|
||||
@code {
|
||||
|
||||
SfToast ToastObj;
|
||||
private string ToastPosition = "Right";
|
||||
private string ToastContent = "Zuteilung erfolgreich durchgeführt";
|
||||
private ToastEffect ShowAnimation = ToastEffect.FadeIn;
|
||||
private ToastEffect HideAnimation = ToastEffect.FadeOut;
|
||||
|
||||
private int @Variante = 1;
|
||||
public void zuteilen()
|
||||
{
|
||||
try
|
||||
{
|
||||
dbhelper dbh = new dbhelper();
|
||||
dbh.Zuteilen(@Variante);
|
||||
ToastObj.ShowAsync();
|
||||
}
|
||||
catch
|
||||
{
|
||||
ToastContent = "Bei der automatischen Zuteilung ist ein Fehler aufgetreten.";
|
||||
ToastObj.ShowAsync();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
296
BlazorApp/Pages/Shared/BerufswunschListe.razor
Normal file
296
BlazorApp/Pages/Shared/BerufswunschListe.razor
Normal file
@@ -0,0 +1,296 @@
|
||||
@using Syncfusion.Blazor.Grids;
|
||||
@using BlazorApp.Helper
|
||||
@using BWPMModels;
|
||||
|
||||
@if (@AllowUpdates == true)
|
||||
{
|
||||
<SfGrid ID="Grid3" DataSource="@GridData2" @ref="Grid22" AllowRowDragAndDrop="true" AllowPaging="false" AllowSorting="true" Toolbar="@(new List<string>() { "Edit", "Delete" })"
|
||||
ContextMenuItems="@(new List<ContextMenuItemModel>() { new ContextMenuItemModel { Text = "Bearbeiten", Target = ".e-content", Id = "Edit"},new ContextMenuItemModel { Text = "Löschen", Target = ".e-content", Id = "Loeschen"} })">
|
||||
|
||||
<GridPageSettings PageCount="5" PageSizes="true"></GridPageSettings>
|
||||
<GridEditSettings AllowAdding="@AllowUpdates" AllowDeleting="AllowUpdates" AllowEditing="AllowUpdates" Mode="EditMode.Dialog"></GridEditSettings>
|
||||
<GridEvents RowDropped="RowDropHandler" ContextMenuItemClicked="OnContextMenuClick" 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>
|
||||
|
||||
<GridForeignColumn Field=@nameof(SchuelerBeruf.berufID) HeaderText="Beruf" ForeignKeyField="ID" ForeignKeyValue="bezeichnung" ForeignDataSource="@berufe" Width="150"></GridForeignColumn>
|
||||
|
||||
<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 class="container">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body" style="color:red">@((MarkupString)berufhinweis)</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<SfGrid ID="Grid3" DataSource="@GridData2" @ref="Grid22" AllowRowDragAndDrop="false" AllowPaging="false" AllowSorting="false">
|
||||
<GridPageSettings PageCount="5" PageSizes="true"></GridPageSettings>
|
||||
<GridEditSettings AllowAdding="@AllowUpdates" AllowDeleting="AllowUpdates" AllowEditing="AllowUpdates" ></GridEditSettings>
|
||||
<GridEvents OnActionBegin="OnBeginHandler" OnActionComplete="OnCompletedHandler" TValue="SchuelerBeruf" OnDataBound="RowDataBoundHandler"></GridEvents>
|
||||
<GridEvents OnRecordClick="Berufswunsch_Click" TValue="SchuelerBeruf"></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>
|
||||
|
||||
<GridForeignColumn Field=@nameof(SchuelerBeruf.berufID) HeaderText="Beruf" ForeignKeyField="ID" ForeignKeyValue="bezeichnung" ForeignDataSource="@berufe" Width="150"></GridForeignColumn>
|
||||
|
||||
<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>
|
||||
}
|
||||
@code {
|
||||
[Parameter]
|
||||
public bool AllowUpdates { get; set; } = false;
|
||||
[Parameter]
|
||||
public EventCallback<string> OnGridClicked { get; set; }
|
||||
|
||||
//[Parameter]
|
||||
public int SchuelerID { get; set; }
|
||||
|
||||
|
||||
public string userid = "";
|
||||
|
||||
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;
|
||||
public bool ContinuePaging = true;
|
||||
public string berufhinweis = "";
|
||||
|
||||
SfGrid<SchuelerBeruf> Grid22 { get; set; }
|
||||
public List<BWPMModels.SchuelerBeruf> GridData2 { get; set; }
|
||||
public List<BWPMModels.Beruf> berufe { get; set; } = BlazorApp.Controller.BerufController.GetBerufsangebot();
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Task Berufswunsch_Click(RecordClickEventArgs<SchuelerBeruf> args)
|
||||
{
|
||||
return OnGridClicked.InvokeAsync(args.RowData.berufID.ToString());
|
||||
}
|
||||
|
||||
public void ReloadData(int iSchuelerID)
|
||||
{
|
||||
SchuelerID = iSchuelerID;
|
||||
GridData2 = BlazorApp.Controller.SchuelerBerufController.GetBySchuelerID(iSchuelerID);
|
||||
Grid22.Refresh();
|
||||
|
||||
pruefung();
|
||||
//return Task.CompletedTask;
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
pruefung();
|
||||
}
|
||||
else
|
||||
{
|
||||
Args.Data.mutierer = userid.ToString();
|
||||
Args.Data.mutiert_am = DateTime.Now;
|
||||
BlazorApp.Controller.SchuelerBerufController.PUT(Args.Data);
|
||||
pruefung();
|
||||
}
|
||||
}
|
||||
if (Args.RequestType == Syncfusion.Blazor.Grids.Action.Delete)
|
||||
{
|
||||
Args.Data.mutierer = userid.ToString();
|
||||
Args.Data.mutiert_am = DateTime.Now;
|
||||
Args.Data.aktiv = false;
|
||||
BlazorApp.Controller.SchuelerBerufController.PUT(Args.Data);
|
||||
pruefung();
|
||||
}
|
||||
}
|
||||
|
||||
public void OnContextMenuClick(ContextMenuClickEventArgs<BWPMModels.SchuelerBeruf> args)
|
||||
{
|
||||
switch (args.Item.Id)
|
||||
{
|
||||
case "PrioUp":
|
||||
args.RowInfo.RowData.prioritaet = args.RowInfo.RowData.prioritaet - 1;
|
||||
args.RowInfo.RowData.mutierer = userid.ToString();
|
||||
BlazorApp.Controller.SchuelerBerufController.PUT(args.RowInfo.RowData);
|
||||
update_griddata();
|
||||
pruefung();
|
||||
break;
|
||||
case "PrioDown":
|
||||
args.RowInfo.RowData.prioritaet = args.RowInfo.RowData.prioritaet + 1;
|
||||
args.RowInfo.RowData.mutierer = userid.ToString();
|
||||
BlazorApp.Controller.SchuelerBerufController.PUT(args.RowInfo.RowData);
|
||||
update_griddata();
|
||||
pruefung();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
if (args.Item.Id == "Prio")
|
||||
if (args.Item.Id == "Bearbeiten")
|
||||
{
|
||||
|
||||
}
|
||||
if (args.Item.Id == "Loeschen")
|
||||
{
|
||||
args.RowInfo.RowData.aktiv = false;
|
||||
args.RowInfo.RowData.mutiert_am = DateTime.Now;
|
||||
args.RowInfo.RowData.mutierer = userid.ToString();
|
||||
BlazorApp.Controller.SchuelerBerufController.PUT(args.RowInfo.RowData);
|
||||
update_griddata();
|
||||
pruefung();
|
||||
|
||||
}
|
||||
}
|
||||
public void RowDropHandler(RowDragEventArgs<BWPMModels.SchuelerBeruf> args)
|
||||
{
|
||||
dbhelper dbh = new dbhelper();
|
||||
dbh.add_sp_param("Param1", args.Data[0].ID.ToString());
|
||||
dbh.add_sp_param("Param2", userid.ToString());
|
||||
dbh.add_sp_param("Param3", args.DropIndex.ToString());
|
||||
|
||||
dbh.Get_Tabledata("sp_set_prio_schuelerberuf", true, false);
|
||||
args.Data[0].prioritaet = Convert.ToInt32(args.DropIndex) + 1;
|
||||
update_griddata();
|
||||
pruefung();
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
private void update_griddata()
|
||||
{
|
||||
//GridData.Clear();
|
||||
GridData2 = BlazorApp.Controller.SchuelerBerufController.GetBySchuelerID(SchuelerID);
|
||||
Grid22.Refresh();
|
||||
}
|
||||
|
||||
public async Task OnCompletedHandler(ActionEventArgs<BWPMModels.SchuelerBeruf> Args)
|
||||
{
|
||||
if (Args.RequestType == Syncfusion.Blazor.Grids.Action.Save)
|
||||
{
|
||||
await Grid22.SetRowData(Args.Data.ID, Args.Data);
|
||||
double xx = 0;
|
||||
Value = Args.Data.ID;
|
||||
xx = await DataHandler();
|
||||
await Grid22.SelectRow(xx);
|
||||
}
|
||||
}
|
||||
public async void RowDataBoundHandler(BeforeDataBoundArgs<BWPMModels.SchuelerBeruf> args)
|
||||
{
|
||||
if (!Initial)
|
||||
{
|
||||
}
|
||||
Initial = false;
|
||||
}
|
||||
|
||||
public async Task<double> DataHandler()
|
||||
{
|
||||
var PageCount = (GridData2.Count / Grid22.PageSettings.PageSize) + 1;
|
||||
ContinuePaging = true;
|
||||
var CurrentPage = 1;
|
||||
Grid22.Refresh();
|
||||
await Grid22.GoToPage(1);
|
||||
for (int i = 1; i <= PageCount; i++)
|
||||
{
|
||||
List<SchuelerBeruf> Rows = await Grid22.GetCurrentViewRecords(); // returns the current view data
|
||||
for (int j = 0; j < Grid22.PageSettings.PageSize; j++)
|
||||
{
|
||||
if (j < Rows.Count && Rows[j].ID == Value)
|
||||
{
|
||||
foundrow = j;
|
||||
|
||||
ContinuePaging = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ContinuePaging)
|
||||
{
|
||||
if (i >= PageCount)
|
||||
{
|
||||
i = 0;
|
||||
}
|
||||
await Grid22.GoToPage(i + 1);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return foundrow;
|
||||
}
|
||||
}
|
||||
return foundrow;
|
||||
}
|
||||
|
||||
public void pruefung()
|
||||
{
|
||||
berufhinweis = "";
|
||||
int Anzahl_Berufe = 0;
|
||||
try
|
||||
{
|
||||
dbhelper dbh = new dbhelper();
|
||||
if (BlazorApp.Controller.SchuelerBerufController.Get_Anzahl(SchuelerID) < Convert.ToInt32(dbh.Get_Option(4)))
|
||||
{
|
||||
berufhinweis += "\r\n- es sollten 3 Berufswünsche ausgewählt werden<br />";
|
||||
}
|
||||
if (BlazorApp.Controller.SchuelerBerufController.Has_Prio1(SchuelerID) == false)
|
||||
{
|
||||
berufhinweis += "\r\n- Es fehlt ein Berufswunsch mit Priorität 1";
|
||||
}
|
||||
if (BlazorApp.Controller.SchuelerBerufController.Has_Dublicates(SchuelerID) == true)
|
||||
{
|
||||
berufhinweis += "\r\n- Berufe wurden doppelt ausgewählt";
|
||||
}
|
||||
|
||||
}
|
||||
catch { };
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
74
BlazorApp/Pages/Shared/KlasseList.razor
Normal file
74
BlazorApp/Pages/Shared/KlasseList.razor
Normal file
@@ -0,0 +1,74 @@
|
||||
@using BWPMModels;
|
||||
|
||||
<RadzenDropDown AllowClear="true" TValue="string" @bind-Value=@KlasseID
|
||||
Data=@intKlasse
|
||||
Change=@(args => OnChange(args, "DropDown")) TextProperty="bezeichnung" ValueProperty="id" />
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public EventCallback<string> OnKlasseChanged { get; set; }
|
||||
|
||||
public string KlasseID;
|
||||
public List<iKlasse> intKlasse = new List<iKlasse>();
|
||||
public List<BWPMModels.Klasse> Klasse { get; set; } = BlazorApp.Controller.KlasseController.GetAllActiveData();
|
||||
|
||||
public class iKlasse
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string bezeichnung { get; set; }
|
||||
}
|
||||
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
intKlasse.Clear();
|
||||
foreach (BWPMModels.Klasse item in Klasse)
|
||||
{
|
||||
iKlasse kl = new iKlasse();
|
||||
kl.id = item.ID.ToString();
|
||||
kl.bezeichnung = item.bezeichnung;
|
||||
intKlasse.Add(kl);
|
||||
};
|
||||
KlasseID = Klasse[0].ID.ToString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Task OnChange(object value, string name)
|
||||
{
|
||||
try
|
||||
{
|
||||
KlasseID = value.ToString();
|
||||
return OnKlasseChanged.InvokeAsync(KlasseID);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return OnKlasseChanged.InvokeAsync("0");
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
public string GetKlasseID()
|
||||
{
|
||||
return KlasseID;
|
||||
}
|
||||
|
||||
public void ReloadByLehrer(string LID)
|
||||
{
|
||||
Klasse = BlazorApp.Controller.KlasseController.GetByLehrerID(Convert.ToInt32(LID));
|
||||
intKlasse.Clear();
|
||||
foreach (BWPMModels.Klasse item in Klasse)
|
||||
{
|
||||
iKlasse kl = new iKlasse();
|
||||
kl.id = item.ID.ToString();
|
||||
kl.bezeichnung = item.bezeichnung;
|
||||
intKlasse.Add(kl);
|
||||
};
|
||||
try
|
||||
{
|
||||
KlasseID = Klasse[0].ID.ToString();
|
||||
}
|
||||
catch { KlasseID = "0"; }
|
||||
}
|
||||
|
||||
}
|
||||
55
BlazorApp/Pages/Shared/LehrerList.razor
Normal file
55
BlazorApp/Pages/Shared/LehrerList.razor
Normal file
@@ -0,0 +1,55 @@
|
||||
@using BWPMModels;
|
||||
|
||||
<RadzenDropDown AllowClear="true" TValue="string" @bind-Value=@LehrerID
|
||||
Data=@intLehrer
|
||||
Change=@(args => OnChange(args, "DropDown")) TextProperty="bezeichnung" ValueProperty="id" />
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public EventCallback<string> OnLehrerChanged { get; set; }
|
||||
|
||||
public string LehrerID;
|
||||
public List<iLehrer> intLehrer = new List<iLehrer>();
|
||||
public List<BWPMModels.Lehrer> Lehrer { get; set; } = BlazorApp.Controller.LehrerController.GetAllActiveData();
|
||||
|
||||
public class iLehrer
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string bezeichnung { get; set; }
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
Lehrer = BlazorApp.Controller.LehrerController.GetAllActiveData();
|
||||
intLehrer.Clear();
|
||||
foreach (BWPMModels.Lehrer item in Lehrer)
|
||||
{
|
||||
iLehrer ll = new iLehrer();
|
||||
ll.id = item.ID.ToString();
|
||||
ll.bezeichnung = item.name.ToString() + " " + item.vorname.ToString();
|
||||
intLehrer.Add(ll);
|
||||
}
|
||||
LehrerID = Lehrer[0].ID.ToString();
|
||||
}
|
||||
|
||||
|
||||
public Task OnChange(object value, string name)
|
||||
{
|
||||
try
|
||||
{
|
||||
LehrerID = value.ToString();
|
||||
return OnLehrerChanged.InvokeAsync(LehrerID);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return OnLehrerChanged.InvokeAsync("0");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public string GetLehrerID()
|
||||
{
|
||||
return LehrerID;
|
||||
}
|
||||
|
||||
}
|
||||
48
BlazorApp/Pages/Shared/OffenePlaetze.razor
Normal file
48
BlazorApp/Pages/Shared/OffenePlaetze.razor
Normal file
@@ -0,0 +1,48 @@
|
||||
@using Syncfusion.Blazor.Grids;
|
||||
@using BlazorApp.Helper
|
||||
@using BWPMModels;
|
||||
|
||||
<SfGrid ID="Grid6" DataSource="@GridDataZuteilung" @ref="GridZuteilung" AllowPaging="true" AllowSorting="true"
|
||||
Toolbar="@(new List<string>() { "Add", "Edit", "Update", "Cancel" })"
|
||||
ContextMenuItems="@(new List<Object>(){ new ContextMenuItemModel { Text = "Zuteilen", Target = ".e-content"} })">
|
||||
<GridPageSettings PageCount="5" PageSizes="true"></GridPageSettings>
|
||||
<GridEditSettings AllowAdding="false" AllowDeleting="false" AllowEditing="false" Mode="EditMode.Dialog"></GridEditSettings>
|
||||
<GridEvents ContextMenuItemClicked="OnContextMenuClick" TValue="View_Offene_Plaetze"></GridEvents>
|
||||
<GridColumns>
|
||||
<GridColumn Field=@nameof(View_Offene_Plaetze.ID) HeaderText="Id" IsPrimaryKey="true" AllowAdding="false" Width="60" Visible="false"> </GridColumn>
|
||||
<GridColumn Field=@nameof(View_Offene_Plaetze.nameZ1) HeaderText="Firma" Width="100" Visible="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(View_Offene_Plaetze.zeit) HeaderText="Zeit" Width="100" Visible="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(View_Offene_Plaetze.anzahl) HeaderText="Anzahl" Width="100" Visible="true"></GridColumn>
|
||||
<GridColumn Field=@nameof(View_Offene_Plaetze.typ) HeaderText="Typ" Width="40" Visible="true"></GridColumn>
|
||||
</GridColumns>
|
||||
</SfGrid>
|
||||
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<string> OnGridChanged { get; set; }
|
||||
public int SchuelerID { get; set; }
|
||||
|
||||
SfGrid<View_Offene_Plaetze> GridZuteilung { get; set; }
|
||||
|
||||
public List<BWPMModels.View_Offene_Plaetze> GridDataZuteilung { get; set; }
|
||||
BWPMModels.Zuteilung NeuZuteilung { get; set; }
|
||||
|
||||
private Task OnContextMenuClick(ContextMenuClickEventArgs<View_Offene_Plaetze> args)
|
||||
{
|
||||
|
||||
int s =0;
|
||||
s = SchuelerID;
|
||||
int b = 0;
|
||||
b = GridDataZuteilung[Convert.ToInt32(args.RowInfo.RowIndex)].ID;
|
||||
BlazorApp.Controller.ZuteilungController.insert_zuteilung(s, b);
|
||||
return OnGridChanged.InvokeAsync(s.ToString());
|
||||
}
|
||||
|
||||
public void ReloadData(int IBerufID, int IKlassentypID)
|
||||
{
|
||||
GridDataZuteilung = BlazorApp.Controller.ZuteilungController.GetOffenePlaetze(IBerufID, IKlassentypID);
|
||||
GridZuteilung.Refresh();
|
||||
}
|
||||
}
|
||||
75
BlazorApp/Pages/Shared/SchuelerList.razor
Normal file
75
BlazorApp/Pages/Shared/SchuelerList.razor
Normal file
@@ -0,0 +1,75 @@
|
||||
@using BWPMModels;
|
||||
<RadzenListBox @bind-Value=@SchuelerID
|
||||
Data=@schuelerliste TextProperty="bezeichnung" ValueProperty="id" Style="height:350px"
|
||||
Change=@(args => SchuelerChange(args, "schuelerlist")) />
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public EventCallback<string> OnSchuelerChanged { get; set; }
|
||||
|
||||
public List<BWPMModels.Schueler> Schueler { get; set; }
|
||||
private Schueler _schueler { get; set; } = new BWPMModels.Schueler();
|
||||
public List<Schuelerlist> schuelerliste = new List<Schuelerlist>();
|
||||
public int SchuelerID;
|
||||
public class Schuelerlist
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string bezeichnung { get; set; }
|
||||
}
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public string ReloadData(string KlasseID)
|
||||
{
|
||||
if (KlasseID == "-1")
|
||||
{
|
||||
Schueler = BlazorApp.Controller.SchuelerController.GetAllActiveData();
|
||||
}
|
||||
else{
|
||||
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);
|
||||
|
||||
};
|
||||
SelectFirst();
|
||||
return SchuelerID.ToString();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public Task SchuelerChange(object value, string name)
|
||||
{
|
||||
var str = value is IEnumerable<object> ? string.Join(", ", (IEnumerable<object>)value) : value;
|
||||
return OnSchuelerChanged.InvokeAsync(str.ToString());
|
||||
}
|
||||
|
||||
public string GetSchuelerID()
|
||||
{
|
||||
return SchuelerID.ToString();
|
||||
}
|
||||
|
||||
public void SelectFirst()
|
||||
{
|
||||
try
|
||||
{
|
||||
SchuelerID = schuelerliste[0].id;
|
||||
}
|
||||
catch { SchuelerID = 0; };
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,46 +1,47 @@
|
||||
@page "/"
|
||||
@namespace BlazorApp.Pages
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>BlazorApp</title>
|
||||
<base href="~/" />
|
||||
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
|
||||
<link href="css/site.css" rel="stylesheet" />
|
||||
<link href="css/all.css" rel="stylesheet" />
|
||||
<link href="_content/Syncfusion.Blazor.Themes/bootstrap4.css" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="_content/Radzen.Blazor/css/default-base.css">
|
||||
<link rel="stylesheet" href="_content/Radzen.Blazor/css/default.css">
|
||||
<link href="css/fas/fontawesome.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<script src="_content/Radzen.Blazor/Radzen.Blazor.js"></script>
|
||||
<app>
|
||||
<component type="typeof(App)" render-mode="Server" />
|
||||
@*<component type="typeof(App)" render-mode="ServerPrerendered" />*@
|
||||
|
||||
</app>
|
||||
|
||||
<div id="blazor-error-ui">
|
||||
<environment include="Staging,Production">
|
||||
An error has occurred. This application may no longer respond until reloaded.
|
||||
</environment>
|
||||
<environment include="Development">
|
||||
An unhandled exception has occurred. See browser dev tools for details.
|
||||
</environment>
|
||||
<a href="" class="reload">Reload</a>
|
||||
<a class="dismiss">🗙</a>
|
||||
</div>
|
||||
|
||||
<script src="_framework/blazor.server.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@page "/"
|
||||
@namespace BlazorApp.Pages
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>BlazorApp</title>
|
||||
<base href="~/" />
|
||||
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
|
||||
<link href="css/site.css" rel="stylesheet" />
|
||||
<link href="css/all.css" rel="stylesheet" />
|
||||
<link href="_content/Syncfusion.Blazor.Themes/bootstrap4.css" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="_content/Radzen.Blazor/css/default-base.css">
|
||||
<link rel="stylesheet" href="_content/Radzen.Blazor/css/default.css">
|
||||
<link href="css/fas/fontawesome.css" rel="stylesheet">
|
||||
<script src="_content/Syncfusion.Blazor.Core/scripts/syncfusion-blazor.min.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script src="_content/Radzen.Blazor/Radzen.Blazor.js"></script>
|
||||
<app>
|
||||
<component type="typeof(App)" render-mode="Server" />
|
||||
@*<component type="typeof(App)" render-mode="ServerPrerendered" />*@
|
||||
|
||||
</app>
|
||||
|
||||
<div id="blazor-error-ui">
|
||||
<environment include="Staging,Production">
|
||||
An error has occurred. This application may no longer respond until reloaded.
|
||||
</environment>
|
||||
<environment include="Development">
|
||||
An unhandled exception has occurred. See browser dev tools for details.
|
||||
</environment>
|
||||
<a href="" class="reload">Reload</a>
|
||||
<a class="dismiss">🗙</a>
|
||||
</div>
|
||||
|
||||
<script src="_framework/blazor.server.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
1
BlazorApp/Pages/__forformat.cshtml
Normal file
1
BlazorApp/Pages/__forformat.cshtml
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
16
BlazorApp/Pages/__forformat.cshtml.cs
Normal file
16
BlazorApp/Pages/__forformat.cshtml.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace BlazorApp.Pages
|
||||
{
|
||||
public class __forformatModel : PageModel
|
||||
{
|
||||
public void OnGet()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user