private void BackToPositiveEffectsRegister(object sender, TappedRoutedEventArgs e)
        { // Save changes to checkboxes before navigating back
            PagesUtilities.GetAllCheckBoxesTags(RegisterNegativeEffectsGrid,
                                                out List <int> intList);
            GlobalContext.RegisterContext.IntNegativePreferences = intList;

            Frame.Navigate(typeof(RegisterPositiveEffectsPage));
        }
        private void ContinuePositiveEffectsRegister(object sender, TappedRoutedEventArgs e)
        { // Save changes to checkboxes and continue
            PagesUtilities.GetAllCheckBoxesTags(RegisterMedicalGrid,
                                                out List <int> intList);

            GlobalContext.RegisterContext.IntListMedicalNeeds = intList;

            Frame.Navigate(typeof(RegisterPositiveEffectsPage), GlobalContext.RegisterContext);
        }
        private void BackToRegister(object sender, TappedRoutedEventArgs e)
        { // Save changes to checkboxes before navigating back
            PagesUtilities.GetAllCheckBoxesTags(RegisterMedicalGrid,
                                                out List <int> intList);

            GlobalContext.RegisterContext.IntListMedicalNeeds = intList;

            Frame.Navigate(typeof(RegisterPage));
        }
예제 #4
0
        private void ContinueNegativeEffectsRegister(object sender, TappedRoutedEventArgs e)
        {
            PagesUtilities.GetAllCheckBoxesTags(RegisterPositiveEffectsGrid,
                                                out List <int> intList);

            GlobalContext.RegisterContext.IntPositivePreferences = intList;

            Frame.Navigate(typeof(RegisterNegativeEffectsPage));
        }
        private async void Register(object sender, RoutedEventArgs e)
        {
            HttpResponseMessage res = null;

            try
            { // Build register request
                progressRing.IsActive = true;

                // Get negative checkboxes
                PagesUtilities.GetAllCheckBoxesTags(RegisterNegativeEffectsGrid,
                                                    out List <int> intList);

                GlobalContext.RegisterContext.IntNegativePreferences = intList;

                // Send request with register information
                res = await HttpManager.Manager.Post(Constants.MakeUrl("register"), GlobalContext.RegisterContext);


                if (res != null)
                { // Request succeeded
                    var content = res.GetContent();

                    switch (res.StatusCode)
                    { // Register succeeded
                    case HttpStatusCode.Created:
                    case HttpStatusCode.OK:
                        Status.Text = "Register Successful!";
                        PagesUtilities.SleepSeconds(1);
                        Frame.Navigate(typeof(DashboardPage), res);
                        break;

                    // Register failed
                    case HttpStatusCode.BadRequest:
                        Status.Text = "Register failed!\n" + content["message"];
                        break;

                    default:
                        Status.Text = "Error!\n" + content["message"];
                        break;
                    }
                }
                else
                {
                    Status.Text = "Register failed!\nPost operation failed";
                }
            }
            catch (Exception exc)
            {
                AppDebug.Exception(exc, "Register");
            }
            finally
            {
                progressRing.IsActive = false;
            }
        }