mirror of
https://gitlab.com/fabinfra/fabaccess/borepin.git
synced 2025-06-11 11:03:23 +02:00
Updated API
This commit is contained in:
@ -27,29 +27,37 @@ namespace Borepin.Model
|
||||
Name = _Machine.Name;
|
||||
Description = _Machine.Description;
|
||||
State = _Machine.State;
|
||||
Manager = new UserVisualize(_Machine.Manager);
|
||||
Manager.LoadData();
|
||||
|
||||
MachineInfoExtended machineInfoExtended = await _Machine.Manage.GetMachineInfoExtended().ConfigureAwait(false);
|
||||
if(machineInfoExtended != null)
|
||||
if(_Machine.Manager.Just != null)
|
||||
{
|
||||
if (machineInfoExtended.CurrentUser == null || machineInfoExtended.CurrentUser.Username == null)
|
||||
Manager = new UserVisualize(_Machine.Manager.Just);
|
||||
Manager.LoadData();
|
||||
}
|
||||
else
|
||||
{
|
||||
Manager = null;
|
||||
}
|
||||
|
||||
if(_Machine.Manage != null)
|
||||
{
|
||||
MachineInfoExtended machineInfoExtended = await _Machine.Manage.GetMachineInfoExtended().ConfigureAwait(false);
|
||||
if (machineInfoExtended.CurrentUser.Just == null)
|
||||
{
|
||||
CurrentUser = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
CurrentUser = new UserVisualize(machineInfoExtended.CurrentUser);
|
||||
CurrentUser = new UserVisualize(machineInfoExtended.CurrentUser.Just);
|
||||
CurrentUser.LoadData();
|
||||
}
|
||||
|
||||
if (machineInfoExtended.LastUser == null || machineInfoExtended.LastUser.Username == null)
|
||||
if (machineInfoExtended.LastUser.Just == null)
|
||||
{
|
||||
LastUser = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
LastUser = new UserVisualize(machineInfoExtended.LastUser);
|
||||
LastUser = new UserVisualize(machineInfoExtended.LastUser.Just);
|
||||
LastUser.LoadData();
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ using Prism.Navigation;
|
||||
using Borepin.Service.BFFH;
|
||||
using Borepin.Base;
|
||||
using FabAccessAPI.Schema;
|
||||
using Prism.Services.Dialogs;
|
||||
using Prism.Services;
|
||||
using Prism.AppModel;
|
||||
using static FabAccessAPI.Schema.Machine;
|
||||
@ -20,16 +19,12 @@ namespace Borepin.PageModel
|
||||
public class MachineListPageModel : ConnectionModelBase, IPageLifecycleAware
|
||||
{
|
||||
#region Private Fields
|
||||
private readonly IDialogService _DialogService;
|
||||
|
||||
private Machine _NextMachine;
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
public MachineListPageModel(INavigationService navigationService, IPageDialogService pageDialogService, IBFFHService bFFHService, IDialogService dialogService) : base(navigationService, pageDialogService, bFFHService)
|
||||
public MachineListPageModel(INavigationService navigationService, IPageDialogService pageDialogService, IBFFHService bFFHService) : base(navigationService, pageDialogService, bFFHService)
|
||||
{
|
||||
_DialogService = dialogService;
|
||||
|
||||
SelectInstanceCommand = new DelegateCommand<object>(SelectInstanceCommandExecute);
|
||||
ScanCodeCommand = new DelegateCommand(async () => await ScanCodeCommandExecute().ConfigureAwait(false));
|
||||
RefreshCommand = new DelegateCommand(async ()=> await RefreshCommandExecute().ConfigureAwait(true));
|
||||
@ -49,14 +44,11 @@ namespace Borepin.PageModel
|
||||
|
||||
IsConnected = true;
|
||||
|
||||
IMachineSystem machineSystem = (await _BFFHService.GetSession().ConfigureAwait(false)).MachineSystem;
|
||||
MachineSystem.IInfoInterface machine_infoInterface = await machineSystem.Info().ConfigureAwait(false);
|
||||
MachineSystem machineSystem = (await _BFFHService.GetSession().ConfigureAwait(false)).MachineSystem;
|
||||
UserSystem userSystem = (await _BFFHService.GetSession().ConfigureAwait(false)).UserSystem;
|
||||
User user_self = await userSystem.Info.GetUserSelf().ConfigureAwait(false);
|
||||
|
||||
IUserSystem userSystem = (await _BFFHService.GetSession().ConfigureAwait(false)).UserSystem;
|
||||
UserSystem.IInfoInterface user_infoInterface = await userSystem.Info().ConfigureAwait(false);
|
||||
User user_self = (await user_infoInterface.GetUserSelf().ConfigureAwait(false)).Item1;
|
||||
|
||||
IReadOnlyList<Machine> machine_list = await machine_infoInterface.GetMachineList().ConfigureAwait(false);
|
||||
IReadOnlyList<Machine> machine_list = await machineSystem.Info.GetMachineList().ConfigureAwait(false);
|
||||
|
||||
List<MachineListItemViewModel> viewmodel_list_user_assigned = new List<MachineListItemViewModel>();
|
||||
List<MachineListItemViewModel> viewmodel_list_not_user_assigned = new List<MachineListItemViewModel>();
|
||||
@ -159,12 +151,9 @@ namespace Borepin.PageModel
|
||||
return;
|
||||
}
|
||||
|
||||
IMachineSystem machineInterface = (await _BFFHService.GetSession().ConfigureAwait(false)).MachineSystem;
|
||||
|
||||
MachineSystem machineInterface = (await _BFFHService.GetSession().ConfigureAwait(false)).MachineSystem;
|
||||
|
||||
MachineSystem.IInfoInterface infoInterface = await machineInterface.Info().ConfigureAwait(false);
|
||||
|
||||
Machine machine = await infoInterface.GetMachineURN(value).ConfigureAwait(false);
|
||||
Machine machine = (await machineInterface.Info.GetMachineURN(value).ConfigureAwait(false)).Just;
|
||||
|
||||
if(machine == null)
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ namespace Borepin.PageModel
|
||||
return;
|
||||
}
|
||||
|
||||
IMachineSystem machineSystem;
|
||||
MachineSystem machineSystem;
|
||||
try
|
||||
{
|
||||
machineSystem = (await _BFFHService.GetSession().ConfigureAwait(false)).MachineSystem;
|
||||
@ -52,9 +52,7 @@ namespace Borepin.PageModel
|
||||
return;
|
||||
}
|
||||
|
||||
IInfoInterface info = await machineSystem.Info().ConfigureAwait(false);
|
||||
|
||||
_Machine = await info.GetMachine(_ID).ConfigureAwait(false);
|
||||
_Machine = (await machineSystem.Info.GetMachine(_ID).ConfigureAwait(false)).Just;
|
||||
MachineItem = new MachineVisualize(_Machine);
|
||||
MachineItem.LoadData();
|
||||
|
||||
|
@ -13,14 +13,11 @@ namespace Borepin.PageModel
|
||||
{
|
||||
#region Private Fields
|
||||
private object _Instance;
|
||||
private readonly INavigationService _NavigationService;
|
||||
#endregion
|
||||
|
||||
#region Contructors
|
||||
public ScanPageModel(INavigationService navigationService) : base(navigationService)
|
||||
{
|
||||
_NavigationService = navigationService;
|
||||
|
||||
AbortCommand = new DelegateCommand(async () => await AbortCommandExecute().ConfigureAwait(true));
|
||||
ScannedCommand = new DelegateCommand(ScannedCommandExecute);
|
||||
|
||||
@ -32,7 +29,7 @@ namespace Borepin.PageModel
|
||||
#region Data
|
||||
public override async Task LoadData()
|
||||
{
|
||||
|
||||
await Task.CompletedTask.ConfigureAwait(false);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -76,7 +73,7 @@ namespace Borepin.PageModel
|
||||
{
|
||||
{ "result", "scanned" },
|
||||
{ "value", ScanResult.Text },
|
||||
{ "instance", _Instance }
|
||||
{ "instance", _Instance },
|
||||
};
|
||||
|
||||
Device.BeginInvokeOnMainThread(async () =>
|
||||
@ -99,7 +96,7 @@ namespace Borepin.PageModel
|
||||
INavigationParameters parameters = new NavigationParameters()
|
||||
{
|
||||
{ "result", "abort" },
|
||||
{ "instance", _Instance }
|
||||
{ "instance", _Instance },
|
||||
};
|
||||
await _NavigationService.GoBackAsync(parameters).ConfigureAwait(false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user