internal void ConnectToFptr_OnClick(object sender, EventArgs e) { if (!Settings.EnableFPTR) { Toast.MakeToast(Translator.Translate("fr_disable")); return; } if (!DBHelper.CheckRole(nameof(WebactionsEnum.MobileFPRAccess))) { Toast.MakeToast(Translator.Translate("fr_role_disable")); return; } if (_readonlyForIos) { Toast.MakeToast(Translator.Translate("Функциональность не поддерживается на iOS")); return; } Dialog.ShowProgressDialog(Translator.Translate("please_wait"), true); TaskFactory.RunTaskWithTimeout(() => { try { if (_fptr.CurrentStatus >= 0) { _fptr.Beep(); ChangeLayoutsAsync(); } else { _fptr.PutDeviceSettings(_fptr.Settings); _fptr.PutDeviceEnabled(true); ChangeLayoutsAsync(); Utils.TraceMessage($"{nameof(_fptr.CurrentStatus)}: {_fptr.CurrentStatus}"); } } catch (FPTRException fptrException) { Utils.TraceMessage($"ExceptionMessage: {fptrException.Message}" + $" ResultCode: {fptrException.Result}"); Application.InvokeOnMainThread(() => Toast.MakeToast(fptrException.Message)); } }, FptrAction.DefaultTimeOut, result => { if (result.Finished) { Dialog.HideProgressDialog(); return; } Utils.TraceMessage($"Change status to offline"); Application.InvokeOnMainThread(() => ChangeLayoutStatus(-1)); Dialog.HideProgressDialog(); Application.InvokeOnMainThread(() => Toast.MakeToast(Translator.Translate("сonnection_error"))); }); }
internal void PrintZ_OnClick(object sender, EventArgs e) { if (!Settings.EnableFPTR) { Toast.MakeToast(Translator.Translate("fr_disable")); return; } if (!DBHelper.CheckRole(nameof(WebactionsEnum.MobileFPRAccess))) { Toast.MakeToast(Translator.Translate("fr_role_disable")); return; } if (_readonlyForIos) { Toast.MakeToast(Translator.Translate("Функциональность не поддерживается на iOS")); return; } Dialog.Ask(Translator.Translate("printZ_caption_ask"), (o, args) => { if (args.Result == Dialog.Result.No) { return; } Dialog.ShowProgressDialog(Translator.Translate("please_wait"), true); TaskFactory.RunTaskWithTimeout(() => { try { _fptr.PrintZ(); } catch (FPTRException exception) { Toast.MakeToast(exception.Message); } }, FptrAction.PrintingTimeOut, result => { if (result.Finished) { Dialog.HideProgressDialog(); return; } Application.InvokeOnMainThread(() => ChangeLayoutStatus(-1)); Dialog.HideProgressDialog(); Application.InvokeOnMainThread(() => Toast.MakeToast(Translator.Translate("сonnection_error"))); }); }); }
internal void Logout_OnClick(object sender, EventArgs e) { Dialog.Ask(Translator.Translate("exit"), (o, args) => { if (args.Result != Dialog.Result.Yes) { return; } Dialog.ShowProgressDialog(Translator.Translate("logout_message"), true); Logout(); }); }
internal void TopInfo_RightButton_OnClick(object sender, EventArgs e) { DConsole.WriteLine("GO to map"); DConsole.WriteLine("Before dictionary"); var dictionary = new Dictionary <string, object> { { Parameters.IdScreenStateId, MapScreenStates.EventListScreen } }; DConsole.WriteLine("After"); BusinessProcess.GlobalVariables[Parameters.IdScreenStateId] = MapScreenStates.EventListScreen; Dialog.ShowProgressDialog(Translator.Translate("loading_message"), true); Navigation.Move("MapScreen", dictionary); }
internal void Print_OnClick(object sender, EventArgs e) { _enteredSumEditText.Enabled = false; var checkParameters = new Event_EventFiskalProperties { Id = DbRef.CreateInstance($"Document_{nameof(Event_EventFiskalProperties)}" , Guid.NewGuid()), Ref = DbRef.FromString(_eventId), User = Settings.UserDetailedInfo.Id }; Dialog.ShowProgressDialog(Translator.Translate("please_wait"), true); TaskFactory.RunTaskWithTimeout(() => { var checkError = false; try { PrintCheck(); if (_fptr.CloseCheck() < 0) { _fptr.CheckError(); } checkParameters.Date = DateTime.Now; DBHelper.SaveEntity(checkParameters, false); } catch (FPTRException exception) { Utils.TraceMessage($"Error code {exception.Result} {exception.Message}"); checkError = true; Toast.MakeToast(Translator.Translate(exception.Message)); } catch (Exception exception) { Utils.TraceMessage($"{exception.Message}{Environment.NewLine}" + $"Type {exception.GetType()}"); } Utils.TraceMessage($"Check Error: {checkError}"); if (!checkError) { SaveFptrParameters(checkParameters); BusinessProcess.GlobalVariables[Parameters.IdCurrentEventId] = _eventId; Utils.TraceMessage($"GoTo {nameof(COCScreen)}"); Application.InvokeOnMainThread(() => { Navigation.ModalMove(nameof(COCScreen), new Dictionary <string, object> { { Parameters.IdCurrentEventId, _eventId }, { Parameters.IdIsReadonly, _readonly }, { Parameters.IdWasEventStarted, _wasStarted } }); }); } else { try { DBHelper.DeleteByRef(checkParameters.Id, false); _fptr.CancelCheck(); } catch (FPTRException exception) { Toast.MakeToast(Translator.Translate(exception.Message)); } finally { if (_choosedPaymentType == 0) { Application.InvokeOnMainThread(() => _enteredSumEditText.Enabled = true); } } } }, FptrAction.PrintingTimeOut, result => { if (result.Finished) { Dialog.HideProgressDialog(); return; } Dialog.HideProgressDialog(); Toast.MakeToast(Translator.Translate("сonnection_error")); }); }
internal void TopInfo_LeftButton_OnClick(object sender, EventArgs e) { Dialog.ShowProgressDialog(Translator.Translate("loading_message"), true); Navigation.Back(); }
internal void TabBarSecondTabButton_OnClick(object sender, EventArgs eventArgs) { Dialog.ShowProgressDialog(Translator.Translate("loading_message"), true); _tabBarComponent.Clients_OnClick(sender, eventArgs); }
internal void TopInfo_LeftButton_OnClick(object sender, EventArgs e) { DConsole.WriteLine("Back to screen ....."); Dialog.ShowProgressDialog(Translator.Translate("loading_message"), true); Navigation.Back(); }
internal void TabBarFirstTabButton_OnClick(object sender, EventArgs eventArgs) { Dialog.ShowProgressDialog(Translator.Translate("loading_message"), true); _tabBarComponent.Events_OnClick(sender, eventArgs); DConsole.WriteLine("Bag Events"); }