Na most jó a beküldéshez a Binding
This commit is contained in:
@@ -31,7 +31,6 @@
|
||||
</VerticalStackLayout>
|
||||
</Frame>
|
||||
</ScrollView>
|
||||
|
||||
<ScrollView Grid.Row="1">
|
||||
<Frame BorderColor="Gray" Padding="5" Margin="1" HasShadow="True">
|
||||
<VerticalStackLayout>
|
||||
@@ -58,7 +57,20 @@
|
||||
</VerticalStackLayout>
|
||||
</Frame>
|
||||
</ScrollView>
|
||||
|
||||
<Grid BackgroundColor="#80000000"
|
||||
IsVisible="{Binding IsLoading}"
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="2"
|
||||
VerticalOptions="Fill"
|
||||
HorizontalOptions="Fill"
|
||||
ZIndex="1000">
|
||||
<ActivityIndicator IsRunning="{Binding IsLoading}"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center"
|
||||
Color="White"
|
||||
WidthRequest="50"
|
||||
HeightRequest="50"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
</ContentPage>
|
||||
@@ -10,9 +10,21 @@ public partial class CheckListPage : ContentPage
|
||||
{
|
||||
private readonly ICheckListService _checkListService;
|
||||
private readonly IUserService _userService;
|
||||
private bool _isLoading;
|
||||
|
||||
|
||||
public ICommand NewCommand { get; set; }
|
||||
public ICommand ContinueCommand { get; set; }
|
||||
public bool IsLoading
|
||||
{
|
||||
get => _isLoading;
|
||||
set
|
||||
{
|
||||
_isLoading = value;
|
||||
OnPropertyChanged(nameof(IsLoading));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public CheckListPage()
|
||||
{
|
||||
@@ -55,13 +67,17 @@ public partial class CheckListPage : ContentPage
|
||||
}
|
||||
private async Task LoadCheckListTemplate()
|
||||
{
|
||||
IsLoading = true;
|
||||
var userId = _userService.GetCurrentUser()?.Id;
|
||||
CheckListTemplate.ItemsSource = await _checkListService.GetCheckListTemplates(userId ?? 1);
|
||||
IsLoading = false;
|
||||
}
|
||||
private async Task LoadCheckList()
|
||||
{
|
||||
IsLoading = true;
|
||||
var userId = _userService.GetCurrentUser()?.Id;
|
||||
CheckList.ItemsSource = await _checkListService.GetCheckLists(userId ?? 1);
|
||||
IsLoading = false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,20 +4,48 @@
|
||||
x:Class="WorkFlowCheck.MAUI.Pages.CheckList.CheckListWorkPage"
|
||||
xmlns:templateselectors="clr-namespace:WorkFlowCheck.MAUI.TemplateSelectors"
|
||||
xmlns:local="clr-namespace:WorkFlowCheck.MAUI.Pages.CheckList"
|
||||
Title="CheckListWorkPage">
|
||||
<StackLayout Padding="20">
|
||||
<Label Text="Ellenőrzési feladatok" FontAttributes="Bold" FontSize="Medium" HorizontalOptions="Center" />
|
||||
<Frame BorderColor="Gray" Padding="1" Margin="2" HasShadow="True" CornerRadius="2">
|
||||
<CollectionView x:Name="CheckPointCheckListRows"
|
||||
HeightRequest="640"
|
||||
Title="">
|
||||
<Grid>
|
||||
<StackLayout Padding="20">
|
||||
<Label Text="Ellenőrzési feladatok" FontAttributes="Bold" FontSize="Medium" HorizontalOptions="Center" />
|
||||
<Frame BorderColor="Gray" Padding="1" Margin="2" HasShadow="True" CornerRadius="2">
|
||||
<CollectionView x:Name="CheckPointCheckListRows"
|
||||
HeightRequest="615"
|
||||
ItemsSource="{Binding CheckListRows}"
|
||||
ItemTemplate="{StaticResource AnswerTemplateSelector}">
|
||||
<CollectionView.EmptyView>
|
||||
<Label Text="Nincsenek feladatok." HorizontalOptions="Center" VerticalOptions="Center"/>
|
||||
</CollectionView.EmptyView>
|
||||
</CollectionView>
|
||||
</Frame>
|
||||
</StackLayout>
|
||||
<CollectionView.EmptyView>
|
||||
<Label Text="Nincsenek feladatok." HorizontalOptions="Center" VerticalOptions="Center"/>
|
||||
</CollectionView.EmptyView>
|
||||
</CollectionView>
|
||||
</Frame>
|
||||
<Grid ColumnSpacing="46" Margin="0,10,0,10">
|
||||
<!-- 10 pixel térköz az oszlopok között -->
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<!-- Üres tér a két gomb között -->
|
||||
<ColumnDefinition Width="200" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Text="Mentés" Command="{Binding SaveCommand}" Grid.Column="0"/>
|
||||
<Button Text="Beküldés" Command="{Binding SendCommand}" Grid.Column="2" Background="DarkRed" TextColor="Yellow"/>
|
||||
</Grid>
|
||||
</StackLayout>
|
||||
<Grid BackgroundColor="#80000000"
|
||||
IsVisible="{Binding IsLoading}"
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="2"
|
||||
VerticalOptions="Fill"
|
||||
HorizontalOptions="Fill"
|
||||
ZIndex="1000">
|
||||
<ActivityIndicator IsRunning="{Binding IsLoading}"
|
||||
HorizontalOptions="Center"
|
||||
VerticalOptions="Center"
|
||||
Color="White"
|
||||
WidthRequest="50"
|
||||
HeightRequest="50"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<ContentPage.Resources>
|
||||
<DataTemplate x:Key="I_N_Template">
|
||||
<Frame BorderColor="Gray" Padding="1" Margin="2" HasShadow="True" CornerRadius="2">
|
||||
@@ -40,14 +68,14 @@
|
||||
Content="Igen"
|
||||
Value="Igen"
|
||||
BindableGroupName="{Binding GroupName}"
|
||||
IsChecked="{Binding SelectedAnswer, Converter={StaticResource RadioButtonConverter}, ConverterParameter=Igen}"
|
||||
IsChecked="{Binding AnswerYes, Converter={StaticResource RBConverter}, ConverterParameter=Igen}"
|
||||
HorizontalOptions="Center" VerticalOptions="Center"/>
|
||||
<local:BindableRadioButton
|
||||
Grid.Row="1"
|
||||
Content="Nem"
|
||||
Value="Nem"
|
||||
BindableGroupName="{Binding GroupName}"
|
||||
IsChecked="{Binding SelectedAnswer, Converter={StaticResource RadioButtonConverter}, ConverterParameter=Nem}"
|
||||
IsChecked="{Binding AnswerNo, Converter={StaticResource RBConverter}, ConverterParameter=Nem}"
|
||||
HorizontalOptions="Center" VerticalOptions="Center"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -121,14 +149,14 @@
|
||||
Content="Igen"
|
||||
Value="Igen"
|
||||
BindableGroupName="{Binding GroupName}"
|
||||
IsChecked="{Binding SelectedAnswer, Converter={StaticResource RadioButtonConverter}, ConverterParameter=Igen}"
|
||||
IsChecked="{Binding AnswerYes, Converter={StaticResource RBConverter}, ConverterParameter=Igen}"
|
||||
HorizontalOptions="Center" VerticalOptions="Center"/>
|
||||
<local:BindableRadioButton
|
||||
Grid.Row="1"
|
||||
Content="Nem"
|
||||
Value="Nem"
|
||||
BindableGroupName="{Binding GroupName}"
|
||||
IsChecked="{Binding SelectedAnswer, Converter={StaticResource RadioButtonConverter}, ConverterParameter=Nem}"
|
||||
IsChecked="{Binding AnswerNo, Converter={StaticResource RBConverter}, ConverterParameter=Nem}"
|
||||
HorizontalOptions="Center" VerticalOptions="Center"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -155,14 +183,14 @@
|
||||
Content="Igen"
|
||||
Value="Igen"
|
||||
BindableGroupName="{Binding GroupName}"
|
||||
IsChecked="{Binding SelectedAnswer, Converter={StaticResource RadioButtonConverter}, ConverterParameter=Igen}"
|
||||
IsChecked="{Binding AnswerYes, Converter={StaticResource RBConverter}, ConverterParameter=Igen}"
|
||||
HorizontalOptions="Center" VerticalOptions="Center"/>
|
||||
<local:BindableRadioButton
|
||||
Grid.Row="1"
|
||||
Content="Nem"
|
||||
Value="Nem"
|
||||
BindableGroupName="{Binding GroupName}"
|
||||
IsChecked="{Binding SelectedAnswer, Converter={StaticResource RadioButtonConverter}, ConverterParameter=Nem}"
|
||||
IsChecked="{Binding AnswerNo, Converter={StaticResource RBConverter}, ConverterParameter=Nem}"
|
||||
HorizontalOptions="Center" VerticalOptions="Center"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -189,14 +217,14 @@
|
||||
Content="Igen"
|
||||
Value="Igen"
|
||||
BindableGroupName="{Binding GroupName}"
|
||||
IsChecked="{Binding SelectedAnswer, Converter={StaticResource RadioButtonConverter}, ConverterParameter=Igen}"
|
||||
IsChecked="{Binding AnswerYes, Converter={StaticResource RBConverter}, ConverterParameter=Igen}"
|
||||
HorizontalOptions="Center" VerticalOptions="Center"/>
|
||||
<local:BindableRadioButton
|
||||
Grid.Row="1"
|
||||
Content="Nem"
|
||||
Value="Nem"
|
||||
BindableGroupName="{Binding GroupName}"
|
||||
IsChecked="{Binding SelectedAnswer, Converter={StaticResource RadioButtonConverter}, ConverterParameter=Nem}"
|
||||
IsChecked="{Binding AnswerNo, Converter={StaticResource RBConverter}, ConverterParameter=Nem}"
|
||||
HorizontalOptions="Center" VerticalOptions="Center"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -223,14 +251,14 @@
|
||||
Content="Igen"
|
||||
Value="Igen"
|
||||
BindableGroupName="{Binding GroupName}"
|
||||
IsChecked="{Binding SelectedAnswer, Converter={StaticResource RadioButtonConverter}, ConverterParameter=Igen}"
|
||||
IsChecked="{Binding AnswerYes, Converter={StaticResource RBConverter}, ConverterParameter=Igen}"
|
||||
HorizontalOptions="Center" VerticalOptions="Center"/>
|
||||
<local:BindableRadioButton
|
||||
Grid.Row="1"
|
||||
Content="Nem"
|
||||
Value="Nem"
|
||||
BindableGroupName="{Binding GroupName}"
|
||||
IsChecked="{Binding SelectedAnswer, Converter={StaticResource RadioButtonConverter}, ConverterParameter=Nem}"
|
||||
IsChecked="{Binding AnswerNo, Converter={StaticResource RBConverter}, ConverterParameter=Nem}"
|
||||
HorizontalOptions="Center" VerticalOptions="Center"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
@@ -5,6 +5,8 @@ using System.Windows.Input;
|
||||
using System.Globalization;
|
||||
using DevExpress.Data.Helpers;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Android.Provider;
|
||||
|
||||
namespace WorkFlowCheck.MAUI.Pages.CheckList;
|
||||
|
||||
@@ -14,9 +16,20 @@ public partial class CheckListWorkPage : ContentPage
|
||||
private string _checkPointCode;
|
||||
private int _checkListHeaderId;
|
||||
private UserDTO _userDTO;
|
||||
|
||||
private bool _isLoading;
|
||||
public bool IsLoading
|
||||
{
|
||||
get => _isLoading;
|
||||
set
|
||||
{
|
||||
_isLoading = value;
|
||||
OnPropertyChanged(nameof(IsLoading));
|
||||
}
|
||||
}
|
||||
public ObservableCollection<CheckListRowDTO> CheckListRows { get; set; } = new ObservableCollection<CheckListRowDTO>();
|
||||
public ICommand CreatePhoto { get; set; }
|
||||
public ICommand SendCommand { get; set; }
|
||||
public ICommand SaveCommand { get; set; }
|
||||
|
||||
public CheckListWorkPage(int checkListHeaderId, string checkPointCode)
|
||||
{
|
||||
@@ -25,7 +38,20 @@ public partial class CheckListWorkPage : ContentPage
|
||||
_checkListHeaderId = checkListHeaderId;
|
||||
_checkListService = MauiProgram.ServiceProvider.GetRequiredService<ICheckListService>();
|
||||
_userDTO = MauiProgram.ServiceProvider.GetRequiredService<IUserService>().GetCurrentUser();
|
||||
|
||||
SaveCommand = new Command(OnSave);
|
||||
SendCommand = new Command(OnSend);
|
||||
}
|
||||
|
||||
private void OnSend(object obj)
|
||||
{
|
||||
int i = 0;
|
||||
}
|
||||
private void OnSave(object obj)
|
||||
{
|
||||
int i = 0;
|
||||
}
|
||||
|
||||
protected override async void OnAppearing()
|
||||
{
|
||||
base.OnAppearing();
|
||||
@@ -64,12 +90,16 @@ public partial class CheckListWorkPage : ContentPage
|
||||
}
|
||||
private async Task LoadCheckPointCheckListRows()
|
||||
{
|
||||
IsLoading = true;
|
||||
|
||||
CheckListRows.Clear();
|
||||
var checkListRowDTOs = await _checkListService.GetCheckListRowsByCheckPointCode(_userDTO.Id, _checkListHeaderId, _checkPointCode);
|
||||
foreach (var item in checkListRowDTOs)
|
||||
{
|
||||
CheckListRows.Add(item);
|
||||
}
|
||||
|
||||
IsLoading = false;
|
||||
}
|
||||
}
|
||||
public class BindableRadioButton : RadioButton
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="WorkFlowCheck.MAUI.Pages.NFC.NFCWaiter"
|
||||
Title="NFCWaiter">
|
||||
<VerticalStackLayout>
|
||||
<Label
|
||||
Title="Várakozás NFC olvasásra">
|
||||
<Grid HorizontalOptions="Center" VerticalOptions="Center">
|
||||
<Label Grid.Row="0"
|
||||
Text="Várakozás az NFC beolvasásra ..."
|
||||
VerticalOptions="Center"
|
||||
HorizontalOptions="Center" />
|
||||
</VerticalStackLayout>
|
||||
</Grid>
|
||||
</ContentPage>
|
||||
@@ -40,6 +40,21 @@ namespace WorkFlowCheck.MAUI.Services
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
public async Task<ApiResponseDTO<CheckPointDTO>> GetCheckPoint(string checkPointCode)
|
||||
{
|
||||
var retVal = new ApiResponseDTO<CheckPointDTO>() { IsSuccess = true };
|
||||
try
|
||||
{
|
||||
var res = await _dbContext.CheckPoints.Include(i => i.CheckListTemplateRows).Where(w => w.Code == checkPointCode).FirstOrDefaultAsync();
|
||||
retVal.Data = _mapper.Map<CheckPointDTO>(res);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
retVal.IsSuccess = false;
|
||||
retVal.Errors.Add(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
public async Task<ApiResponseDTO<CheckListHeaderDTO>> StartNew(CheckListTemplateHeaderDTO checkListTemplateHeaderDTO)
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace WorkFlowCheck.MAUI.Services.Interfaces
|
||||
{
|
||||
Task<ApiResponseDTO<CheckListHeaderDTO>> StartNew(CheckListTemplateHeaderDTO checkListTemplateHeaderDTO);
|
||||
Task<ApiResponseDTO<CheckPointDTO>> GetCheckPoint(int checkPointId);
|
||||
Task<ApiResponseDTO<CheckPointDTO>> GetCheckPoint(string checkPointCode);
|
||||
|
||||
|
||||
Task<List<CheckListHeaderDTO>> GetCheckLists(int userId);
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
using WorkFlowCheck.MAUI.Pages.CheckList;
|
||||
|
||||
namespace WorkFlowCheck.MAUI.TemplateSelectors
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user