update nach Schuelererfassung
This commit is contained in:
426
BlazorApp - Kopie (4)/Pages/Company/Berufsangebot.razor
Normal file
426
BlazorApp - Kopie (4)/Pages/Company/Berufsangebot.razor
Normal file
@@ -0,0 +1,426 @@
|
||||
@page "/Company/Berufsangebot"
|
||||
@inject Blazored.SessionStorage.ISessionStorageService sessionStorage
|
||||
@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 Syncfusion.Blazor.Lists
|
||||
@using Syncfusion.Blazor.Inputs;
|
||||
@using BlazorApp.Helper
|
||||
@using BWPMModels;
|
||||
|
||||
<h3>Berufsangebot</h3> (Bitte erfassen Sie Ihr Berufsangebot)
|
||||
<hr />
|
||||
<p></p>
|
||||
<div class="control-section e-tab-section">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm">
|
||||
<h4>Berufe</h4>
|
||||
<SfListBox @bind-Value=@BerufID TValue="string[]" DataSource="@berufe" @ref="Berufsliste" TItem="Beruf" Height="200px">
|
||||
<ListBoxSelectionSettings Mode="Syncfusion.Blazor.DropDowns.SelectionMode.Single" ShowCheckbox="false"></ListBoxSelectionSettings>
|
||||
<ListBoxFieldSettings Text="bezeichnung" Value="id" />
|
||||
</SfListBox>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<h4>Ansprechperson</h4>
|
||||
|
||||
<SfListBox @bind-Value=@AnsprechpartnerID TValue="string[]" DataSource="@lap" TItem="AP" Height="200px">
|
||||
<ListBoxFieldSettings Text="name" Value="ID" />
|
||||
</SfListBox>
|
||||
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<h4>Zeiten</h4>
|
||||
<SfListBox @bind-Value=@ZeitID TValue="string[]" DataSource="@zeiten" TItem="Zeit" Height="200px">
|
||||
<ListBoxSelectionSettings Mode="Syncfusion.Blazor.DropDowns.SelectionMode.Single" ShowCheckbox="false"></ListBoxSelectionSettings>
|
||||
<ListBoxFieldSettings Text="bezeichnung" Value="id" />
|
||||
</SfListBox>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<h4>Plätze</h4>
|
||||
<label>Max. Anzahl Plätze</label>
|
||||
<SfDropDownList @bind-Value=@PlatzID TValue="string" TItem="Plaetze" Placeholder="Max. Anzahl Plätze" DataSource="@plaetze">
|
||||
<DropDownListFieldSettings Value="id" Text="text"></DropDownListFieldSettings>
|
||||
</SfDropDownList>
|
||||
<label>Klassentyp</label>
|
||||
<SfDropDownList @bind-Value=@KlassenTypID TValue="string" TItem="Klassentyp" Placeholder="Klassentyp" DataSource="@klassentyp">
|
||||
<DropDownListFieldSettings Value="ID" Text="bezeichnung"></DropDownListFieldSettings>
|
||||
</SfDropDownList>
|
||||
<p></p>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<hr />
|
||||
<p></p>
|
||||
|
||||
</div>
|
||||
<div class="control-section e-tab-section">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm">
|
||||
<h4>Bemerkung</h4>
|
||||
<SfTextBox Multiline=true Placeholder="Allgemeine Bemerkung" @bind-Value="@bemerkung"> </SfTextBox>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<h4>Hinweis für den Schüler</h4>
|
||||
<SfTextBox Multiline=true Placeholder="Hinweise für Schüler" @bind-Value="@schuelerbemerkung"> </SfTextBox>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<h4>Hinweis zum Standortler</h4>
|
||||
<SfTextBox Multiline=true Placeholder="Hinweise bezüglich Standort" @bind-Value="@standortbemerkung"> </SfTextBox>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p></p>
|
||||
<div class="control-section e-tab-section">
|
||||
<div class="content-wrapper">
|
||||
<div class="row">
|
||||
<SfButton @onclick="einfuegen" CssClass="e-flat" IsPrimary="true">Einfügen</SfButton>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<h3>Ihr Angebot</h3>
|
||||
<div class="col-lg-12 control-section">
|
||||
|
||||
<div class="content-wrapper">
|
||||
<div class="row">
|
||||
<SfGrid DataSource="@GridData" @ref="Grid" AllowPaging="true" AllowSorting="true" Toolbar="@(new List<string>() { "Edit", "Delete" })">
|
||||
<GridPageSettings PageCount="5" PageSizes="true"></GridPageSettings>
|
||||
<GridEditSettings AllowAdding="true" AllowDeleting="true" AllowEditing="true" Mode="EditMode.Dialog"></GridEditSettings>
|
||||
<GridEvents OnActionBegin="OnBeginHandler" OnActionComplete="OnCompletedHandler" TValue="BWPMModels.Firmaberuf" OnDataBound="RowDataBoundHandler"></GridEvents>
|
||||
<GridSelectionSettings Type="Syncfusion.Blazor.Grids.SelectionType.Single"></GridSelectionSettings>
|
||||
<GridColumns>
|
||||
<GridColumn Type="ColumnType.CheckBox" AllowFiltering="false" AllowSorting="false" Width="60"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Firmaberuf.ID) HeaderText="Id" IsPrimaryKey="true" AllowAdding="false" Visible="false" Width="60"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Firmaberuf.firmaID) HeaderText="Firmaid" Width="100" Visible="false"></GridColumn>
|
||||
|
||||
@* <GridColumn Field=@nameof(Firmaberuf.berufID) HeaderText="Berufid" Width="100" Visible="true"></GridColumn>*@
|
||||
<GridForeignColumn Field=@nameof(Firmaberuf.berufID) HeaderText="Beruf" ForeignKeyField="id" ForeignKeyValue="bezeichnung" ForeignDataSource="@berufe" Width="150"></GridForeignColumn>
|
||||
|
||||
@* <GridColumn Field=@nameof(Firmaberuf.ansprechpartnerID) HeaderText="Ansprechpartnerid" Width="100" Visible="true"></GridColumn>*@
|
||||
<GridForeignColumn Field=@nameof(Firmaberuf.ansprechpartnerID) HeaderText="Ansprechpartner" ForeignKeyField="ID" ForeignKeyValue="name" ForeignDataSource="@lap" Width="150"></GridForeignColumn>
|
||||
|
||||
@* <GridColumn Field=@nameof(Firmaberuf.zeitID) HeaderText="Zeitid" Width="100" Visible="true"></GridColumn>*@
|
||||
<GridForeignColumn Field=@nameof(Firmaberuf.zeitID) HeaderText="Zeit" ForeignKeyField="id" ForeignKeyValue="bezeichnung" ForeignDataSource="@zeiten" Width="150"></GridForeignColumn>
|
||||
|
||||
@* <GridColumn Field=@nameof(Firmaberuf.klassetypID) HeaderText="Klassetypid" Width="100" Visible="true"></GridColumn>*@
|
||||
<GridForeignColumn Field=@nameof(Firmaberuf.klassetypID) HeaderText="Klassentyp" ForeignKeyField="ID" ForeignKeyValue="bezeichnung" ForeignDataSource="@klassentyp" Width="150"></GridForeignColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Firmaberuf.anzahl) HeaderText="Anzahl" Width="100" Visible="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Firmaberuf.bemerkung) HeaderText="Bemerkung" Width="100" Visible="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Firmaberuf.schuelerbemerkung) HeaderText="Schuelerbemerkung" Width="100" Visible="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Firmaberuf.standortbemerkung) HeaderText="Standortbemerkung" Width="100" Visible="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Firmaberuf.minzuteilung) HeaderText="Minzuteilung" Width="100" Visible="false"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Firmaberuf.aktiv) HeaderText="Aktiv" Width="100" Visible="false" DisplayAsCheckBox="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Firmaberuf.erstellt_am) HeaderText="Erstellt_am" Width="100" Visible="false" Format="d" Type="ColumnType.Date"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Firmaberuf.mutiert_am) HeaderText="Mutiert_am" Width="100" Visible="false" Format="d" Type="ColumnType.Date"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Firmaberuf.mutierer) HeaderText="Mutierer" Width="100" Visible="false"></GridColumn>
|
||||
</GridColumns>
|
||||
</SfGrid>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<SfTextBox Value="@fid"></SfTextBox>
|
||||
|
||||
<SfDialog Width="350px" IsModal="true" @bind-Visible="@ShowDialog">
|
||||
<DialogTemplates>
|
||||
<Header> Angaben sind unvollständig </Header>
|
||||
<Content>@((MarkupString)this.message)</Content>
|
||||
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
<DialogButton Content="OK" IsPrimary="true" OnClick="@CloseDialog" />
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
@code {
|
||||
public string fid { get; set; } = "";
|
||||
public string[] BerufID;
|
||||
public string[] AnsprechpartnerID;
|
||||
public string[] ZeitID;
|
||||
public string PlatzID = "1";
|
||||
public string KlassenTypID = "1";
|
||||
public string bemerkung { get; set; } = "";
|
||||
public string schuelerbemerkung { get; set; } = "";
|
||||
public string standortbemerkung { get; set; } = "";
|
||||
public bool ShowDialog = false;
|
||||
string message = "";
|
||||
SfListBox<string[], Beruf> Berufsliste { get; set; }
|
||||
SfGrid<BWPMModels.Firmaberuf> Grid { get; set; }
|
||||
string userid = "";
|
||||
static string firmaid = "";
|
||||
|
||||
public List<Beruf> berufe = new List<Beruf>();
|
||||
public List<BWPMModels.Beruf> _berufe { get; set; } = BlazorApp.Controller.BerufController.GetAllAktiveData();
|
||||
public List<Zeit> zeiten = new List<Zeit>();
|
||||
|
||||
public List<BWPMModels.Zeiten> _zeiten { get; set; } = BlazorApp.Controller.ZeitenController.GetAllAktiveData();
|
||||
public List<BWPMModels.Ansprechpartner> ansprechpartner { get; set; }
|
||||
public List<BWPMModels.Klassentyp> klassentyp { get; set; } = BlazorApp.Controller.KlassentypController.GetAllAktiveData();
|
||||
public List<BWPMModels.Firma> Firmendaten { get; set; }
|
||||
public List<AP> lap = new List<AP>();
|
||||
public List<Plaetze> plaetze = new List<Plaetze>();
|
||||
public List<BWPMModels.Firmaberuf> 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;
|
||||
|
||||
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);
|
||||
}
|
||||
foreach (BWPMModels.Zeiten item in _zeiten)
|
||||
{
|
||||
Zeit ze = new Zeit();
|
||||
ze.id = item.ID;
|
||||
ze.bezeichnung = item.bezeichnung;
|
||||
zeiten.Add(ze);
|
||||
}
|
||||
|
||||
firmaid = await sessionStorage.GetItemAsync<string>("FirmaID");
|
||||
get_ansprechaprtner(firmaid);
|
||||
}
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender != true) { return; };
|
||||
userid = await sessionStorage.GetItemAsync<string>("UserID");
|
||||
if (userid == null)
|
||||
{
|
||||
var authState = await authenticationStateTask;
|
||||
userid = authState.User.Claims.FirstOrDefault().Value;
|
||||
var user = authState.User;
|
||||
|
||||
}
|
||||
firmaid = await sessionStorage.GetItemAsync<string>("FirmaID");
|
||||
if (firmaid == null)
|
||||
{
|
||||
Firmendaten = BlazorApp.Controller.FirmaController.GetByUserID(userid);
|
||||
firmaid = Firmendaten.First<BWPMModels.Firma>().ID.ToString();
|
||||
}
|
||||
try
|
||||
{
|
||||
GridData = BlazorApp.Controller.FirmaberufController.GetAllAktiveByFirmaID(Convert.ToInt32(firmaid));
|
||||
|
||||
get_ansprechaprtner(firmaid);
|
||||
|
||||
}
|
||||
catch { };
|
||||
await Task.Delay(200);
|
||||
try
|
||||
{
|
||||
await sessionStorage.SetItemAsync("FirmaID", firmaid);
|
||||
await sessionStorage.SetItemAsync("UserID", userid);
|
||||
|
||||
}
|
||||
catch { }
|
||||
for (int i = 1; i < 51; i++)
|
||||
{
|
||||
plaetze.Add(new Plaetze { id = i, text = i.ToString() });
|
||||
}
|
||||
PlatzID = "1";
|
||||
KlassenTypID = "1";
|
||||
}
|
||||
|
||||
private void get_ansprechaprtner(string firmaid)
|
||||
{
|
||||
if (firmaid=="") {return;};
|
||||
lap.Clear();
|
||||
ansprechpartner = BlazorApp.Controller.AnsprechpartnerController.GetAllAktivDataByFirmaID(Convert.ToInt32(firmaid));
|
||||
foreach (Ansprechpartner item in ansprechpartner)
|
||||
{
|
||||
AP a1 = new AP();
|
||||
a1.ID = item.ID;
|
||||
a1.name = item.name;
|
||||
lap.Add(a1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public class AP
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public string name { get; set; }
|
||||
}
|
||||
|
||||
public class Plaetze
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string text { get; set; }
|
||||
}
|
||||
|
||||
public class Beruf
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string bezeichnung { get; set; }
|
||||
}
|
||||
|
||||
public class Zeit
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string bezeichnung { get; set; }
|
||||
}
|
||||
|
||||
private void CloseDialog()
|
||||
{
|
||||
this.ShowDialog = false;
|
||||
}
|
||||
|
||||
public void einfuegen()
|
||||
{
|
||||
message = "";
|
||||
int bid = 0;
|
||||
int aid = 0;
|
||||
int zid = 0;
|
||||
int pid = 0;
|
||||
int kid = 0;
|
||||
|
||||
try { bid = Convert.ToInt32(BerufID[0]); } catch { };
|
||||
try { aid = Convert.ToInt32(AnsprechpartnerID[0]); } catch { };
|
||||
try { zid = Convert.ToInt32(ZeitID[0]); } catch { };
|
||||
try { pid = Convert.ToInt32(PlatzID); } catch { };
|
||||
try { kid = Convert.ToInt32(KlassenTypID); } catch { };
|
||||
|
||||
if (bid == 0) { message += "- Bitte einen Beruf auswählen<br/>"; };
|
||||
if (aid == 0) { message += "- Bitte einen Ansprechpartner auswählen<br/>"; };
|
||||
if (zid == 0) { message += "- Bitte einen Zeit auswählen<br/>"; };
|
||||
if (pid == 0) { message += "- Bitte Anzahl Plätze auswählen<br/>"; };
|
||||
if (kid == 0) { message += "- Bitte Klassentyp auswählen<br/>"; };
|
||||
if (message != "")
|
||||
{
|
||||
this.ShowDialog = true;
|
||||
return;
|
||||
}
|
||||
|
||||
BWPMModels.Firmaberuf fb = new BWPMModels.Firmaberuf();
|
||||
fb.firmaID = Convert.ToInt32(firmaid);
|
||||
fb.berufID = bid;
|
||||
fb.ansprechpartnerID = aid;
|
||||
fb.zeitID = zid;
|
||||
fb.anzahl = pid;
|
||||
fb.klassetypID = kid;
|
||||
fb.erstellt_am = DateTime.Now;
|
||||
fb.mutiert_am = DateTime.Now;
|
||||
fb.aktiv = true;
|
||||
fb.mutierer = userid;
|
||||
fb.bemerkung = bemerkung;
|
||||
fb.schuelerbemerkung = schuelerbemerkung;
|
||||
fb.standortbemerkung = standortbemerkung;
|
||||
BlazorApp.Controller.FirmaberufController.POST(fb);
|
||||
GridData = BlazorApp.Controller.FirmaberufController.GetAllAktiveByFirmaID(Convert.ToInt32(firmaid));
|
||||
Grid.Refresh();
|
||||
|
||||
}
|
||||
private async Task OnBeginHandler(ActionEventArgs<BWPMModels.Firmaberuf> 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.FirmaberufController.POST(Args.Data);
|
||||
Value = Args.Data.ID;
|
||||
}
|
||||
else
|
||||
{
|
||||
Args.Data.mutierer = userid.ToString();
|
||||
Args.Data.mutiert_am = DateTime.Now;
|
||||
BlazorApp.Controller.FirmaberufController.PUT(Args.Data);
|
||||
}
|
||||
}
|
||||
if (Args.RequestType == Syncfusion.Blazor.Grids.Action.Delete)
|
||||
{
|
||||
Args.Data.aktiv = false;
|
||||
Args.Data.mutierer = userid;
|
||||
Args.Data.mutiert_am = DateTime.Now;
|
||||
BlazorApp.Controller.FirmaberufController.PUT(Args.Data);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task OnCompletedHandler(ActionEventArgs<BWPMModels.Firmaberuf> 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.Firmaberuf> args)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
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<Firmaberuf> Rows = await Grid.GetCurrentViewRecords(); // returns the current view data
|
||||
for (int j = 0; j < Grid.PageSettings.PageSize; j++)
|
||||
{
|
||||
if (j < Rows.Count && Rows[j].ID == Value)
|
||||
{
|
||||
foundrow = j;
|
||||
|
||||
ContinuePaging = false; // prevent the default navigation
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ContinuePaging)
|
||||
{
|
||||
if (i >= PageCount)
|
||||
{
|
||||
i = 0;
|
||||
}
|
||||
await Grid.GoToPage(i + 1);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return foundrow;
|
||||
}
|
||||
}
|
||||
return foundrow;
|
||||
}
|
||||
|
||||
}
|
||||
275
BlazorApp - Kopie (4)/Pages/Company/Company.razor
Normal file
275
BlazorApp - Kopie (4)/Pages/Company/Company.razor
Normal file
@@ -0,0 +1,275 @@
|
||||
@page "/Company/Company"
|
||||
@inject Blazored.SessionStorage.ISessionStorageService sessionStorage
|
||||
@inherits Admin.ListBase;
|
||||
@using System.ComponentModel.DataAnnotations
|
||||
@using Syncfusion.Blazor.Grids;
|
||||
@using Syncfusion.Blazor.Buttons;
|
||||
@using Syncfusion.Blazor.Spinner;
|
||||
@using Syncfusion.Blazor.Navigations;
|
||||
@using Syncfusion.Blazor.Popups;
|
||||
@using BlazorApp.Helper
|
||||
@using BWPMModels;
|
||||
|
||||
@*<div class="container">*@
|
||||
|
||||
|
||||
<div class="control-section e-tab-section">
|
||||
|
||||
<EditForm Model="_firma" OnValidSubmit="@Submit" OnInvalidSubmit="@InvalidSubmit">
|
||||
<div class="card">
|
||||
|
||||
<div class="card-body">
|
||||
<SfButton IsPrimary="true" OnClick="@(() => SaveClick())">Speichern</SfButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<DataAnnotationsValidator />
|
||||
<SfTab ID="BlazorTab" Height="390">
|
||||
<TabItems>
|
||||
<TabItem>
|
||||
<ChildContent>
|
||||
<TabHeader Text="Kontakt-Daten"></TabHeader>
|
||||
</ChildContent>
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Adress-Daten</h5>
|
||||
<form>
|
||||
<div class="form-group row">
|
||||
<label for="nameZ1" class="col-2 col-form-label">Name</label>
|
||||
<div class="col-10">
|
||||
<InputText id="namez1" class="form-control" @bind-Value="_firma.nameZ1" placeholder="Firmenname" />
|
||||
<ValidationMessage For="@(() => _firma.nameZ1)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="nameZ2" class="col-2 col-form-label">Zusatz</label>
|
||||
<div class="col-10">
|
||||
<InputText id="nameZ2" class="form-control" @bind-Value="@_firma.nameZ2" placeholder="Zusatz" />
|
||||
<ValidationMessage For="@(() => _firma.nameZ2)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="strasse" class="col-2 col-form-label">Strasse</label>
|
||||
<div class="col-10">
|
||||
<InputText id="strasse" class="form-control" @bind-Value="@_firma.strasse" placeholder="Strasse" />
|
||||
<ValidationMessage For="@(() => _firma.strasse)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="plz" class="col-2 col-form-label">PLZ</label>
|
||||
<div class="col-10">
|
||||
<InputText id="plz" class="form-control" @bind-Value="@_firma.plz" placeholder="Postleitzahl" />
|
||||
<ValidationMessage For="@(() => _firma.plz)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="ort" class="col-2 col-form-label">Ort</label>
|
||||
<div class="col-10">
|
||||
<InputText id="ort" class="form-control" @bind-Value="@_firma.ort" placeholder="Ort" />
|
||||
<ValidationMessage For="@(() => _firma.ort)" />
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="form-group row">
|
||||
<label for="telefon" class="col-2 col-form-label">Telefon</label>
|
||||
<div class="col-10">
|
||||
<InputText id="tel" class="form-control" @bind-Value="@_firma.tel" placeholder="Telefon-Nummer" />
|
||||
<ValidationMessage For="@(() => _firma.tel)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="email" class="col-2 col-form-label">E-Mail</label>
|
||||
<div class="col-10">
|
||||
<InputText id="mail" class="form-control" @bind-Value="@_firma.mail" placeholder="E-Mail" required="required" typeof="email" />
|
||||
<ValidationMessage For="@(() => _firma.mail)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="web" class="col-2 col-form-label">Internet</label>
|
||||
<div class="col-10">
|
||||
<InputText id="internet" class="form-control" @bind-Value="@_firma.web" placeholder="Internet" />
|
||||
<ValidationMessage For="@(() => _firma.web)" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="Bemerkungen" class="col-2 col-form-label">Bemerkung</label>
|
||||
<div class="col-10">
|
||||
<InputTextArea id="bemerkung" class="form-control" @bind-Value="@_firma.bemerkung" placeholder="Bemerkung" />
|
||||
<ValidationMessage For="@(() => _firma.bemerkung)" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Ansprechperson</h5>
|
||||
<form>
|
||||
<div class="form-group row">
|
||||
<label for="Anrede" class="col-2 col-form-label">Anrede</label>
|
||||
<div class="col-10">
|
||||
<select id="Anrede" name="Anrede" class="form-control" @bind="@_firma.anrede">
|
||||
<option value="1">Herr</option>
|
||||
<option value="2">Frau</option>
|
||||
<option value="3">Damen und Herren</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="ansprechperson_anme" class="col-2 col-form-label">Name</label>
|
||||
<div class="col-10">
|
||||
<InputText id="ansprechperson_name" class="form-control" @bind-Value="@_firma.ansprechperson_name" placeholder="Name Ansprechperson" />
|
||||
<ValidationMessage For="@(() => _firma.ansprechperson_name)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="ansprechperson_vorname" class="col-2 col-form-label">Vorname</label>
|
||||
<div class="col-10">
|
||||
<InputText id="ansprechperson_vorname" class="form-control" @bind-Value="@_firma.ansprechperon_vorname" placeholder="Vorname Ansprechperson" />
|
||||
<ValidationMessage For="@(() => _firma.ansprechperon_vorname)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="briefanrede" class="col-2 col-form-label">Briefanrede</label>
|
||||
<div class="col-10">
|
||||
<InputText id="briefanrede" class="form-control" @bind-Value="@_firma.briefanrede" placeholder="gewünschte Briefanrede" />
|
||||
<ValidationMessage For="@(() => _firma.briefanrede)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="handy" class="col-2 col-form-label">Telefon</label>
|
||||
<div class="col-10">
|
||||
<InputText id="handy" class="form-control" @bind-Value="@_firma.handy" placeholder="Telefon" />
|
||||
<ValidationMessage For="@(() => _firma.handy)" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
|
||||
</TabItem>
|
||||
<TabItem>
|
||||
<ChildContent>
|
||||
<TabHeader text="Angaben zur Ausbildung"></TabHeader>
|
||||
</ChildContent>
|
||||
<ContentTemplate>
|
||||
<div class="col-md-10">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Allgemeine Angaben</h5>
|
||||
<form>
|
||||
<div class="form-group row">
|
||||
<label for="ausbildung_Standort" class="col-2 col-form-label">Ausbildungsstandort</label>
|
||||
<div class="col-10">
|
||||
<InputTextArea id="ausbildung_Standort" class="form-control" @bind-Value="@_firma.ausbildungsstandort" placeholder="Allgmeine Angaben über Ausbildungsstandort" />
|
||||
<ValidationMessage For="@(() => _firma.ausbildungsstandort)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="ausbildung_bemerkung" class="col-2 col-form-label">Bemerkung</label>
|
||||
<div class="col-10">
|
||||
<InputTextArea id="ausbildung_bemerkung" class="form-control" @bind-Value="@_firma.ausbildungsbemerkung" placeholder="Allgemeine Bemerkungen zu den Ausbildungen" />
|
||||
<ValidationMessage For="@(() => _firma.ausbildungsbemerkung)" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</TabItem>
|
||||
</TabItems>
|
||||
</SfTab>
|
||||
|
||||
|
||||
</EditForm>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<SfDialog Width="250px" IsModal="true" @bind-Visible="@ShowErrorDialog">
|
||||
<DialogTemplates>
|
||||
<Header> Formmular unvollständig </Header>
|
||||
<Content> Bitte das Formular vollständig ausfüllen. </Content>
|
||||
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
<DialogButton Content="OK" IsPrimary="true" OnClick="@CloseDialog" />
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
|
||||
@*</div>*@
|
||||
@code {
|
||||
private Firma _firma { get; set; } = new BWPMModels.Firma();
|
||||
public List<BWPMModels.Firma> Firmendaten { get; set; }
|
||||
string userid = "";
|
||||
public static int? pkey { get; set; }
|
||||
public bool Initial { get; set; } = true;
|
||||
private bool ShowErrorDialog { get; set; } = false;
|
||||
|
||||
public void Submit()
|
||||
{
|
||||
BlazorApp.Controller.FirmaController.PUT(_firma);
|
||||
}
|
||||
public void InvalidSubmit()
|
||||
{
|
||||
ShowErrorDialog = true;
|
||||
}
|
||||
private void CloseDialog()
|
||||
{
|
||||
this.ShowErrorDialog = false;
|
||||
}
|
||||
|
||||
private void SaveClick()
|
||||
{
|
||||
//BlazorApp.Controller.FirmaController.savedata(_firma);
|
||||
}
|
||||
|
||||
protected override async void OnInitialized()
|
||||
{
|
||||
|
||||
}
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
@*userid = "4c456017-85b9-4f34-a42c-f3ac534cc34f";*@
|
||||
|
||||
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);
|
||||
userid = userId;
|
||||
}
|
||||
else
|
||||
{
|
||||
await sessionStorage.SetItemAsync("UserID", userId);
|
||||
userid = userId;
|
||||
}
|
||||
}
|
||||
if (firstRender)
|
||||
{
|
||||
Firmendaten = BlazorApp.Controller.FirmaController.GetByUserID(userid);
|
||||
_firma = Firmendaten.First<BWPMModels.Firma>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
212
BlazorApp - Kopie (4)/Pages/Company/CompanyContact.razor
Normal file
212
BlazorApp - Kopie (4)/Pages/Company/CompanyContact.razor
Normal file
@@ -0,0 +1,212 @@
|
||||
@page "/Company/CompanyContact"
|
||||
@inject Blazored.SessionStorage.ISessionStorageService sessionStorage
|
||||
@inherits Admin.ListBase
|
||||
@using Syncfusion.Blazor.Grids;
|
||||
@using Syncfusion.Blazor.Buttons;
|
||||
@using Syncfusion.Blazor.Spinner;
|
||||
@using Syncfusion.Blazor.Popups;
|
||||
@using BlazorApp.Helper
|
||||
@using BWPMModels;
|
||||
|
||||
@using BlazorApp.Controller;
|
||||
|
||||
|
||||
<h1>Ansprechpartner</h1>
|
||||
|
||||
|
||||
<div class="col-lg-12 control-section">
|
||||
<div class="content-wrapper">
|
||||
<div class="row">
|
||||
<SfGrid DataSource="@GridData" @ref="Grid" AllowPaging="true" AllowSorting="true" Toolbar="@(new List<string>() { "Add", "Edit", "Update", "Cancel" })">
|
||||
<GridPageSettings PageCount="5" PageSizes="true"></GridPageSettings>
|
||||
<GridEditSettings AllowAdding="true" AllowDeleting="false" AllowEditing="true" Mode="EditMode.Dialog"></GridEditSettings>
|
||||
<GridEvents OnActionBegin="OnBeginHandler" OnActionComplete="OnCompletedHandler" TValue="Ansprechpartner" OnDataBound="RowDataBoundHandler"></GridEvents>
|
||||
<GridColumns>
|
||||
<GridColumn Type="ColumnType.CheckBox" AllowFiltering="false" AllowSorting="false" Width="60"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Ansprechpartner.ID) HeaderText="Id" IsPrimaryKey="true" AllowAdding="false" Width="60"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Ansprechpartner.FirmaID) HeaderText="Firmaid" Width="100" Visible="false"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Ansprechpartner.name) HeaderText="Name" Width="100" Visible="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Ansprechpartner.vorname) HeaderText="Vorname" Width="100" Visible="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Ansprechpartner.anrede) HeaderText="Anrede" Width="100" Visible="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Ansprechpartner.tel) HeaderText="Tel" Width="100" Visible="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Ansprechpartner.email) HeaderText="Email" Width="100" Visible="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Ansprechpartner.aktiv) HeaderText="Aktiv" Width="100" Visible="true" DisplayAsCheckBox="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Ansprechpartner.erstellt_am) HeaderText="Erstellt_am" Width="100" Visible="false" Format="d" Type="ColumnType.Date"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Ansprechpartner.mutiert_am) HeaderText="Mutiert_am" Width="100" Visible="false" Format="d" Type="ColumnType.Date"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Ansprechpartner.mutierer) HeaderText="Mutierer" Width="100" Visible="false"></GridColumn>
|
||||
</GridColumns>
|
||||
</SfGrid>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<SfDialog Width="250px" IsModal="true" @bind-Visible="@ShowDialog">
|
||||
<DialogTemplates>
|
||||
<Header> Formmular unvollständig </Header>
|
||||
<Content> Bitte das Formular vollständig ausfüllen. </Content>
|
||||
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
<DialogButton Content="OK" IsPrimary="true" OnClick="@CloseDialog" />
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
@code{
|
||||
SfGrid<Ansprechpartner> Grid { get; set; }
|
||||
public List<BWPMModels.Ansprechpartner> GridData { get; set; }
|
||||
public List<BWPMModels.Ansprechpartner> Ansprechpartners { get; set; }
|
||||
string userid = "";
|
||||
public static int? pkey { get; set; }
|
||||
public bool Initial { get; set; } = true;
|
||||
|
||||
public bool ContinuePaging = true;
|
||||
public bool InitialRender { get; set; }
|
||||
public int Value = 0; // consider that value your querystring contains
|
||||
public int foundrow = 0;
|
||||
|
||||
private Firma _firma { get; set; } = new BWPMModels.Firma();
|
||||
public List<BWPMModels.Firma> Firmendaten { get; set; }
|
||||
private bool ShowDialog { get; set; } = false;
|
||||
|
||||
private void CloseDialog()
|
||||
{
|
||||
this.ShowDialog = false;
|
||||
}
|
||||
|
||||
protected override async void OnInitialized()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
|
||||
@*userid = "4c456017-85b9-4f34-a42c-f3ac534cc34f";*@
|
||||
|
||||
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);
|
||||
userid = userId;
|
||||
}
|
||||
else
|
||||
{
|
||||
await sessionStorage.SetItemAsync("UserID", userId);
|
||||
userid = userId;
|
||||
}
|
||||
}
|
||||
|
||||
Firmendaten = BlazorApp.Controller.FirmaController.GetByUserID(userid);
|
||||
_firma = Firmendaten.First<BWPMModels.Firma>();
|
||||
if (_firma.nameZ1==""){
|
||||
ShowDialog = true;
|
||||
return;
|
||||
}
|
||||
GridData = BlazorApp.Controller.AnsprechpartnerController.GetByFirmaID(_firma.ID);
|
||||
|
||||
}
|
||||
private async Task OnBeginHandler(ActionEventArgs<BWPMModels.Ansprechpartner> 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.FirmaID = _firma.ID;
|
||||
Args.Data.ID = BlazorApp.Controller.AnsprechpartnerController.POST(Args.Data);
|
||||
Value = Args.Data.ID;
|
||||
}
|
||||
else
|
||||
{
|
||||
Args.Data.mutierer = userid.ToString();
|
||||
Args.Data.mutiert_am = DateTime.Now;
|
||||
BlazorApp.Controller.AnsprechpartnerController.PUT(Args.Data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async Task OnCompletedHandler(ActionEventArgs<BWPMModels.Ansprechpartner> 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.Ansprechpartner> args)
|
||||
{
|
||||
if (!Initial)
|
||||
{
|
||||
//await Task.Delay(100);
|
||||
//var Idx = await this.Grid.GetRowIndexByPrimaryKey(Convert.ToDouble(Value)); //get index value
|
||||
//this.Grid.SelectRow(Convert.ToDouble(Idx));
|
||||
}
|
||||
Initial = false;
|
||||
}
|
||||
|
||||
public async Task<double> DataHandler()
|
||||
{
|
||||
var PageCount = (GridData.Count / Grid.PageSettings.PageSize) + 1;
|
||||
ContinuePaging = true;
|
||||
var CurrentPage = 1;
|
||||
Grid.Refresh();
|
||||
await Grid.GoToPage(1);
|
||||
|
||||
for (int i = 1; i <= PageCount; i++)
|
||||
|
||||
{
|
||||
List<Ansprechpartner> Rows = await Grid.GetCurrentViewRecords(); // returns the current view data
|
||||
for (int j = 0; j < Grid.PageSettings.PageSize; j++)
|
||||
{
|
||||
if (j < Rows.Count && Rows[j].ID == Value)
|
||||
{
|
||||
foundrow = j;
|
||||
|
||||
ContinuePaging = false; // prevent the default navigation
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ContinuePaging)
|
||||
{
|
||||
if (i >= PageCount)
|
||||
{
|
||||
i = 0;
|
||||
}
|
||||
await Grid.GoToPage(i + 1);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return foundrow;
|
||||
}
|
||||
}
|
||||
return foundrow;
|
||||
}
|
||||
}
|
||||
273
BlazorApp - Kopie (4)/Pages/Company/Test.razor
Normal file
273
BlazorApp - Kopie (4)/Pages/Company/Test.razor
Normal file
@@ -0,0 +1,273 @@
|
||||
@page "/Company/Test"
|
||||
@inject Blazored.SessionStorage.ISessionStorageService sessionStorage
|
||||
@inherits Admin.ListBase;
|
||||
@using System.ComponentModel.DataAnnotations
|
||||
@using Syncfusion.Blazor.Grids;
|
||||
@using Syncfusion.Blazor.Buttons;
|
||||
@using Syncfusion.Blazor.Spinner;
|
||||
@using Syncfusion.Blazor.Navigations;
|
||||
@using Syncfusion.Blazor.Popups;
|
||||
@using BlazorApp.Helper
|
||||
@using BWPMModels;
|
||||
|
||||
@*<div class="container">*@
|
||||
|
||||
|
||||
<div class="control-section e-tab-section">
|
||||
|
||||
<EditForm Model="_firma" OnValidSubmit="@Submit" OnInvalidSubmit="@InvalidSubmit">
|
||||
<div class="card">
|
||||
|
||||
<div class="card-body">
|
||||
<SfButton IsPrimary="true" OnClick="@(() => SaveClick())">Speichern</SfButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<DataAnnotationsValidator />
|
||||
<SfTab ID="BlazorTab" Height="390">
|
||||
<TabItems>
|
||||
<TabItem>
|
||||
<ChildContent>
|
||||
<TabHeader Text="Kontakt-Daten"></TabHeader>
|
||||
</ChildContent>
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Adress-Daten</h5>
|
||||
<form>
|
||||
<div class="form-group row">
|
||||
<label for="nameZ1" class="col-2 col-form-label">Name</label>
|
||||
<div class="col-10">
|
||||
<InputText id="namez1" class="form-control" @bind-Value="_firma.nameZ1" placeholder="Firmenname" />
|
||||
<ValidationMessage For="@(() => _firma.nameZ1)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="nameZ2" class="col-2 col-form-label">Zusatz</label>
|
||||
<div class="col-10">
|
||||
<InputText id="nameZ2" class="form-control" @bind-Value="@_firma.nameZ2" placeholder="Zusatz" />
|
||||
<ValidationMessage For="@(() => _firma.nameZ2)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="strasse" class="col-2 col-form-label">Strasse</label>
|
||||
<div class="col-10">
|
||||
<InputText id="strasse" class="form-control" @bind-Value="@_firma.strasse" placeholder="Strasse" />
|
||||
<ValidationMessage For="@(() => _firma.strasse)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="plz" class="col-2 col-form-label">PLZ</label>
|
||||
<div class="col-10">
|
||||
<InputText id="plz" class="form-control" @bind-Value="@_firma.plz" placeholder="Postleitzahl" />
|
||||
<ValidationMessage For="@(() => _firma.plz)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="ort" class="col-2 col-form-label">Ort</label>
|
||||
<div class="col-10">
|
||||
<InputText id="ort" class="form-control" @bind-Value="@_firma.ort" placeholder="Ort" />
|
||||
<ValidationMessage For="@(() => _firma.ort)" />
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="form-group row">
|
||||
<label for="telefon" class="col-2 col-form-label">Telefon</label>
|
||||
<div class="col-10">
|
||||
<InputText id="tel" class="form-control" @bind-Value="@_firma.tel" placeholder="Telefon-Nummer" />
|
||||
<ValidationMessage For="@(() => _firma.tel)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="email" class="col-2 col-form-label">E-Mail</label>
|
||||
<div class="col-10">
|
||||
<InputText id="mail" class="form-control" @bind-Value="@_firma.mail" placeholder="E-Mail" required="required" typeof="email" />
|
||||
<ValidationMessage For="@(() => _firma.mail)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="web" class="col-2 col-form-label">Internet</label>
|
||||
<div class="col-10">
|
||||
<InputText id="internet" class="form-control" @bind-Value="@_firma.web" placeholder="Internet" />
|
||||
<ValidationMessage For="@(() => _firma.web)" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="Bemerkungen" class="col-2 col-form-label">Bemerkung</label>
|
||||
<div class="col-10">
|
||||
<InputTextArea id="bemerkung" class="form-control" @bind-Value="@_firma.bemerkung" placeholder="Internet" />
|
||||
<ValidationMessage For="@(() => _firma.bemerkung)" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Ansprechperson</h5>
|
||||
<form>
|
||||
<div class="form-group row">
|
||||
<label for="Anrede" class="col-2 col-form-label">Anrede</label>
|
||||
<div class="col-10">
|
||||
<select id="Anrede" name="Anrede" class="form-control" @bind="@_firma.anrede">
|
||||
<option value="1">Herr</option>
|
||||
<option value="2">Frau</option>
|
||||
<option value="3">Damen und Herren</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="ansprechperson_anme" class="col-2 col-form-label">Name</label>
|
||||
<div class="col-10">
|
||||
<InputText id="ansprechperson_name" class="form-control" @bind-Value="@_firma.ansprechperson_name" placeholder="Name Ansprechperson" />
|
||||
<ValidationMessage For="@(() => _firma.ansprechperson_name)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="ansprechperson_vorname" class="col-2 col-form-label">Vorname</label>
|
||||
<div class="col-10">
|
||||
<InputText id="ansprechperson_vorname" class="form-control" @bind-Value="@_firma.ansprechperon_vorname" placeholder="Vorname Ansprechperson" />
|
||||
<ValidationMessage For="@(() => _firma.ansprechperon_vorname)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="briefanrede" class="col-2 col-form-label">Briefanrede</label>
|
||||
<div class="col-10">
|
||||
<InputText id="briefanrede" class="form-control" @bind-Value="@_firma.briefanrede" placeholder="gewünschte Briefanrede" />
|
||||
<ValidationMessage For="@(() => _firma.briefanrede)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="handy" class="col-2 col-form-label">Telefon</label>
|
||||
<div class="col-10">
|
||||
<InputText id="handy" class="form-control" @bind-Value="@_firma.handy" placeholder="Telefon" />
|
||||
<ValidationMessage For="@(() => _firma.handy)" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
|
||||
</TabItem>
|
||||
<TabItem>
|
||||
<ChildContent>
|
||||
<TabHeader text="Angaben zur Ausbildung"></TabHeader>
|
||||
</ChildContent>
|
||||
<ContentTemplate>
|
||||
<div class="col-md-10">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Allgemeine Angaben</h5>
|
||||
<form>
|
||||
<div class="form-group row">
|
||||
<label for="ausbildung_Standort" class="col-2 col-form-label">Ausbildungsstandort</label>
|
||||
<div class="col-10">
|
||||
<InputTextArea id="ausbildung_Standort" class="form-control" @bind-Value="@_firma.ausbildungsstandort" placeholder="Allgmeine Angaben über Ausbildungsstandort" />
|
||||
<ValidationMessage For="@(() => _firma.ausbildungsstandort)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="ausbildung_bemerkung" class="col-2 col-form-label">Bemerkung</label>
|
||||
<div class="col-10">
|
||||
<InputTextArea id="ausbildung_bemerkung" class="form-control" @bind-Value="@_firma.ausbildungsbemerkung" placeholder="Allgemeine Bemerkungen zu den Ausbildungen" />
|
||||
<ValidationMessage For="@(() => _firma.ausbildungsbemerkung)" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</TabItem>
|
||||
</TabItems>
|
||||
</SfTab>
|
||||
|
||||
|
||||
</EditForm>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<SfDialog Width="250px" IsModal="true" @bind-Visible="@ShowErrorDialog">
|
||||
<DialogTemplates>
|
||||
<Header> Formmular unvollständig </Header>
|
||||
<Content> Bitte das Formular vollständig ausfüllen. </Content>
|
||||
|
||||
</DialogTemplates>
|
||||
<DialogButtons>
|
||||
<DialogButton Content="OK" IsPrimary="true" OnClick="@CloseDialog" />
|
||||
</DialogButtons>
|
||||
</SfDialog>
|
||||
|
||||
@*</div>*@
|
||||
@code {
|
||||
private Firma _firma { get; set; } = new BWPMModels.Firma();
|
||||
public List<BWPMModels.Firma> Firmendaten { get; set; }
|
||||
string userid = "";
|
||||
public static int? pkey { get; set; }
|
||||
public bool Initial { get; set; } = true;
|
||||
private bool ShowErrorDialog { get; set; } = false;
|
||||
|
||||
public void Submit()
|
||||
{
|
||||
BlazorApp.Controller.FirmaController.PUT(_firma);
|
||||
}
|
||||
public void InvalidSubmit()
|
||||
{
|
||||
ShowErrorDialog = true;
|
||||
}
|
||||
private void CloseDialog()
|
||||
{
|
||||
this.ShowErrorDialog = false;
|
||||
}
|
||||
|
||||
private void SaveClick()
|
||||
{
|
||||
//BlazorApp.Controller.FirmaController.savedata(_firma);
|
||||
}
|
||||
|
||||
protected override async void OnInitialized()
|
||||
{
|
||||
userid = "4c456017-85b9-4f34-a42c-f3ac534cc34f";
|
||||
|
||||
@* 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);
|
||||
userid = userId;
|
||||
}
|
||||
else
|
||||
{
|
||||
await sessionStorage.SetItemAsync("UserID", userId);
|
||||
userid = userId;
|
||||
}
|
||||
}*@
|
||||
|
||||
Firmendaten = BlazorApp.Controller.FirmaController.GetByUserID(userid);
|
||||
_firma = Firmendaten.First<BWPMModels.Firma>();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user