Userhez is lehet már NFC kódot rendelni
This commit is contained in:
@@ -66,6 +66,10 @@
|
||||
<Button Text="Blokkolás"
|
||||
Margin="5,0,0,0"
|
||||
BackgroundColor="Red"
|
||||
HeightRequest="50"
|
||||
MaximumHeightRequest="50"
|
||||
WidthRequest="120"
|
||||
MaximumWidthRequest="120"
|
||||
IsVisible="{Binding CheckStatus, Converter={StaticResource BlockedConverter}}"
|
||||
Command="{Binding BindingContext.BlockCommand, Source={x:Reference CheckList}}"
|
||||
CommandParameter="{Binding .}">
|
||||
@@ -73,6 +77,10 @@
|
||||
<Button Text="Feloldás"
|
||||
Margin="5,0,0,0"
|
||||
BackgroundColor="Green"
|
||||
HeightRequest="50"
|
||||
MaximumHeightRequest="50"
|
||||
WidthRequest="120"
|
||||
MaximumWidthRequest="120"
|
||||
IsVisible="{Binding CheckStatus, Converter={StaticResource UnBlockedConverter}}"
|
||||
Command="{Binding BindingContext.UnblockCommand, Source={x:Reference CheckList}}"
|
||||
CommandParameter="{Binding .}">
|
||||
@@ -80,6 +88,10 @@
|
||||
<Button Text="Folytatás"
|
||||
Margin="5,0,0,0"
|
||||
BackgroundColor="Blue"
|
||||
HeightRequest="50"
|
||||
MaximumHeightRequest="50"
|
||||
WidthRequest="120"
|
||||
MaximumWidthRequest="120"
|
||||
IsVisible="{Binding CheckStatus, Converter={StaticResource ContinueConverter}}"
|
||||
Command="{Binding BindingContext.ContinueCommand, Source={x:Reference CheckList}}"
|
||||
CommandParameter="{Binding .}">
|
||||
@@ -116,6 +128,10 @@
|
||||
<Button Text="Új ellenőrzés"
|
||||
BackgroundColor="Green"
|
||||
Margin="5,0,0,0"
|
||||
HeightRequest="50"
|
||||
MaximumHeightRequest="50"
|
||||
WidthRequest="120"
|
||||
MaximumWidthRequest="120"
|
||||
Command="{Binding BindingContext.NewCommand, Source={x:Reference CheckListTemplate}}"
|
||||
CommandParameter="{Binding .}" />
|
||||
</HorizontalStackLayout>
|
||||
|
||||
@@ -50,7 +50,7 @@ public partial class CheckListPage : ContentPage
|
||||
{
|
||||
_currentUser = _userService.GetCurrentUser();
|
||||
DeviceId.Text = _userService.DeviceId;
|
||||
UserInfo.Text = $"{_currentUser?.FirstName} {_currentUser?.LastName}";
|
||||
UserInfo.Text = $"{_currentUser?.LastName} {_currentUser?.FirstName}";
|
||||
}
|
||||
protected override bool OnBackButtonPressed()
|
||||
{
|
||||
|
||||
@@ -17,18 +17,21 @@
|
||||
<CollectionView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Frame BorderColor="Gray" Padding="10" Margin="5" HasShadow="True" BackgroundColor="WhiteSmoke">
|
||||
<StackLayout>
|
||||
<Label Text="{Binding ShortName}" FontSize="16" FontAttributes="Bold" />
|
||||
<Label Text="{Binding Code}" FontSize="14" />
|
||||
<HorizontalStackLayout HorizontalOptions="End">
|
||||
<Button Text="Edit" Margin="5,0,0,0"
|
||||
Command="{Binding BindingContext.EditCommand, Source={x:Reference UsersList}}"
|
||||
CommandParameter="{Binding .}" />
|
||||
<Button Text="Pair" Margin="5,0,0,0"
|
||||
Command="{Binding BindingContext.PairCommand, Source={x:Reference UsersList}}"
|
||||
CommandParameter="{Binding .}" />
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<StackLayout Grid.Column="0" Spacing="2">
|
||||
<Label Text="{Binding FullName}" FontSize="16" FontAttributes="Bold" />
|
||||
<Label Text="{Binding NFCCode}" FontSize="14" />
|
||||
</StackLayout>
|
||||
<HorizontalStackLayout Grid.Column="1" HorizontalOptions="End" Spacing="5">
|
||||
<Button Text="Párosítás" Margin="5,0,0,0"
|
||||
HeightRequest="50"
|
||||
MaximumHeightRequest="50"
|
||||
WidthRequest="120"
|
||||
MaximumWidthRequest="120"
|
||||
Command="{Binding BindingContext.PairCommand, Source={x:Reference UsersList}}"
|
||||
CommandParameter="{Binding .}" />
|
||||
</HorizontalStackLayout>
|
||||
</StackLayout>
|
||||
</Grid>
|
||||
</Frame>
|
||||
</DataTemplate>
|
||||
</CollectionView.ItemTemplate>
|
||||
|
||||
@@ -9,12 +9,13 @@ public partial class UsersPage : ContentPage
|
||||
{
|
||||
|
||||
private readonly IUserService _userService;
|
||||
|
||||
private readonly ISyncService _syncService;
|
||||
|
||||
public UsersPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
_userService = MauiProgram.ServiceProvider.GetRequiredService<IUserService>();
|
||||
_syncService = MauiProgram.ServiceProvider.GetRequiredService<ISyncService>();
|
||||
}
|
||||
|
||||
public ICommand RefreshCommand { get; set; }
|
||||
@@ -25,7 +26,7 @@ public partial class UsersPage : ContentPage
|
||||
{
|
||||
base.OnAppearing();
|
||||
RefreshCommand = new Command(async () => await LoadUsers());
|
||||
PairCommand = new Command<UserDTO>(OnPairItem);
|
||||
PairCommand = new Command<MobileUserDTO>(OnPairItem);
|
||||
|
||||
BindingContext = this;
|
||||
await LoadUsers();
|
||||
@@ -35,12 +36,12 @@ public partial class UsersPage : ContentPage
|
||||
{
|
||||
IsRefreshing = true;
|
||||
//await _syncService.SyncDatas();
|
||||
//UsersList.ItemsSource = await _userService.GetAllUserAsync().Result.Data;
|
||||
UsersList.ItemsSource = await _userService.GetAllMobileUserAsync();
|
||||
IsRefreshing = false;
|
||||
OnPropertyChanged(nameof(IsRefreshing));
|
||||
}
|
||||
|
||||
private async void OnPairItem(UserDTO UserDTO)
|
||||
private async void OnPairItem(MobileUserDTO mobileUserDTO)
|
||||
{
|
||||
var UserCode = await NFCWaiter.ShowModalAsync();
|
||||
if (!string.IsNullOrEmpty(UserCode))
|
||||
@@ -49,10 +50,11 @@ public partial class UsersPage : ContentPage
|
||||
{
|
||||
await Navigation.PopModalAsync();
|
||||
}
|
||||
if (UserDTO != null)
|
||||
if (mobileUserDTO != null)
|
||||
{
|
||||
//UserDTO.Code = UserCode;
|
||||
//await _baseStockService.UpdateUser(UserDTO);
|
||||
mobileUserDTO.NFCCode = UserCode;
|
||||
|
||||
await _userService.UpdateCheckPoint(mobileUserDTO);
|
||||
await LoadUsers();
|
||||
}
|
||||
}
|
||||
@@ -74,7 +76,7 @@ public partial class UsersPage : ContentPage
|
||||
{
|
||||
await Task.Run(async () =>
|
||||
{
|
||||
await _userService.SyncUsers_Up((percentage, infostring) =>
|
||||
await _syncService.SyncUsers_Up((percentage, infostring) =>
|
||||
{
|
||||
MainThread.BeginInvokeOnMainThread(() =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user