Update 07082021
This commit is contained in:
166
BlazorApp/Pages/Admin/Anrede/Anrede.razor
Normal file
166
BlazorApp/Pages/Admin/Anrede/Anrede.razor
Normal file
@@ -0,0 +1,166 @@
|
||||
@page "/Admin/Anrede/AnredeList"
|
||||
@inject Blazored.SessionStorage.ISessionStorageService sessionStorage
|
||||
@inherits ListBase
|
||||
@using Syncfusion.Blazor.Grids;
|
||||
@using Syncfusion.Blazor.Buttons;
|
||||
@using Syncfusion.Blazor.Spinner;
|
||||
@using BlazorApp.Helper
|
||||
@using BWPMModels;
|
||||
|
||||
@using BlazorApp.Controller;
|
||||
|
||||
|
||||
<h1>Anrede</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="BWPMModels.Anrede" OnDataBound="RowDataBoundHandler"></GridEvents>
|
||||
<GridColumns>
|
||||
<GridColumn Type="ColumnType.CheckBox" AllowFiltering="false" AllowSorting="false" Width="60"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(BWPMModels.Anrede.ID) HeaderText="Id" IsPrimaryKey="true" AllowAdding="false" Width="60"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(BWPMModels.Anrede.bezeichnung) HeaderText="Bezeichnung" Width="100" Visible="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(BWPMModels.Anrede.erstellt_am) HeaderText="Erstellt_am" Width="100" Visible="true" Format="d" Type="ColumnType.Date"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(BWPMModels.Anrede.mutiert_am) HeaderText="Mutiert_am" Width="100" Visible="true" Format="d" Type="ColumnType.Date"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(BWPMModels.Anrede.mutierer) HeaderText="Mutierer" Width="100" Visible="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(BWPMModels.Anrede.aktiv) HeaderText="Aktiv" Width="100" Visible="true" DisplayAsCheckBox="true"></GridColumn>
|
||||
</GridColumns>
|
||||
</SfGrid>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@code{ SfGrid<BWPMModels.Anrede> Grid { get; set; }
|
||||
public List<BWPMModels.Anrede> GridData { get; set; }
|
||||
public List<BWPMModels.Anrede> Anredes { 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;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
/// GridData = OrdersDetails.GetAllRecords();
|
||||
GridData = BlazorApp.Controller.AnredeController.GetAllData();
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
private async Task OnBeginHandler(ActionEventArgs<BWPMModels.Anrede> 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.AnredeController.POST(Args.Data);
|
||||
Value = Args.Data.ID;
|
||||
}
|
||||
else
|
||||
{
|
||||
Args.Data.mutierer = userid.ToString();
|
||||
Args.Data.mutiert_am = DateTime.Now;
|
||||
BlazorApp.Controller.AnredeController.PUT(Args.Data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async Task OnCompletedHandler(ActionEventArgs<BWPMModels.Anrede> 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.Anrede> 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 < BWPMModels.Anrede> 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;
|
||||
} }
|
||||
@@ -127,7 +127,7 @@
|
||||
BWPMModels.AspNetUsers usr = new BWPMModels.AspNetUsers();
|
||||
usr.Id = Gridid;
|
||||
usr.PasswordHash = password;
|
||||
BlazorApp.Controller.AspNetUserRolleController.savepassword(usr);
|
||||
BlazorApp.Controller.AspNetUserRolleController.PUTPassword(usr);
|
||||
|
||||
this.IsVisible = false;
|
||||
}
|
||||
@@ -213,7 +213,7 @@
|
||||
AspNetUserRoles rolle = new AspNetUserRoles();
|
||||
rolle.RoleId = Args.Data.RoleId;
|
||||
rolle.UserId = Args.Data.Id;
|
||||
BlazorApp.Controller.AspNetUserRolesController.savedata(rolle);
|
||||
BlazorApp.Controller.AspNetUserRolesController.PUT(rolle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
BlazorApp.Controller.AspNetUsersController.savedata(Args.Data);
|
||||
BlazorApp.Controller.AspNetUsersController.PUT(Args.Data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,12 +109,10 @@
|
||||
{
|
||||
if (Args.Action == "Add")
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
BlazorApp.Controller.AspNetRolesController.savedata(Args.Data);
|
||||
BlazorApp.Controller.AspNetRolesController.POST(Args.Data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,8 +28,7 @@
|
||||
<GridEditSettings AllowAdding="true" AllowDeleting="false" AllowEditing="true" Mode="EditMode.Dialog"></GridEditSettings>
|
||||
<GridEvents OnActionBegin="OnBeginHandler" OnActionComplete="OnCompletedHandler" TValue="Beruf" OnDataBound="RowDataBoundHandler"></GridEvents>
|
||||
<GridColumns>
|
||||
0
|
||||
|
||||
|
||||
<GridColumn Field=@nameof(Beruf.ID) HeaderText="Id" IsPrimaryKey="true" AllowAdding="false" Width="60"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Beruf.bezeichnung) HeaderText="Bezeichnung" Width="100" Visible="true"></GridColumn>
|
||||
@@ -111,14 +110,14 @@
|
||||
Args.Data.mutierer = userid;
|
||||
Args.Data.mutiert_am = DateTime.Now;
|
||||
Args.Data.aktiv = true;
|
||||
Args.Data.ID = BlazorApp.Controller.BerufController.InsertData(Args.Data);
|
||||
Args.Data.ID = BlazorApp.Controller.BerufController.POST(Args.Data);
|
||||
Value = Args.Data.ID;
|
||||
}
|
||||
else
|
||||
{
|
||||
Args.Data.mutierer = userid.ToString();
|
||||
Args.Data.mutiert_am = DateTime.Now;
|
||||
BlazorApp.Controller.BerufController.savedata(Args.Data);
|
||||
BlazorApp.Controller.BerufController.PUT(Args.Data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
168
BlazorApp/Pages/Admin/KlassenTyp/KlassentypList.razor
Normal file
168
BlazorApp/Pages/Admin/KlassenTyp/KlassentypList.razor
Normal file
@@ -0,0 +1,168 @@
|
||||
@page "/Admin/Klassentyp/KlassentypList"
|
||||
@inject Blazored.SessionStorage.ISessionStorageService sessionStorage
|
||||
@inherits ListBase
|
||||
@using Syncfusion.Blazor.Grids;
|
||||
@using Syncfusion.Blazor.Buttons;
|
||||
@using Syncfusion.Blazor.Spinner;
|
||||
@using BlazorApp.Helper
|
||||
@using BWPMModels;
|
||||
|
||||
@using BlazorApp.Controller;
|
||||
|
||||
|
||||
<h1>Klassentyp</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="Klassentyp" OnDataBound="RowDataBoundHandler"></GridEvents>
|
||||
<GridColumns>
|
||||
<GridColumn Type="ColumnType.CheckBox" AllowFiltering="false" AllowSorting="false" Width="60"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Klassentyp.ID) HeaderText="Id" IsPrimaryKey="true" AllowAdding="false" Width="60"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Klassentyp.bezeichnung) HeaderText="Bezeichnung" Width="100" Visible="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Klassentyp.aktiv) HeaderText="Aktiv" Width="100" Visible="true" DisplayAsCheckBox="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Klassentyp.erstellt_am) HeaderText="Erstellt_am" Width="100" Visible="true" Format="d" Type="ColumnType.Date"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Klassentyp.mutiert_am) HeaderText="Mutiert_am" Width="100" Visible="true" Format="d" Type="ColumnType.Date"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Klassentyp.mutierer) HeaderText="Mutierer" Width="100" Visible="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Klassentyp.mandantID) HeaderText="Mandantid" Width="100" Visible="true"></GridColumn>
|
||||
</GridColumns>
|
||||
</SfGrid>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@code{ SfGrid<Klassentyp> Grid { get; set; }
|
||||
public List<BWPMModels.Klassentyp> GridData { get; set; }
|
||||
public List<BWPMModels.Klassentyp> Klassentyps { 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;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
/// GridData = OrdersDetails.GetAllRecords();
|
||||
GridData = BlazorApp.Controller.KlassentypController.GetAllData();
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
private async Task OnBeginHandler(ActionEventArgs<BWPMModels.Klassentyp> 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.KlassentypController.POST(Args.Data);
|
||||
Value = Args.Data.ID;
|
||||
}
|
||||
else
|
||||
{
|
||||
Args.Data.mutierer = userid.ToString();
|
||||
Args.Data.mutiert_am = DateTime.Now;
|
||||
BlazorApp.Controller.KlassentypController.PUT(Args.Data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async Task OnCompletedHandler(ActionEventArgs<BWPMModels.Klassentyp> 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.Klassentyp> 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<Klassentyp> 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;
|
||||
} }
|
||||
@@ -23,12 +23,12 @@ namespace BlazorApp.Pages.Admin
|
||||
|
||||
var authenticationState = await authenticationStateTask;
|
||||
|
||||
if (!authenticationState.User.Identity.IsAuthenticated)
|
||||
{
|
||||
NavigationManager.NavigateTo($"/identity/account/login");
|
||||
// string returnUrl = WebUtility.UrlEncode($"/");
|
||||
// NavigationManager.NavigateTo(WebUtility.UrlEncode("/identity/Account/Login"));
|
||||
}
|
||||
//if (!authenticationState.User.Identity.IsAuthenticated)
|
||||
//{
|
||||
// NavigationManager.NavigateTo($"/identity/account/login");
|
||||
// // string returnUrl = WebUtility.UrlEncode($"/");
|
||||
// // NavigationManager.NavigateTo(WebUtility.UrlEncode("/identity/Account/Login"));
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
|
||||
170
BlazorApp/Pages/Admin/Optionen/OptionenList.razor
Normal file
170
BlazorApp/Pages/Admin/Optionen/OptionenList.razor
Normal file
@@ -0,0 +1,170 @@
|
||||
@page "/Admin/Optionen/OptionenList"
|
||||
@inject Blazored.SessionStorage.ISessionStorageService sessionStorage
|
||||
@inherits ListBase
|
||||
@using Syncfusion.Blazor.Grids;
|
||||
@using Syncfusion.Blazor.Buttons;
|
||||
@using Syncfusion.Blazor.Spinner;
|
||||
@using BlazorApp.Helper
|
||||
@using BWPMModels;
|
||||
|
||||
@using BlazorApp.Controller;
|
||||
|
||||
|
||||
<h1>Optionen</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="Optionen" OnDataBound="RowDataBoundHandler"></GridEvents>
|
||||
<GridColumns>
|
||||
<GridColumn Type="ColumnType.CheckBox" AllowFiltering="false" AllowSorting="false" Width="60"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Optionen.ID) HeaderText="Id" IsPrimaryKey="true" AllowAdding="false" Width="60"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Optionen.mandantnr) HeaderText="Mandantnr" Width="100" Visible="false"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Optionen.Bezeichnung) HeaderText="Bezeichnung" Width="100" Visible="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Optionen.inhalt) HeaderText="Inhalt" Width="200" Visible="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Optionen.erstellt_am) HeaderText="Erstellt_am" Width="400" Visible="false" Format="d" Type="ColumnType.Date"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Optionen.mutiert_am) HeaderText="Mutiert_am" Width="100" Visible="false" Format="d" Type="ColumnType.Date"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Optionen.mutierer) HeaderText="Mutierer" Width="100" Visible="false"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Optionen.aktiv) HeaderText="Aktiv" Width="100" Visible="false" DisplayAsCheckBox="true"></GridColumn>
|
||||
</GridColumns>
|
||||
</SfGrid>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@code{ SfGrid<Optionen> Grid { get; set; }
|
||||
public List<BWPMModels.Optionen> GridData { get; set; }
|
||||
public List<BWPMModels.Optionen> Optionens { 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;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
/// GridData = OrdersDetails.GetAllRecords();
|
||||
GridData = BlazorApp.Controller.OptionenController.GetAllData();
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
private async Task OnBeginHandler(ActionEventArgs<BWPMModels.Optionen> 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.OptionenController.POST(Args.Data);
|
||||
Value = Args.Data.ID;
|
||||
}
|
||||
else
|
||||
{
|
||||
Args.Data.mutierer = userid.ToString();
|
||||
Args.Data.mutiert_am = DateTime.Now;
|
||||
BlazorApp.Controller.OptionenController.PUT(Args.Data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async Task OnCompletedHandler(ActionEventArgs<BWPMModels.Optionen> 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.Optionen> 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<Optionen> 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;
|
||||
} }
|
||||
@@ -102,14 +102,14 @@
|
||||
Args.Data.mutierer = userid;
|
||||
Args.Data.mutiert_am = DateTime.Now;
|
||||
Args.Data.aktiv = true;
|
||||
Args.Data.ID = BlazorApp.Controller.SchulhausController.InsertData(Args.Data);
|
||||
Args.Data.ID = BlazorApp.Controller.SchulhausController.POST(Args.Data);
|
||||
Value = Args.Data.ID;
|
||||
}
|
||||
else
|
||||
{
|
||||
Args.Data.mutierer = userid.ToString();
|
||||
Args.Data.mutiert_am = DateTime.Now;
|
||||
BlazorApp.Controller.SchulhausController.savedata(Args.Data);
|
||||
BlazorApp.Controller.SchulhausController.PUT(Args.Data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
111
BlazorApp/Pages/Admin/ScriptGenerator.razor
Normal file
111
BlazorApp/Pages/Admin/ScriptGenerator.razor
Normal file
@@ -0,0 +1,111 @@
|
||||
@page "/Admin/ScriptGenerator"
|
||||
@inject Blazored.SessionStorage.ISessionStorageService sessionStorage
|
||||
@inherits ListBase
|
||||
@using System.Text;
|
||||
@using Syncfusion.Blazor.Grids;
|
||||
@using Syncfusion.Blazor.Buttons;
|
||||
@using Syncfusion.Blazor.Navigations
|
||||
@using System.Text.RegularExpressions;
|
||||
@using Newtonsoft.Json;
|
||||
|
||||
@using Syncfusion.Blazor.Spinner;
|
||||
@using BlazorApp.Helper
|
||||
@using BWPMModels;
|
||||
|
||||
@using BlazorApp.Controller;
|
||||
|
||||
|
||||
<h2>Script-Generator</h2>
|
||||
<div class="col-lg-12 control-section">
|
||||
<div class="content-wrapper">
|
||||
|
||||
<input type="text" @bind-value="tablename" id="tablename" name="Required" class="e-input">
|
||||
<SfButton OnClick="GenerateCode">Generieren</SfButton>
|
||||
<p></p>
|
||||
<div class="sample-browser e-view sf-new">
|
||||
<div class="sb-tab-content">
|
||||
<div class="sb-source-section">
|
||||
<SfTab CssClass="sb-content-tab">
|
||||
|
||||
<TabItems>
|
||||
<TabItem CssClass="e-tab">
|
||||
<HeaderTemplate>Model-Class</HeaderTemplate>
|
||||
<ContentTemplate>
|
||||
<div class="login-form">
|
||||
<div class='wrap'>
|
||||
<pre class="code">
|
||||
@Code1
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</TabItem>
|
||||
<TabItem>
|
||||
<HeaderTemplate>WebAPI Service-Controller</HeaderTemplate>
|
||||
<ContentTemplate>
|
||||
<div class="login-form">
|
||||
<div class='wrap'>
|
||||
<pre class="code">
|
||||
@Code2
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</TabItem>
|
||||
<TabItem>
|
||||
<HeaderTemplate>Razor-Page</HeaderTemplate>
|
||||
<ContentTemplate>
|
||||
<div class="login-form">
|
||||
<div class='wrap'>
|
||||
<pre class="code">
|
||||
@Code3
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</TabItem>
|
||||
<TabItem>
|
||||
<HeaderTemplate>Razor App-Controller</HeaderTemplate>
|
||||
<ContentTemplate>
|
||||
<div class="login-form">
|
||||
<div class='wrap'>
|
||||
<pre class="code">
|
||||
@Code4
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</TabItem>
|
||||
|
||||
</TabItems>
|
||||
</SfTab>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private List<TabItem> sourceCodeItems;
|
||||
public string tablename { get; set; } = "beruf";
|
||||
public string Code1 { get; set; } = "";
|
||||
public string Code2 { get; set; } = "";
|
||||
public string Code3 { get; set; } = "";
|
||||
public string Code4 { get; set; } = "";
|
||||
|
||||
public void GenerateCode()
|
||||
{
|
||||
|
||||
var clist1 = BlazorApp.Controller.MyScriptController.GetData(1, tablename);
|
||||
Code1 = clist1[0].script;
|
||||
var clist2 = BlazorApp.Controller.MyScriptController.GetData(4, tablename);
|
||||
Code2 = clist2[0].script;
|
||||
var clist3 = BlazorApp.Controller.MyScriptController.GetData(7, tablename);
|
||||
Code3 = clist3[0].script;
|
||||
var clist4 = BlazorApp.Controller.MyScriptController.GetData(8, tablename);
|
||||
Code4 = clist4[0].script;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
@page "/Admin/User/UserList"
|
||||
@inherits UserListBase
|
||||
@inject Blazored.SessionStorage.ISessionStorageService sessionStorage
|
||||
|
||||
@using Syncfusion.Blazor.Grids;
|
||||
@using Syncfusion.Blazor.Spinner;
|
||||
@using BlazorApp.Helper
|
||||
@@ -98,6 +99,7 @@
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
string userid = "";
|
||||
|
||||
userid = await sessionStorage.GetItemAsync<string>("UserID");
|
||||
|
||||
if (userid == null)
|
||||
@@ -110,10 +112,11 @@
|
||||
|
||||
{
|
||||
await sessionStorage.SetItemAsync("UserID", userId);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
await sessionStorage.SetItemAsync("UserID", userId);
|
||||
await sessionStorage.SetItemAsync("UserID", "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -98,14 +98,14 @@
|
||||
Args.Data.mutierer = userid;
|
||||
Args.Data.mutiert_am = DateTime.Now;
|
||||
Args.Data.aktiv = true;
|
||||
Args.Data.ID = BlazorApp.Controller.ZeitenController.InsertData(Args.Data);
|
||||
Args.Data.ID = BlazorApp.Controller.ZeitenController.POST(Args.Data);
|
||||
Value = Args.Data.ID;
|
||||
}
|
||||
else
|
||||
{
|
||||
Args.Data.mutierer = userid.ToString();
|
||||
Args.Data.mutiert_am = DateTime.Now;
|
||||
BlazorApp.Controller.ZeitenController.savedata(Args.Data);
|
||||
BlazorApp.Controller.ZeitenController.PUT(Args.Data);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -120,7 +120,7 @@
|
||||
foreach (Zeiten row in Rows)
|
||||
{
|
||||
row.reihenfolge = order;
|
||||
BlazorApp.Controller.ZeitenController.savedata(row);
|
||||
BlazorApp.Controller.ZeitenController.PUT(row);
|
||||
order = order + 1;
|
||||
Grid.Refresh();
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<div class="row">
|
||||
<div class="col-xl-6">
|
||||
<h4>Button with text</h4>
|
||||
<RadzenButton Click=@(args => OnClick("Button with text")) Text="Button" Style="margin-bottom: 20px; width: 150px" />
|
||||
<RadzenButton Click=@(args => OnClick("Button with text")) Text="Buttonx" Style="margin-bottom: 20px; width: 150px" />
|
||||
</div>
|
||||
<div class="col-xl-6">
|
||||
<h4>Button with text and icon</h4>
|
||||
|
||||
426
BlazorApp/Pages/Company/Berufsangebot.razor
Normal file
426
BlazorApp/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/Pages/Company/Company.razor
Normal file
275
BlazorApp/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/Pages/Company/CompanyContact.razor
Normal file
212
BlazorApp/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/Pages/Company/Test.razor
Normal file
273
BlazorApp/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>();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
5
BlazorApp/Pages/Component.razor
Normal file
5
BlazorApp/Pages/Component.razor
Normal file
@@ -0,0 +1,5 @@
|
||||
<h3>Component</h3>
|
||||
|
||||
@code {
|
||||
|
||||
}
|
||||
131
BlazorApp/Pages/Reporting/Reporting.razor
Normal file
131
BlazorApp/Pages/Reporting/Reporting.razor
Normal file
@@ -0,0 +1,131 @@
|
||||
@page "/Reporting/Reporting"
|
||||
@page "/Reporting/Reporting/{ReportNr}"
|
||||
@inherits Admin.ListBase;
|
||||
|
||||
@inject Blazored.SessionStorage.ISessionStorageService sessionStorage
|
||||
@using Microsoft.AspNetCore.Hosting;
|
||||
@using System.IO;
|
||||
@using System.Data;
|
||||
@using FastReport
|
||||
@using FastReport.Web
|
||||
@using FastReport.Web.Blazor.Components
|
||||
@using BWPMModels;
|
||||
@using Syncfusion.Blazor.Spinner
|
||||
<div id="container">
|
||||
|
||||
<WebReportContainer WebReport="@UserWebReport" />
|
||||
<SfSpinner @bind-Visible="@Spinnervisible">
|
||||
</SfSpinner>
|
||||
</div>
|
||||
@emsg;
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public string ReportNr { get; set; }
|
||||
|
||||
public string emsg { get; set; } = "";
|
||||
private IHostingEnvironment Environment;
|
||||
private bool Spinnervisible { get; set; } = true;
|
||||
public string ReportName { get; set; }
|
||||
public DataSet DataSet { get; set; } = new DataSet();
|
||||
public WebReport UserWebReport { get; set; } = new WebReport();
|
||||
public Report Report { get; set; } = new Report();
|
||||
string guserid = "";
|
||||
string sql = "";
|
||||
|
||||
private Firma _firma { get; set; } = new BWPMModels.Firma();
|
||||
public List<BWPMModels.Firma> Firmendaten { get; set; }
|
||||
|
||||
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
Spinnervisible = false;
|
||||
}
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
string paramtyp1 = "";
|
||||
string paramtyp2 = "";
|
||||
string paramtyp3 = "";
|
||||
|
||||
Helper.dbhelper dbh = new Helper.dbhelper();
|
||||
string reportdir = dbh.Get_Option(28);
|
||||
|
||||
reportdir += "/";
|
||||
dbh.Get_Tabledata("Select * from Report where id=" + ReportNr.ToString(), false, true);
|
||||
@*reportdir = "Reports/";*@
|
||||
try
|
||||
{
|
||||
Report = Report.FromFile(reportdir + dbh.dsdaten.Tables[0].Rows[0]["reportfile"]);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
emsg=e.Message;
|
||||
return;
|
||||
}
|
||||
paramtyp1 = dbh.dsdaten.Tables[0].Rows[0]["paramtype1"].ToString();
|
||||
paramtyp2 = dbh.dsdaten.Tables[0].Rows[0]["paramtype2"].ToString();
|
||||
paramtyp3 = dbh.dsdaten.Tables[0].Rows[0]["paramtype3"].ToString();
|
||||
|
||||
sql = dbh.dsdaten.Tables[0].Rows[0]["sql"].ToString();
|
||||
|
||||
switch (paramtyp1)
|
||||
{
|
||||
case "%firmaID%":
|
||||
Firmendaten = BlazorApp.Controller.FirmaController.GetByUserID(userid);
|
||||
_firma = Firmendaten.First<BWPMModels.Firma>();
|
||||
sql = sql.Replace("%firmaid%", _firma.ID.ToString());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
|
||||
|
||||
dbh.dsdaten.Tables.Clear();
|
||||
DataSet.Tables.Clear();
|
||||
DataSet.Tables.Add(dbh.Get_Tabledata(sql, false, true).Copy());
|
||||
Report.SetParameterValue("Parcours", dbh.Get_Option(2));
|
||||
Report.SetParameterValue("Spruch", dbh.Get_Option(3));
|
||||
Report.SetParameterValue("URL", dbh.Get_Option(27));
|
||||
Report.RegisterData(DataSet);
|
||||
Report.GetDataSource("Daten").Enabled = true;
|
||||
|
||||
UserWebReport.Report = Report;
|
||||
UserWebReport.Report.Refresh();
|
||||
Spinnervisible = false;
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
try
|
||||
|
||||
{
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
UserWebReport = new WebReport();
|
||||
}
|
||||
catch (Exception e)
|
||||
{ emsg = e.Message.ToString(); };
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
38
BlazorApp/Pages/Reporting/Reporting.razor.cs
Normal file
38
BlazorApp/Pages/Reporting/Reporting.razor.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using FastReport;
|
||||
using FastReport.Web;
|
||||
|
||||
|
||||
namespace BlazorApp.Pages.Reporting
|
||||
{
|
||||
public partial class Reporting
|
||||
{
|
||||
readonly string directory;
|
||||
const string DEFAULT_REPORT = "userliste.frx";
|
||||
string userid = "";
|
||||
//Report Report { get; set; }
|
||||
//DataSet DataSet { get; } = new DataSet();
|
||||
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
base.OnParametersSet();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public Reporting()
|
||||
{
|
||||
|
||||
BlazorApp.Helper.dbhelper dbh = new Helper.dbhelper();
|
||||
DataSet.Tables.Add(dbh.Get_Tabledata("Select * from AspNetUsers", false, true).Copy());
|
||||
DataSet.Tables[0].TableName = "Daten";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
31
BlazorApp/Pages/Reporting/Reports/Auswertungen.xml
Normal file
31
BlazorApp/Pages/Reporting/Reports/Auswertungen.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" standalone="yes"?>
|
||||
<LPReports>
|
||||
<Auswertungen>
|
||||
<Bericht>Firmendaten</Bericht>
|
||||
<SQL> SELECT dbo.Firma.ID, dbo.Firma.NameZ1, dbo.Firma.NameZ2, dbo.Firma.Strasse, dbo.Firma.PLZ, dbo.Firma.Ort, dbo.Firma.Tel, dbo.Firma.handy, dbo.Firma.Web, dbo.Firma.Mail,
|
||||
dbo.Firma.Bemerkung, dbo.Firma.Anrede, dbo.Firma.Ausbildungsstandort, dbo.Firma.Ausbildungsbemerkung, dbo.Firma.ansprechperson_name, dbo.Firma.ansprechperon_vorname, dbo.Ansprechpartner.id,
|
||||
dbo.Ansprechpartner.Name AS AName, dbo.Ansprechpartner.Vorname AS AVorname, dbo.Ansprechpartner.Tel AS ATel, dbo.Ansprechpartner.EMail AS AMail, dbo.Ansprechpartner.Anrede AS AAnrede, dbo.Beruf.Bezeichnung,
|
||||
dbo.KlassenTyp.bezeichnung AS Klasse, dbo.Zeiten.Bezeichnung AS Zeit, dbo.FirmaBeruf.Anzahl, dbo.FirmaBeruf.Schuelerbemerkung, dbo.FirmaBeruf.Standortbemerkung
|
||||
,dbo.Firma.mandantnr
|
||||
FROM dbo.Beruf INNER JOIN
|
||||
dbo.FirmaBeruf ON dbo.Beruf.id = dbo.FirmaBeruf.Berufid INNER JOIN
|
||||
dbo.Zeiten ON dbo.FirmaBeruf.Zeitid = dbo.Zeiten.id INNER JOIN
|
||||
dbo.Firma INNER JOIN
|
||||
dbo.Ansprechpartner ON dbo.Firma.ID = dbo.Ansprechpartner.FirmaID ON dbo.FirmaBeruf.Ansprechpartnerid = dbo.Ansprechpartner.id INNER JOIN
|
||||
dbo.KlassenTyp ON dbo.FirmaBeruf.KlassetypID = dbo.klassentyp.id
|
||||
|
||||
WHERE (dbo.Ansprechpartner.Aktiv = 1) AND (dbo.FirmaBeruf.Aktiv = 1) and (dbo.firma.id=4)</SQL>
|
||||
<SQLTYPE>SQL</SQLTYPE>
|
||||
<Filename>Firmendaten.frx</Filename>
|
||||
</Auswertungen>
|
||||
|
||||
|
||||
|
||||
<Auswertungen>
|
||||
<Bericht>Userliste</Bericht>
|
||||
<SQL>SELECT * FROM [BWPM].[dbo].[AspNetUsers]</SQL>
|
||||
<SQLTYPE>SQL</SQLTYPE>
|
||||
<Filename>Userliste.frx</Filename>
|
||||
</Auswertungen>
|
||||
|
||||
</LPReports>
|
||||
142
BlazorApp/Pages/Reporting/Reports/Firmendaten.frx
Normal file
142
BlazorApp/Pages/Reporting/Reports/Firmendaten.frx
Normal file
@@ -0,0 +1,142 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Report ScriptLanguage="Vb" ReportInfo.Created="07/19/2012 16:02:38" ReportInfo.Modified="07/29/2021 11:42:09" ReportInfo.CreatorVersion="2021.3.20.0">
|
||||
<ScriptText>Imports System
|
||||
Imports System.Collections
|
||||
Imports System.Collections.Generic
|
||||
Imports System.ComponentModel
|
||||
Imports System.Windows.Forms
|
||||
Imports System.Drawing
|
||||
Imports Microsoft.VisualBasic
|
||||
Imports FastReport
|
||||
Imports FastReport.Data
|
||||
Imports FastReport.Dialog
|
||||
Imports FastReport.Table
|
||||
Imports FastReport.Barcode
|
||||
Imports FastReport.Utils
|
||||
|
||||
Namespace FastReport
|
||||
Public Class ReportScript
|
||||
|
||||
|
||||
Private Sub Picture1_BeforePrint(ByVal sender As object, ByVal e As EventArgs)
|
||||
Picture1.ImageLocation= CType(Report.GetParameterValue("URL"), String)
|
||||
End Sub
|
||||
End Class
|
||||
End Namespace
|
||||
</ScriptText>
|
||||
<Dictionary>
|
||||
<TableDataSource Name="Daten" ReferenceName="Data.Daten" DataType="System.Int32" Enabled="true">
|
||||
<Column Name="NameZ1" DataType="System.String"/>
|
||||
<Column Name="NameZ2" DataType="System.String"/>
|
||||
<Column Name="Strasse" DataType="System.String"/>
|
||||
<Column Name="PLZ" DataType="System.String"/>
|
||||
<Column Name="Ort" DataType="System.String"/>
|
||||
<Column Name="Tel" DataType="System.String"/>
|
||||
<Column Name="Web" DataType="System.String"/>
|
||||
<Column Name="Bemerkung" DataType="System.String"/>
|
||||
<Column Name="Anrede" DataType="System.String"/>
|
||||
<Column Name="Ausbildungsstandort" DataType="System.String"/>
|
||||
<Column Name="Ausbildungsbemerkung" DataType="System.String"/>
|
||||
<Column Name="Bezeichnung" DataType="System.String"/>
|
||||
<Column Name="Anzahl" DataType="System.Int32"/>
|
||||
<Column Name="AName" DataType="System.String"/>
|
||||
<Column Name="AVorname" DataType="System.String"/>
|
||||
<Column Name="ATel" DataType="System.String"/>
|
||||
<Column Name="AMail" DataType="System.String"/>
|
||||
<Column Name="AAnrede" DataType="System.String"/>
|
||||
<Column Name="Klasse" DataType="System.String"/>
|
||||
<Column Name="Zeit" DataType="System.String"/>
|
||||
<Column Name="Schuelerbemerkung" DataType="System.String"/>
|
||||
<Column Name="Standortbemerkung" DataType="System.String"/>
|
||||
<Column Name="ID" DataType="System.Int32"/>
|
||||
<Column Name="handy" DataType="System.String"/>
|
||||
<Column Name="Mail" DataType="System.String"/>
|
||||
<Column Name="ansprechperson_name" DataType="System.String"/>
|
||||
<Column Name="ansprechperon_vorname" DataType="System.String"/>
|
||||
<Column Name="id1" DataType="System.Int32"/>
|
||||
<Column Name="mandantnr" DataType="System.Int32"/>
|
||||
</TableDataSource>
|
||||
<Parameter Name="Parcours" DataType="System.String"/>
|
||||
<Parameter Name="Spruch" DataType="System.String"/>
|
||||
<Parameter Name="URL" DataType="System.String"/>
|
||||
</Dictionary>
|
||||
<ReportPage Name="Page1" Landscape="true" PaperWidth="297" PaperHeight="210" RawPaperSize="9" Watermark.Font="Arial, 60pt">
|
||||
<ReportTitleBand Name="ReportTitle1" Width="1047.06" Height="245.7">
|
||||
<TextObject Name="Text32" Left="567" Top="9.45" Width="463.05" Height="18.9" Text="[Parcours]" HorzAlign="Right" Font="Arial, 12pt, style=Bold"/>
|
||||
<TextObject Name="Text33" Left="567" Top="37.8" Width="463.05" Height="18.9" Text="Firmendaten" HorzAlign="Right" Font="Arial, 12pt, style=Bold"/>
|
||||
<TextObject Name="Text1" Left="122.85" Top="94.5" Width="207.9" Height="18.9" Text="[Daten.NameZ1]" Font="Arial, 10pt"/>
|
||||
<TextObject Name="Text9" Left="18.9" Top="94.5" Width="103.95" Height="18.9" Text="Name Zeile 1:" Font="Arial, 10pt, style=Bold"/>
|
||||
<TextObject Name="Text40" Left="359.1" Top="94.5" Width="66.15" Height="18.9" Text="Telefon:" Font="Arial, 10pt, style=Bold"/>
|
||||
<TextObject Name="Text10" Left="434.7" Top="94.5" Width="141.75" Height="18.9" Text="[Daten.Tel]" Font="Arial, 10pt"/>
|
||||
<TextObject Name="Text2" Left="122.85" Top="113.4" Width="207.9" Height="18.9" Text="[Daten.NameZ2]" Font="Arial, 10pt"/>
|
||||
<TextObject Name="Text3" Left="122.85" Top="132.3" Width="207.9" Height="18.9" Text="[Daten.Anrede]" Font="Arial, 10pt"/>
|
||||
<TextObject Name="Text34" Left="18.9" Top="113.4" Width="103.95" Height="18.9" Text="Name Zeile 2:" Font="Arial, 10pt, style=Bold"/>
|
||||
<TextObject Name="Text35" Left="18.9" Top="132.3" Width="103.95" Height="18.9" Text="Anrede:" Font="Arial, 10pt, style=Bold"/>
|
||||
<TextObject Name="Text42" Left="359.1" Top="141.75" Width="66.15" Height="18.9" Text="Internet:" Font="Arial, 10pt, style=Bold"/>
|
||||
<TextObject Name="Text12" Left="434.7" Top="141.75" Width="245.7" Height="18.9" Text="[Daten.Web]" Font="Arial, 10pt"/>
|
||||
<TextObject Name="Text36" Left="18.9" Top="151.2" Width="103.95" Height="18.9" Text="Name:" Font="Arial, 10pt, style=Bold"/>
|
||||
<TextObject Name="Text43" Left="359.1" Top="160.65" Width="66.15" Height="18.9" Text="E-Mail:" Font="Arial, 10pt, style=Bold"/>
|
||||
<TextObject Name="Text13" Left="434.7" Top="160.65" Width="245.7" Height="18.9" Text="[Daten.Mail]" Font="Arial, 10pt"/>
|
||||
<TextObject Name="Text37" Left="18.9" Top="170.1" Width="103.95" Height="18.9" Text="Vorname:" Font="Arial, 10pt, style=Bold"/>
|
||||
<TextObject Name="Text6" Left="122.85" Top="189" Width="207.9" Height="18.9" Text="[Daten.Strasse]" Font="Arial, 10pt"/>
|
||||
<TextObject Name="Text38" Left="18.9" Top="189" Width="103.95" Height="18.9" Text="Strasse:" Font="Arial, 10pt, style=Bold"/>
|
||||
<TextObject Name="Text7" Left="122.85" Top="207.9" Width="47.25" Height="18.9" Text="[Daten.PLZ]" Font="Arial, 10pt"/>
|
||||
<TextObject Name="Text8" Left="170.1" Top="207.9" Width="132.3" Height="18.9" Text="[Daten.Ort]" Font="Arial, 10pt"/>
|
||||
<TextObject Name="Text39" Left="18.9" Top="207.9" Width="103.95" Height="18.9" Text="PLZ / Ort:" Font="Arial, 10pt, style=Bold"/>
|
||||
<PictureObject Name="Picture1" Left="9.45" Top="-18.9" Width="103.95" Height="85.05" BeforePrintEvent="Picture1_BeforePrint" Image=""/>
|
||||
<TextObject Name="Text55" Left="359.1" Top="113.4" Width="66.15" Height="18.9" Text="Natel:" Font="Arial, 10pt, style=Bold"/>
|
||||
<TextObject Name="Text28" Left="434.7" Top="113.4" Width="141.75" Height="18.9" Text="[Daten.handy]" Font="Arial, 10pt"/>
|
||||
<TextObject Name="Text58" Left="122.85" Top="151.2" Width="189" Height="18.9" Text="[Daten.ansprechperson_name]" Font="Arial, 10pt"/>
|
||||
<TextObject Name="Text59" Left="122.85" Top="170.1" Width="189" Height="18.9" Text="[Daten.ansprechperon_vorname]" Font="Arial, 10pt"/>
|
||||
<LineObject Name="Line5" Left="18.9" Top="75.6" Width="1011.15"/>
|
||||
<ChildBand Name="Child5" Top="249.7" Width="1047.06" Height="37.8" CanGrow="true">
|
||||
<TextObject Name="Text14" Left="18.9" Top="18.9" Width="1011.15" Height="18.9" CanGrow="true" Text="[Daten.Bemerkung]" Font="Arial, 10pt"/>
|
||||
<TextObject Name="Text44" Left="18.9" Width="311.85" Height="18.9" Text="Bemerkung für Organisatoren des BWP" Font="Arial, 10pt, style=Bold"/>
|
||||
<ChildBand Name="Child6" Top="291.5" Width="1047.06" Height="47.25" CanGrow="true">
|
||||
<TextObject Name="Text45" Left="18.9" Top="9.45" Width="529.2" Height="18.9" Text="Folgendes muss der Schüler mitbringen (spezielle Kleidung, Ausweis, usw.)" Font="Arial, 10pt, style=Bold"/>
|
||||
<TextObject Name="Text16" Left="18.9" Top="28.35" Width="1011.15" Height="18.9" CanGrow="true" Text="[Daten.Ausbildungsbemerkung]" Font="Arial, 10pt"/>
|
||||
<ChildBand Name="Child7" Top="342.75" Width="1047.06" Height="66.15" CanGrow="true">
|
||||
<TextObject Name="Text15" Left="18.9" Top="28.35" Width="1011.15" Height="18.9" CanGrow="true" Text="[Daten.Ausbildungsstandort]" Font="Arial, 10pt"/>
|
||||
<TextObject Name="Text46" Left="18.9" Top="9.45" Width="529.2" Height="18.9" Text="Treffpunkt für Schüler, falls abweichend zur Geschäftsadresse" Font="Arial, 10pt, style=Bold"/>
|
||||
<ChildBand Name="Child8" Top="412.9" Width="1047.06"/>
|
||||
</ChildBand>
|
||||
</ChildBand>
|
||||
</ChildBand>
|
||||
</ReportTitleBand>
|
||||
<PageHeaderBand Name="PageHeader1" Top="416.9" Width="1047.06"/>
|
||||
<GroupHeaderBand Name="GroupHeader1" Top="420.9" Width="1047.06" Height="113.4" KeepChild="true" KeepWithData="true" Condition="[Daten.id1]" KeepTogether="true">
|
||||
<ShapeObject Name="Shape1" Left="18.9" Width="1011.15" Height="75.6"/>
|
||||
<TextObject Name="Text19" Left="160.65" Top="9.45" Width="330.75" Height="18.9" Text="[Daten.AAnrede] [Daten.AName] [Daten.AVorname]" Font="Arial, 10pt"/>
|
||||
<TextObject Name="Text20" Left="160.65" Top="28.35" Width="217.35" Height="18.9" Text="[Daten.ATel]" Font="Arial, 10pt"/>
|
||||
<TextObject Name="Text47" Left="22.9" Top="28.35" Width="66.15" Height="18.9" Text="Telefon:" Font="Arial, 10pt, style=Bold"/>
|
||||
<TextObject Name="Text17" Left="22.9" Top="9.45" Width="132.3" Height="18.9" Text="Ansprechpartner:" Font="Arial, 10pt, style=Bold"/>
|
||||
<TextObject Name="Text48" Left="22.9" Top="47.25" Width="66.15" Height="18.9" Text="E-Mail:" Font="Arial, 10pt, style=Bold"/>
|
||||
<TextObject Name="Text21" Left="160.65" Top="47.25" Width="500.85" Height="18.9" CanGrow="true" Text="[Daten.AMail]" Font="Arial, 10pt"/>
|
||||
<TextObject Name="Text50" Left="463.05" Top="94.5" Width="113.4" Height="18.9" Text="Zeit" HorzAlign="Right" Font="Arial, 10pt, style=Bold"/>
|
||||
<TextObject Name="Text25" Left="349.65" Top="94.5" Width="85.05" Height="18.9" Text="Anz. Plätze" HorzAlign="Right" Font="Arial, 10pt, style=Bold"/>
|
||||
<TextObject Name="Text23" Left="255.15" Top="94.5" Width="66.15" Height="18.9" Text="Min.Anf." Font="Arial, 10pt, style=Bold"/>
|
||||
<TextObject Name="Text49" Left="18.9" Top="94.5" Width="94.5" Height="18.9" Text="Beruf" Font="Arial, 10pt, style=Bold"/>
|
||||
<LineObject Name="Line2" Left="18.9" Top="113.4" Width="1011.15"/>
|
||||
<TextObject Name="Text53" Left="585.9" Top="94.5" Width="179.55" Height="18.9" Text="Bemerkung für Schüler" Font="Arial, 10pt, style=Bold"/>
|
||||
<TextObject Name="Text54" Left="784.35" Top="94.5" Width="179.55" Height="18.9" Text="Bemerkung zum Standort" Font="Arial, 10pt, style=Bold"/>
|
||||
<DataBand Name="Data1" Top="538.3" Width="1047.06" Height="18.9" CanGrow="true" DataSource="Daten" KeepTogether="true">
|
||||
<TextObject Name="Text18" Left="18.9" Width="226.8" Height="18.9" CanGrow="true" Text="[Daten.Bezeichnung]" Font="Arial, 10pt"/>
|
||||
<TextObject Name="Text22" Left="255.15" Width="103.95" Height="18.9" Text="[Daten.Klasse]" Font="Arial, 10pt"/>
|
||||
<TextObject Name="Text26" Left="444.15" Width="132.3" Height="18.9" Text="[Daten.Zeit]" HorzAlign="Right" Font="Arial, 10pt"/>
|
||||
<TextObject Name="Text24" Left="378" Width="56.7" Height="18.9" Text="[Daten.Anzahl]" HorzAlign="Right" Font="Arial, 10pt"/>
|
||||
<TextObject Name="Text27" Left="585.9" Width="189" Height="18.9" CanGrow="true" Text="[Daten.Schuelerbemerkung]" Font="Arial, 10pt"/>
|
||||
<TextObject Name="Text29" Left="784.35" Width="245.7" Height="18.9" CanGrow="true" Text="[Daten.Standortbemerkung]" Font="Arial, 10pt"/>
|
||||
<Sort>
|
||||
<Sort Expression="[Daten.Zeit]"/>
|
||||
<Sort Expression="[Daten.Bezeichnung]"/>
|
||||
</Sort>
|
||||
</DataBand>
|
||||
<GroupFooterBand Name="GroupFooter1" Top="561.2" Width="1047.06" Height="18.9"/>
|
||||
</GroupHeaderBand>
|
||||
<PageFooterBand Name="PageFooter1" Top="584.1" Width="1047.06" Height="28.35">
|
||||
<TextObject Name="Text51" Left="963.9" Top="9.45" Width="66.15" Height="18.9" Text="[Page#]" HorzAlign="Right" Font="Arial, 10pt"/>
|
||||
<TextObject Name="Text52" Left="18.9" Top="9.45" Width="94.5" Height="18.9" Text="[Date]" Format="Date" Format.Format="d" Font="Arial, 10pt"/>
|
||||
<LineObject Name="Line4" Left="18.9" Top="9.45" Width="1011.15"/>
|
||||
</PageFooterBand>
|
||||
</ReportPage>
|
||||
</Report>
|
||||
45
BlazorApp/Pages/Reporting/Reports/userliste.frx
Normal file
45
BlazorApp/Pages/Reporting/Reports/userliste.frx
Normal file
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Report ScriptLanguage="CSharp" ReportInfo.Created="07/24/2021 10:48:45" ReportInfo.Modified="07/24/2021 10:49:35" ReportInfo.CreatorVersion="2021.3.17.0">
|
||||
<Styles Name="Standard">
|
||||
<Style Name="Title" Font="Arial, 12pt, style=Bold"/>
|
||||
<Style Name="Header" Font="Arial, 10pt, style=Bold"/>
|
||||
<Style Name="Group" Font="Arial, 10pt, style=Bold"/>
|
||||
<Style Name="Data" Font="Arial, 10pt"/>
|
||||
<Style Name="Footer" Font="Arial, 10pt"/>
|
||||
<Style Name="EvenRows" Fill.Color="WhiteSmoke" Font="Arial, 10pt"/>
|
||||
</Styles>
|
||||
<Dictionary>
|
||||
<TableDataSource Name="Daten" ReferenceName="Data.Daten" DataType="System.Int32" Enabled="true">
|
||||
<Column Name="Id" DataType="System.String"/>
|
||||
<Column Name="UserName" DataType="System.String"/>
|
||||
<Column Name="NormalizedUserName" DataType="System.String"/>
|
||||
<Column Name="Email" DataType="System.String"/>
|
||||
<Column Name="NormalizedEmail" DataType="System.String"/>
|
||||
<Column Name="EmailConfirmed" DataType="System.Boolean" BindableControl="CheckBox"/>
|
||||
<Column Name="PasswordHash" DataType="System.String"/>
|
||||
<Column Name="SecurityStamp" DataType="System.String"/>
|
||||
<Column Name="ConcurrencyStamp" DataType="System.String"/>
|
||||
<Column Name="PhoneNumber" DataType="System.String"/>
|
||||
<Column Name="PhoneNumberConfirmed" DataType="System.Boolean" BindableControl="CheckBox"/>
|
||||
<Column Name="TwoFactorEnabled" DataType="System.Boolean" BindableControl="CheckBox"/>
|
||||
<Column Name="LockoutEnd" DataType="System.DateTimeOffset"/>
|
||||
<Column Name="LockoutEnabled" DataType="System.Boolean" BindableControl="CheckBox"/>
|
||||
<Column Name="AccessFailedCount" DataType="System.Int32"/>
|
||||
<Column Name="LockoutEndDateUtc" DataType="System.DateTimeOffset"/>
|
||||
</TableDataSource>
|
||||
</Dictionary>
|
||||
<ReportPage Name="Page1" Watermark.Font="Arial, 60pt">
|
||||
<ReportTitleBand Name="ReportTitle1" Width="718.2" Height="37.8">
|
||||
<TextObject Name="Text1" Width="718.2" Height="37.8" Dock="Fill" Text="Daten" HorzAlign="Center" VertAlign="Center" Font="Arial, 12pt, style=Bold" Style="Title"/>
|
||||
</ReportTitleBand>
|
||||
<PageHeaderBand Name="PageHeader1" Top="41.8" Width="718.2" Height="28.35">
|
||||
<TextObject Name="Text2" Left="18.9" Width="94.5" Height="18.9" Text="UserName" Font="Arial, 10pt"/>
|
||||
</PageHeaderBand>
|
||||
<DataBand Name="Data1" Top="74.15" Width="718.2" Height="56.7" EvenStyle="EvenRows" DataSource="Daten">
|
||||
<TextObject Name="Text35" Left="18.9" Top="9.45" Width="94.5" Height="18.9" Text="[Daten.UserName]" Font="Arial, 10pt"/>
|
||||
</DataBand>
|
||||
<PageFooterBand Name="PageFooter1" Top="134.85" Width="718.2" Height="75.6">
|
||||
<TextObject Name="Text34" Width="718.2" Height="75.6" Dock="Fill" Text="[PageN]" HorzAlign="Right" Font="Arial, 10pt" Style="Footer"/>
|
||||
</PageFooterBand>
|
||||
</ReportPage>
|
||||
</Report>
|
||||
43
BlazorApp/Pages/ShowConfig.razor
Normal file
43
BlazorApp/Pages/ShowConfig.razor
Normal file
@@ -0,0 +1,43 @@
|
||||
@page "/showconfig"
|
||||
@using BlazorApp.Helper
|
||||
@using System.IO;
|
||||
|
||||
<h3>ShowConfig</h3>
|
||||
|
||||
<button @onclick="ShowConfiguration">Config</button>
|
||||
<br />
|
||||
<label>Autologin: @alogin</label><br />
|
||||
<label>Connectionstring: @connstring</label><br />
|
||||
<label>Directory: @mydir</label><br />
|
||||
<br />
|
||||
<input placeholder="Enter your text" @bind-value="@pathi" />
|
||||
<button @onclick="@UpdateFilelist">Refresh</button>
|
||||
<br />
|
||||
<label>Files: @filelist</label>
|
||||
|
||||
<hr />
|
||||
|
||||
@code {
|
||||
public string alogin { get; set; } = "";
|
||||
public string connstring { get; set; } = "";
|
||||
public string mydir { get; set; } = "";
|
||||
public string filelist { get; set; } = "";
|
||||
public string pathi { get; set; } = "";
|
||||
private void ShowConfiguration()
|
||||
{
|
||||
Helper.ParameterHelper ph = new Helper.ParameterHelper();
|
||||
alogin = ph.GetParameter("autologin");
|
||||
connstring = ph.GetConnString("BlazorAppContextConnection");
|
||||
mydir = AppContext.BaseDirectory;
|
||||
|
||||
|
||||
}
|
||||
private void UpdateFilelist()
|
||||
{
|
||||
filelist = "";
|
||||
string [] fileEntries = Directory.GetFiles(pathi);
|
||||
foreach (string fileName in fileEntries)
|
||||
filelist = filelist + ", " + fileName;
|
||||
}
|
||||
|
||||
}
|
||||
346
BlazorApp/Pages/Teacher/Teacher.razor
Normal file
346
BlazorApp/Pages/Teacher/Teacher.razor
Normal file
@@ -0,0 +1,346 @@
|
||||
@page "/Teacher/TeacherContact"
|
||||
@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="control-section e-tab-section">
|
||||
|
||||
<EditForm Model="_lehrer" 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="Anrede" class="col-2 col-form-label">Anrede</label>
|
||||
<div class="col-10">
|
||||
<select id="Anrede" name="Anrede" class="form-control" @bind="@_lehrer.anredeID">
|
||||
<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="nameZ1" class="col-2 col-form-label">Name</label>
|
||||
<div class="col-10">
|
||||
<InputText id="namez1" class="form-control" @bind-Value="_lehrer.name" placeholder="Nachname" />
|
||||
<ValidationMessage For="@(() => _lehrer.name)" />
|
||||
</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="@_lehrer.vorname" placeholder="vorname" />
|
||||
<ValidationMessage For="@(() => _lehrer.vorname)" />
|
||||
</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="@_lehrer.tel" placeholder="Telefon-Nummer" />
|
||||
<ValidationMessage For="@(() => _lehrer.tel)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="handy" class="col-2 col-form-label">Mobile</label>
|
||||
<div class="col-10">
|
||||
<InputText id="handy" class="form-control" @bind-Value="@_lehrer.handy" placeholder="Mobile-Nummer" />
|
||||
<ValidationMessage For="@(() => _lehrer.handy)" />
|
||||
</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="@_lehrer.email" placeholder="E-Mail" required="required" typeof="email" />
|
||||
<ValidationMessage For="@(() => _lehrer.email)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="Schulhaus" class="col-2 col-form-label">Schulhaus</label>
|
||||
<div class="col-10">
|
||||
<select id="Schulhaus" name="Schulhaus" class="form-control" @bind="@_lehrer.schulhausID">
|
||||
@foreach (var sh in _schulhaus)
|
||||
{
|
||||
<option value="@sh.ID">@sh.bezeichnung</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Klassen und Klassengrösse</h5>
|
||||
<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="Klasse" OnDataBound="RowDataBoundHandler"></GridEvents>
|
||||
<GridColumns>
|
||||
<GridColumn Type="ColumnType.CheckBox" AllowFiltering="false" AllowSorting="false" Width="60"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Klasse.ID) HeaderText="Id" IsPrimaryKey="true" AllowAdding="false" Width="60" Visible="true"></GridColumn>
|
||||
<GridForeignColumn Field=@nameof(Klasse.schulhausID) HeaderText="Schulhaus" ForeignKeyValue="bezeichnung" ForeignKeyField="ID" ForeignDataSource="@_schulhaus" Width="150"></GridForeignColumn>
|
||||
@*<GridColumn Field=@nameof(Klasse.schulhausID) HeaderText="Schulhausid" Width="100" Visible="true"></GridColumn>*@
|
||||
|
||||
<GridColumn Field=@nameof(Klasse.bezeichnung) HeaderText="Bezeichnung" Width="100" Visible="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Klasse.klassengroesse) HeaderText="Klassengrösse" Width="100" Visible="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Klasse.aktiv) HeaderText="Aktiv" Width="100" Visible="false" DisplayAsCheckBox="true"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Klasse.erstellt_am) HeaderText="Erstellt_am" Width="100" Visible="false" Format="d" Type="ColumnType.Date"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Klasse.mutiert_am) HeaderText="Mutiert_am" Width="100" Visible="false" Format="d" Type="ColumnType.Date"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Klasse.mutierer) HeaderText="Mutierer" Width="100" Visible="false"></GridColumn>
|
||||
|
||||
|
||||
<GridColumn Field=@nameof(Klasse.lehrerID) HeaderText="Lehrerid" Width="100" Visible="false"></GridColumn>
|
||||
|
||||
<GridColumn Field=@nameof(Klasse.mandantnr) HeaderText="Mandantnr" Width="100" Visible="false"></GridColumn>
|
||||
</GridColumns>
|
||||
</SfGrid>
|
||||
|
||||
<form>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</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>
|
||||
<SfDialog Width="250px" IsModal="true" @bind-Visible="@ShowErrorDialog_grid">
|
||||
<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<Klasse> Grid { get; set; }
|
||||
public int Value = 0;
|
||||
public List<BWPMModels.Klasse> GridData { get; set; }
|
||||
public List<BWPMModels.Klasse> Klasses { get; set; }
|
||||
public int foundrow = 0;
|
||||
public bool ContinuePaging = true;
|
||||
public bool InitialRender { get; set; }
|
||||
|
||||
private List<BWPMModels.Schulhaus> _schulhaus { get; set; } = BlazorApp.Controller.SchulhausController.GetAllData();
|
||||
private Lehrer _lehrer { get; set; } = new BWPMModels.Lehrer();
|
||||
public List<BWPMModels.Lehrer> Lehrerdaten { get; set; }
|
||||
string userid = "";
|
||||
public static int? pkey { get; set; }
|
||||
public bool Initial { get; set; } = true;
|
||||
private bool ShowErrorDialog { get; set; } = false;
|
||||
private bool ShowErrorDialog_grid { get; set; } = false;
|
||||
|
||||
public void Submit()
|
||||
{
|
||||
BlazorApp.Controller.LehrerController.PUT(_lehrer);
|
||||
}
|
||||
public void InvalidSubmit()
|
||||
{
|
||||
ShowErrorDialog = true;
|
||||
}
|
||||
private void CloseDialog()
|
||||
{
|
||||
this.ShowErrorDialog = false;
|
||||
}
|
||||
|
||||
private void SaveClick()
|
||||
{
|
||||
}
|
||||
|
||||
protected override async void OnInitialized()
|
||||
{
|
||||
|
||||
}
|
||||
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);
|
||||
userid = userId;
|
||||
}
|
||||
else
|
||||
{
|
||||
await sessionStorage.SetItemAsync("UserID", userId);
|
||||
userid = userId;
|
||||
}
|
||||
}
|
||||
if (firstRender)
|
||||
{
|
||||
Lehrerdaten = BlazorApp.Controller.LehrerController.GetByUserID(userid);
|
||||
_lehrer = Lehrerdaten.First<BWPMModels.Lehrer>();
|
||||
GridData = BlazorApp.Controller.KlasseController.GetByLehrerID(_lehrer.ID);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private async Task OnBeginHandler(ActionEventArgs<BWPMModels.Klasse> Args)
|
||||
|
||||
{
|
||||
try{
|
||||
if (_lehrer.ID==0)
|
||||
{ShowErrorDialog_grid=true
|
||||
return}
|
||||
}
|
||||
catch
|
||||
{ ShowErrorDialog_grid=true
|
||||
return}
|
||||
if (Args.RequestType == Syncfusion.Blazor.Grids.Action.Save)
|
||||
{
|
||||
if (Args.Action == "Add")
|
||||
{
|
||||
Args.Data.lehrerID = _lehrer.ID;
|
||||
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.KlasseController.POST(Args.Data);
|
||||
Value = Args.Data.ID;
|
||||
}
|
||||
else
|
||||
{
|
||||
Args.Data.mutierer = userid.ToString();
|
||||
Args.Data.mutiert_am = DateTime.Now;
|
||||
BlazorApp.Controller.KlasseController.PUT(Args.Data);
|
||||
|
||||
Value = Args.Data.ID;
|
||||
Grid.Refresh();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async Task OnCompletedHandler(ActionEventArgs<BWPMModels.Klasse> 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.Klasse> 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<Klasse> 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;
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,9 @@
|
||||
<body>
|
||||
<script src="_content/Radzen.Blazor/Radzen.Blazor.js"></script>
|
||||
<app>
|
||||
<component type="typeof(App)" render-mode="ServerPrerendered" />
|
||||
<component type="typeof(App)" render-mode="Server" />
|
||||
@*<component type="typeof(App)" render-mode="ServerPrerendered" />*@
|
||||
|
||||
</app>
|
||||
|
||||
<div id="blazor-error-ui">
|
||||
|
||||
Reference in New Issue
Block a user