private async Task OnClockOut() { try { var userConfirmation = await Alert.ShowMessageConfirmation( nameof(AppResources.AreYouSureYouWantToClockOut).Translate() , $"{nameof(AppResources.PackingSlip).Translate()} {_packingSlip.Key}" , nameof(AppResources.Yes).Translate(), nameof(AppResources.No).Translate()); if (!userConfirmation) { return; } IsBusy = true; var date = DateTimeOffset.Now; var context = new PostDriverClockInOutContext { PackingSlipKey = _packingSlip.Key, ClockInOutAction = PostDriverClockInOutContextClockInOutAction.ClockOut, AccountNo = _packingSlip.Account.Key }; var result = await Api.PostDriverClockInOut(context); if (!result.Successful.GetValueOrDefault()) { await Alert.DisplayApiCallError(result.ExceptionMessage, result.ValidationErrors, $"-{Translate.Get(nameof(AppResources.ServerError))}"); return; } _packingSlip.ClockOutDateTime = date; RaisePropertyChanged(nameof(ShowClockIn)); RaisePropertyChanged(nameof(ShowClockOut)); } catch (Exception e) { await Alert.DisplayError(e); } finally { IsBusy = false; } }
public Task <ApiResponseOfBoolean> PostDriverClockInOut(PostDriverClockInOutContext context) { return(AXClient.Instance.PostDriverClockInOutAsync(context)); }