Esempio n. 1
0
        /// <summary>
        /// Handle the start of the visit.
        /// </summary>
        /// @author Gabriele Ursini
        async void handleVisit(Object sender, EventArgs e)
        {
            if (!current.isThereAVisitInProgress)
            {
                var startRequest = await current.startVisitAsync();

                if (!startRequest.isSuccessFull())
                {
                    await App.mainPage.DisplayAlert("Error", startRequest.message, "Ok");

                    return;
                }
                removeStartDemoButton();
                this.start_visit_button.Text = "End Visit";
                this.createVisitView(current.current);
            }
            else
            {
                var endRequest = await current.endVisitAsync();

                if (!endRequest.isSuccessFull())
                {
                    await App.mainPage.DisplayAlert("Error", endRequest.message, "Ok");

                    return;
                }

                this.showStartDemoButton();
                this.start_visit_button.Text = "Start a Visit";
                this.hideVisitView();
            }
        }