@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
Berufe
Beruf auswählen
Gewählte Berufe
@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 berufe { get; set; } = BlazorApp.Controller.BerufController.GetBerufsangebot();
SfGrid Grid { get; set; }
public List GridData { get; set; }
public string berufhinweis = "";
public bool ContinuePaging = true;
public int foundrow = 0;
public int Value = 0;
public string[] BerufID;
SfListBox Berufsliste { get; set; }
public List berufe = new List();
public List _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)
{ }
}