private void backButton_Click(object sender, RoutedEventArgs e)
        {
            Popup p = this.Parent as Popup;

            HideAnnim.Begin();
            p.IsOpen = false;
        }
Esempio n. 2
0
        private async void OkButton_Click(object sender, RoutedEventArgs e)
        {
            if (mailEntry.Text == string.Empty || !mailEntry.Text.Contains("@"))
            {
                setError("Mail");
                return;
            }

            Classes.Request.Auth.ResetPassword resetPassword = new Classes.Request.Auth.ResetPassword();

            resetPassword.SetParam(mailEntry.Text);
            try
            {
                var result = await resetPassword.GetJsonAsync();

                Popup p = this.Parent as Popup;
                HideAnnim.Begin();

                p.IsOpen = false;
            }
            catch (System.Net.Http.HttpRequestException ex)
            {
                setError("Error Network");
                Debug.WriteLine(ex);
            }
            catch (Newtonsoft.Json.JsonException jEx)
            {
                setError("Error Json");

                Debug.WriteLine(jEx);
            }
        }
        private async void OkButton_Click(object sender, RoutedEventArgs e)
        {
            Classes.Request.Auth.Register register = new Classes.Request.Auth.Register();

            if (passOneEntry.Password != passTwoEntry.Password)
            {
                setError("password");
                return;
            }


            if (firstnameEntry.Text == string.Empty)
            {
                setError("FistName");
                return;
            }

            if (mailEntry.Text == string.Empty || !mailEntry.Text.Contains("@"))
            {
                setError("Mail");
                return;
            }



            register.SetParam(mailEntry.Text, passOneEntry.Password, firstnameEntry.Text);

            try
            {
                var obj = await register.GetJsonAsync();

                Popup p = this.Parent as Popup;
                HideAnnim.Begin();

                p.IsOpen = false;
            }
            catch (System.Net.Http.HttpRequestException ex)
            {
                setError("Error Network");
                Debug.WriteLine(ex);
            }
            catch (Newtonsoft.Json.JsonException jEx)
            {
                setError("Error Json");

                Debug.WriteLine(jEx);
            }
        }