Beispiel #1
0
        private void ManoButton(object sender, RoutedEventArgs e)
        {
            Loading();
            IsEnabled = false;
            ManoSaskaitos manoSaskaitos = new ManoSaskaitos(vartotojasSaved, keySaved);

            manoSaskaitos.Show();
            Close();
        }
Beispiel #2
0
        private async void PateiktiButton(object sender, RoutedEventArgs e)
        {
            if (vartotojasSaved.Saskaitos.Count == 9)
            {
                generalEventText.Content = "Jūs turite maksimalų skaičių sąskaitų!";
                return;
            }
            if (kodoTextBox.Password != vartotojasSaved.ShortSecurityCode.ToString())
            {
                generalEventText.Content = "Neteisingas 4-ių skaičių kodas!";
                return;
            }
            if (pavadinimoTextBox.Text == "")
            {
                generalEventText.Content = "Pavadinimas negali likti tuščias!";
                return;
            }

            IsEnabled = false;
            Loading();
            Panel.SetZIndex(greyedOut, 9);
            Saskaita naujaSaskaita = new Saskaita(pavadinimoTextBox.Text, CreateIban(), 0, DateTime.Now.Date);

            vartotojasSaved.Saskaitos.Add(naujaSaskaita);
            await client.UpdateAsync("Paskyros/" + keySaved, vartotojasSaved);

            closeBackground.Visibility       = Visibility.Collapsed;
            closeButton.Visibility           = Visibility.Collapsed;
            patvirtintiBackround.Visibility  = Visibility.Collapsed;
            patvirtintiButton.Visibility     = Visibility.Collapsed;
            SukurimasDescription.Visibility  = Visibility.Collapsed;
            SukurtiLabel.Visibility          = Visibility.Collapsed;
            sukurtiWindow.Visibility         = Visibility.Collapsed;
            greyedOut.Visibility             = Visibility.Collapsed;
            kodoTextBox.Visibility           = Visibility.Collapsed;
            kodoDescription.Visibility       = Visibility.Collapsed;
            pavadinimoDescription.Visibility = Visibility.Collapsed;
            pavadinimoTextBox.Visibility     = Visibility.Collapsed;
            underLine_1.Visibility           = Visibility.Collapsed;
            underLine_2.Visibility           = Visibility.Collapsed;
            generalEventText.Visibility      = Visibility.Collapsed;
            kodoTextBox.Clear();
            generalEventText.Content = "";
            pavadinimoTextBox.Clear();
            var manoSaskaitos = new ManoSaskaitos(vartotojasSaved, keySaved);

            manoSaskaitos.Show();
            Close();
        }
        private async void DeleteButton(object sender, RoutedEventArgs e)
        {
            Button button = sender as Button;

            IsEnabled = false;
            Loading();
            int nr = int.Parse(button.Name[13].ToString());

            vartotojasSaved.Saskaitos[0].Likutis += vartotojasSaved.Saskaitos[nr].Likutis;
            vartotojasSaved.Saskaitos.RemoveAt(nr);
            await client.UpdateAsync("Paskyros/" + keySaved, vartotojasSaved);

            var manoSaskaitos = new ManoSaskaitos(vartotojasSaved, keySaved);

            manoSaskaitos.Show();
            Close();
        }