Alap funkció működés CheckPoints

This commit is contained in:
2025-02-12 20:00:49 +01:00
parent ac80a8a9bb
commit f57fef804d
23 changed files with 266 additions and 8 deletions
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="WorkFlowCheck.MAUI.Pages.BaseStock.BaseStockPage"
Title="BaseStockPage">
<VerticalStackLayout>
<Label
Text="Welcome to .NET MAUI!"
VerticalOptions="Center"
HorizontalOptions="Center" />
<Button
x:Name="ButtonGetCheckPoints"
Text="Ellenőrzési pontok"
SemanticProperties.Hint="Ellenőrzési pontok"
Clicked="OnButtonGetCheckPoints"
HorizontalOptions="Fill" />
</VerticalStackLayout>
</ContentPage>
@@ -0,0 +1,28 @@
namespace WorkFlowCheck.MAUI.Pages.BaseStock;
public partial class BaseStockPage : ContentPage
{
public BaseStockPage()
{
InitializeComponent();
}
private async void OnButtonGetCheckPoints(object sender, EventArgs e)
{
await Shell.Current.GoToAsync("//CheckPointsPage");
}
private async void OnButtonGetEquipments(object sender, EventArgs e)
{
await Shell.Current.GoToAsync("//EquipmentsPage");
}
private async void OnButtonGetLocations(object sender, EventArgs e)
{
await Shell.Current.GoToAsync("//LocationsPage");
}
protected override bool OnBackButtonPressed()
{
Shell.Current.GoToAsync("//MainPage");
return true;
}
}
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="WorkFlowCheck.MAUI.Pages.BaseStock.CheckPointsPage"
Title="Ellenőrzési pontok">
<CollectionView x:Name="CheckPointsList">
<CollectionView.ItemTemplate>
<DataTemplate>
<Frame BorderColor="Gray" Padding="10" Margin="5" HasShadow="True">
<StackLayout>
<Label Text="{Binding ShortName}" FontSize="16" FontAttributes="Bold" />
<Label Text="{Binding Code}" FontSize="14" />
</StackLayout>
</Frame>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</ContentPage>
@@ -0,0 +1,36 @@
using System.Collections.ObjectModel;
using System.Windows.Input;
using WorkFlowCheck.Common.DTO;
using WorkFlowCheck.MAUI.Services.Interfaces;
namespace WorkFlowCheck.MAUI.Pages.BaseStock;
public partial class CheckPointsPage : ContentPage
{
private readonly IBaseStockService _baseStockService;
private readonly ISyncService _syncService;
public CheckPointsPage()
{
InitializeComponent();
_baseStockService = MauiProgram.ServiceProvider.GetRequiredService<IBaseStockService>();
_syncService= MauiProgram.ServiceProvider.GetRequiredService<ISyncService>();
}
protected override async void OnAppearing()
{
base.OnAppearing();
await LoadCheckPoints();
}
private async Task LoadCheckPoints()
{
await _syncService.SyncDatas();
CheckPointsList.ItemsSource = await _baseStockService.GetAllCheckPoints();
}
protected override bool OnBackButtonPressed()
{
Shell.Current.GoToAsync("//BaseStockPage");
return true;
}
}
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="WorkFlowCheck.MAUI.Pages.BaseStock.EquipmentsPage"
Title="EquipmentsPage">
<VerticalStackLayout>
<Label
Text="Welcome to .NET MAUI!"
VerticalOptions="Center"
HorizontalOptions="Center" />
</VerticalStackLayout>
</ContentPage>
@@ -0,0 +1,14 @@
namespace WorkFlowCheck.MAUI.Pages.BaseStock;
public partial class EquipmentsPage : ContentPage
{
public EquipmentsPage()
{
InitializeComponent();
}
protected override bool OnBackButtonPressed()
{
Shell.Current.GoToAsync("//BaseStockPage");
return true;
}
}
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="WorkFlowCheck.MAUI.Pages.BaseStock.LocationsPage"
Title="LocationsPage">
<VerticalStackLayout>
<Label
Text="Welcome to .NET MAUI!"
VerticalOptions="Center"
HorizontalOptions="Center" />
</VerticalStackLayout>
</ContentPage>
@@ -0,0 +1,14 @@
namespace WorkFlowCheck.MAUI.Pages.BaseStock;
public partial class LocationsPage : ContentPage
{
public LocationsPage()
{
InitializeComponent();
}
protected override bool OnBackButtonPressed()
{
Shell.Current.GoToAsync("//BaseStockPage");
return true;
}
}