void PopUpForceCheckOut()
        {
            var alert = UIAlertController.Create("Forcar CheckOut",
                                                 "Existem tarefas ainda nao concluidas na lista, gostaria de realizar o checkout ? ",
                                                 UIAlertControllerStyle.Alert);

            alert.AddAction(UIAlertAction.Create("Nao", UIAlertActionStyle.Cancel, (actionCancel) =>
            {
                MetricsManager.TrackEvent("CancelForceCheckOut");
            }));

            alert.AddAction(UIAlertAction.Create("Sim", UIAlertActionStyle.Default, (actionOK) =>
            {
                controller.CheckOutTarefa();
#if !DEBUG
                MetricsManager.TrackEvent("ForceCheckOut");
#endif
                if (Storyboard.InstantiateViewController("FeedPDV") is PDVBarController listPdvs)
                {
                    ShowViewController(listPdvs, null);
                }
            }));
            alert.View.TintColor = UIColor.FromRGB(10, 88, 90);
            PresentViewController(alert, true, null);
        }
Esempio n. 2
0
        protected override void OnResume()
        {
            isToRunning = true;
            base.OnResume();
            if (modelActivity != null)
            {
                model.myToolbar         = modelActivity.myToolbar;
                model.gps               = modelActivity.gps;
                model.dialog            = modelActivity.dialog;
                model.dbGenericActivity = modelActivity.dbGenericActivity;
            }
            modelActivity.gps.UpdateLocation();

            if (controller.HasVisitaAntigaAtiva())
            {
                controller.CheckOutTarefa();
                model      = null;
                controller = null;
                var i       = new Intent(this, typeof(MenuPdvs));
                var options = ActivityOptions.MakeSceneTransitionAnimation(this,
                                                                           Pair.Create(FindViewById(Resource.Id.profile_image_tarefa), "profileImage"),
                                                                           Pair.Create(FindViewById(Resource.Id.profileLayout), "profileBar"),
                                                                           Pair.Create(FindViewById(Resource.Id.toolbar), "toolbar"));
                StartActivity(i, options.ToBundle());
            }
            else
            {
                RunOnUiThread(() =>
                {
                    PopulateProgressBar();
                    PopulateTarefas();
                    CheckOutTarefas();
                });
            }
        }