Example #1
0
        private void LogOutButton_TouchUpInside(object sender, EventArgs e)
        {
            LogOutButton.Enabled = false;
            var alertLoading = AlertControllerHelper.ShowAlertLoading();

            PresentViewController(alertLoading, true, async() =>
            {
                if (App.CurrentUserEnvironment.Device != null)
                {
                    if (await App.Locator.Login.Disconnect(App.CurrentUserEnvironment.Device.UidDevice) == 1)
                    {
                        var oneSignal = (ServiceLocator.Current.GetInstance <IOneSignal>());
                        oneSignal.DeleteTag(App.CurrentUserEnvironment.User.IdUser.ToString() + (DataService.UseStaging ? "s" : "p"));
                        oneSignal.SetSubscription(false);
                        DismissViewController(false, () =>
                        {
                            UIApplication.SharedApplication.KeyWindow.RootViewController = UIStoryboard.FromName("Main", null).InstantiateViewController("LoginView");
                        });
                    }
                }
                else
                {
                    DismissViewController(false, null);
                }
            });
        }
Example #2
0
 /// <summary>
 /// Delete the seekios
 /// </summary>
 private async void DeleteButton_TouchUpInside(object sender, EventArgs e)
 {
     if (await AlertControllerHelper.ShowAlert(Application.LocalizedString("Delete")
                                               , Application.LocalizedString("SureToDeleteSeekios")
                                               , Application.LocalizedString("Yes")
                                               , Application.LocalizedString("No")) == 0)
     {
         // display the loading layout
         var alertLoading = AlertControllerHelper.ShowAlertLoading();
         PresentViewController(alertLoading, true, async() =>
         {
             if (await App.Locator.DetailSeekios.DeleteSeekios() == 1)
             {
                 DismissViewController(false, () =>
                 {
                     App.Locator.AddSeekios.IsGoingBack = true;
                     App.Locator.AddSeekios.IsAdding    = true;
                     GoBack(true);
                 });
             }
             else
             {
                 DismissViewController(false, null);
             }
         });
     }
 }
 public void ShowLoadingLayout()
 {
     if (CurrentViewController == null)
     {
         throw new Exception("CurrentViewController can not be null in DialogService");
     }
     CurrentViewController.PresentViewController(AlertControllerHelper.ShowAlertLoading(), true, null);
 }
        /// <summary>
        /// Event to save the alert
        /// </summary>
        private async void SaveButton_TouchUpInside(object sender, EventArgs e)
        {
            var isFieldsValid = true;

            // verification title alert
            if (string.IsNullOrEmpty(AlertTitleTextField.Text))
            {
                AlertTitleTextField.Layer.BorderColor = UIColor.FromRGB(255, 76, 57).CGColor;
                isFieldsValid = false;
            }
            else
            {
                AlertTitleTextField.Layer.BorderColor = UIColor.FromRGB(229, 229, 229).CGColor;
            }
            // verification message alert
            if (string.IsNullOrEmpty(AlertMessageTextField.Text))
            {
                AlertMessageTextField.Layer.BorderColor = UIColor.FromRGB(255, 76, 57).CGColor;
                isFieldsValid = false;
            }
            else
            {
                AlertMessageTextField.Layer.BorderColor = UIColor.FromRGB(229, 229, 229).CGColor;
            }
            // verification recipients
            if (App.Locator.AlertSOS.LsRecipients.Count == 0)
            {
                ViewBehindScrollView.Layer.BorderColor = UIColor.FromRGB(255, 76, 57).CGColor;
                isFieldsValid = false;
            }
            else
            {
                ViewBehindScrollView.Layer.BorderColor = UIColor.FromRGB(229, 229, 229).CGColor;
            }
            // add the alert in the view model
            if (isFieldsValid)
            {
                SaveButton.Enabled = false;
                // display the loading layout
                var alertLoading = AlertControllerHelper.ShowAlertLoading();
                PresentViewController(alertLoading, true, null);
                if (await App.Locator.AlertSOS.InsertOrUpdateAlertSOS(AlertTitleTextField.Text, AlertMessageTextField.Text))
                {
                    alertLoading.DismissViewController(true, null);
                }
                else
                {
                    alertLoading.DismissViewController(true, null);
                    SaveButton.Enabled = true;
                }
            }
        }
Example #5
0
        public override void SetDataAndStyleToView()
        {
            Title = Application.LocalizedString("TransactionTitle");
            NoCreditLabel.Text = Application.LocalizedString("TransactionNoCredit");
            // display the loading layout
            var alertLoading = AlertControllerHelper.ShowAlertLoading();

            PresentViewController(alertLoading, true, async() =>
            {
                await App.Locator.TransactionHistoric.GetTransactionHistoricByUser();
                Tableview.Source = new HistoriqueSource(this);
                Tableview.Hidden = false;
                RefreshTable();
                DismissViewController(false, null);
                alertLoading.DismissViewController(false, null);
            });
        }