Ejemplo n.º 1
0
        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            MainWindow mainWindow = (MainWindow)Application.Current.MainWindow;

            if (!string.IsNullOrEmpty(PasswordBox.Password) && !string.IsNullOrEmpty(RePasswordBox.Password))
            {
                if (Check.CheckPassword(mainWindow.user, PasswordBox.Password, RePasswordBox.Password))
                {
                    MessageBoxResult result = MessageBox.Show("Changed");
                    if (NavigationService.CanGoBack)
                    {
                        NavigationService.GoBack();
                        TypeList.RefreshMainView();
                    }
                    else
                    {
                        InfoLabel.Content = "Bad Data";
                    }
                }
                else
                {
                    InfoLabel.Content = "Bad Data";
                }
            }
            else
            {
                InfoLabel.Content = "Bad Data";
            }
        }
Ejemplo n.º 2
0
        private void AddButton_Click(object sender, RoutedEventArgs e)
        {
            MainWindow mainWindow = (MainWindow)Application.Current.MainWindow;
            User       user       = mainWindow.user;
            string     type       = (string)TypeComboBox.SelectionBoxItem;

            if (!string.IsNullOrEmpty(DistanceTextBox.Text))
            {
                float distance = float.Parse(CheckData.ChengeDot(DistanceTextBox.Text));
                if (type != null && (DatePicker.SelectedDate != null && SaveDB.AddActivityToDB(user, type, distance, DatePicker.SelectedDate.Value, NoteTextBox.Text)))
                {
                    MessageBoxResult msgBoxResult = MessageBox.Show("Added");
                    if (NavigationService.CanGoBack)
                    {
                        NavigationService.GoBack();
                        TypeList.RefreshMainView();
                    }
                    else
                    {
                        InfoLabel.Content = "Bad Data";
                    }
                }
                else
                {
                    InfoLabel.Content = "Bad Data";
                }
            }
            else
            {
                InfoLabel.Content = "Bad Data";
            }
        }
Ejemplo n.º 3
0
 private void BackButton_Click(object sender, RoutedEventArgs e)
 {
     if (NavigationService.CanGoBack)
     {
         NavigationService.GoBack();
         TypeList.RefreshMainView();
     }
 }
Ejemplo n.º 4
0
        private void LoginButton_OnClick(object sender, RoutedEventArgs e)
        {
            User user = CheckData.Login(NameTextBox.Text, PasswordTextBox.Password);

            if (user == null)
            {
                InfoLabel.Content = "Bad Data";
            }
            else
            {
                MainWindow mainWindow = (MainWindow)Application.Current.MainWindow;
                mainWindow.user = user;
                Calendar.MainView mainView = new Calendar.MainView();
                mainWindow.MainView = mainView;
                TypeList.RefreshMainView();
                mainWindow.Frame.Navigate(mainView);
            }
        }
Ejemplo n.º 5
0
        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            MainWindow mainWindow = (MainWindow)Application.Current.MainWindow;

            if (Check.CheckGoal(mainWindow.user, CheckData.ChengeDot(ValueTextBox.Text)))
            {
                MessageBoxResult result = MessageBox.Show("Changed");
                if (NavigationService.CanGoBack)
                {
                    NavigationService.GoBack();
                    TypeList.RefreshMainView();
                }
            }
            else
            {
                InfoLabel.Content = "Bad Data";
            }
        }