You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
125 lines
5.9 KiB
125 lines
5.9 KiB
@page "/Admin/Company/Company"
|
|
@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;
|
|
<style>
|
|
.e-mail:before {
|
|
content: '\e75e';
|
|
}
|
|
.e-bw:before {
|
|
content: '\e75e';
|
|
}
|
|
</style>
|
|
|
|
<h1>Firmenübersicht</h1>
|
|
|
|
<div class="col-lg-12 control-section">
|
|
<div class="content-wrapper">
|
|
<div class="row">
|
|
<SfGrid DataSource="@GridData" @ref="Grid" AllowPaging="true" AllowSorting="true">
|
|
<GridPageSettings PageCount="20" PageSizes="true"></GridPageSettings>
|
|
<GridEditSettings AllowAdding="true" AllowDeleting="true" AllowEditing="true" ></GridEditSettings>
|
|
<GridEvents CommandClicked="CommandClickHandler" TValue="View_Admin_Firmen" ></GridEvents>
|
|
<GridColumns>
|
|
|
|
|
|
<GridColumn Field=@nameof(View_Admin_Firmen.ID) HeaderText="Id" IsPrimaryKey="true" AllowAdding="false" Width="60"></GridColumn>
|
|
|
|
<GridColumn Field=@nameof(View_Admin_Firmen.Expr1) HeaderText="Firma" Width="100" Visible="true"></GridColumn>
|
|
|
|
<GridColumn Field=@nameof(View_Admin_Firmen.plz) HeaderText="Plz" Width="50" Visible="true"></GridColumn>
|
|
|
|
<GridColumn Field=@nameof(View_Admin_Firmen.ort) HeaderText="Ort" Width="100" Visible="true"></GridColumn>
|
|
|
|
<GridColumn Field=@nameof(View_Admin_Firmen.tel) HeaderText="Tel" Width="80" Visible="true"></GridColumn>
|
|
|
|
<GridColumn Field=@nameof(View_Admin_Firmen.mail) HeaderText="Mail" Width="100" Visible="true"></GridColumn>
|
|
|
|
<GridColumn Field=@nameof(View_Admin_Firmen.aktiv) HeaderText="Aktiv" Width="50" Visible="true" DisplayAsCheckBox="true"></GridColumn>
|
|
|
|
<GridColumn Field=@nameof(View_Admin_Firmen.aktuell) HeaderText="Aktuell" Width="50" Visible="true" DisplayAsCheckBox="true"></GridColumn>
|
|
|
|
<GridColumn Field=@nameof(View_Admin_Firmen.berufe_plaetze) HeaderText="Berufe/Plätze" Width="100" Visible="true"></GridColumn>
|
|
<GridColumn HeaderText="Funktionen" Width="150">
|
|
<GridCommandColumns>
|
|
<GridCommandColumn Title="Firma-Übersicht" Type="CommandButtonType.None" ButtonOption="@(new CommandButtonOptions() {IconCss="fas fa-bank", CssClass="e-flat" })"></GridCommandColumn>
|
|
<GridCommandColumn Title="Firmen-Daten" Type="CommandButtonType.None" ButtonOption="@(new CommandButtonOptions() {IconCss="fas fa-pen", CssClass="e-flat" })"></GridCommandColumn>
|
|
<GridCommandColumn Title="Ansprechperson" Type="CommandButtonType.None" ButtonOption="@(new CommandButtonOptions() {IconCss="fas fa-person", CssClass="e-flat" })"></GridCommandColumn>
|
|
<GridCommandColumn Title="Berufsangebot" Type="CommandButtonType.None" ButtonOption="@(new CommandButtonOptions() {IconCss="fas fa-list-check", CssClass="e-flat" })"></GridCommandColumn>
|
|
<GridCommandColumn Title="Löschen" Type="CommandButtonType.None" ButtonOption="@(new CommandButtonOptions() {IconCss="e-icons e-delete", CssClass="e-flat" })"></GridCommandColumn>
|
|
<GridCommandColumn Title="EMail" Type="CommandButtonType.None" ButtonOption="@(new CommandButtonOptions() {IconCss="e-icons e-mail", CssClass="e-flat" })"></GridCommandColumn>
|
|
</GridCommandColumns>
|
|
</GridColumn>
|
|
</GridColumns>
|
|
</SfGrid>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@code {
|
|
SfGrid<View_Admin_Firmen> Grid { get; set; }
|
|
public List<BWPMModels.View_Admin_Firmen> GridData { get; set; }
|
|
public List<BWPMModels.View_Admin_Firmen> View_Admin_Firmens { 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.View_Admin_FirmenController.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);
|
|
}
|
|
}
|
|
}
|
|
public void CommandClickHandler(CommandClickEventArgs<View_Admin_Firmen> args)
|
|
{
|
|
if (args.CommandColumn.Title=="Firma-Übersicht"){
|
|
NavigationManager.NavigateTo("/Company/Dashboard/" + args.RowData.ID.ToString());
|
|
}
|
|
if (args.CommandColumn.Title == "Firmen-Daten")
|
|
{
|
|
NavigationManager.NavigateTo("/Company/Company/" + args.RowData.ID.ToString());
|
|
|
|
}
|
|
if (args.CommandColumn.Title=="Berufsangebot"){
|
|
NavigationManager.NavigateTo("/Company/Berufsangebot/" + args.RowData.ID.ToString());
|
|
|
|
}
|
|
if (args.CommandColumn.Title=="Ansprechperson"){
|
|
NavigationManager.NavigateTo("/Company/CompanyContact/" + args.RowData.ID.ToString());
|
|
|
|
}
|
|
//Perform your custom command button click operation here. And also with the value in “args” you can differentiate the buttons, if having multiple custom command buttons.
|
|
}
|
|
} |