Interaction logic for EventsScreen.xaml
Inheritance: System.Windows.Controls.Page
コード例 #1
0
        private void ExecuteSave(object sender, ExecutedRoutedEventArgs e)
        {
            if (!this._vm.CanSave)
            {
                this.statusMessage.Content = "Please ensure that all event and programme information has been entered correctly.";
                Storyboard sb = (Storyboard)this.FindResource("StatusMessageFadeIn");
                this.statusMessage.BeginStoryboard(sb);
            }
            else
            {
                if (this._vm.Save())
                {
                    // Redirect back to Event Main screen with notify box showing that it has been saved.
                    SessionModel.GetInstance().StatusCode = SessionModel.STATUS_NOTICE;
                    if (this._vm.IsNewEvent)
                    {
                        SessionModel.GetInstance().StatusMessage = "Your event has been successfully created.";
                    }
                    else
                    {
                        SessionModel.GetInstance().StatusMessage = "Your event has been successfully edited.";
                    }

                    EventsView eventsScreen = new EventsView();
                    eventsScreen.SetupNavigationHandler(this.NavigationService);
                    this.NavigationService.Navigate(eventsScreen);
                }
            }
        }
コード例 #2
0
        private void cancelButton_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult result = MessageBox.Show("Are you sure you wish to cancel? Any unsaved changes will be lost!", "Cancel", MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (result == MessageBoxResult.Yes)
            {
                // Redirect back to Event Main screen with notify box showing that it is cancelled.
                EventsView eventsScreen = new EventsView();
                eventsScreen.SetupNavigationHandler(this.NavigationService);
                this.NavigationService.Navigate(eventsScreen);
            }
        }
コード例 #3
0
        private void LoginButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            this._vm.Login.Password = this.passwordText.Password;

            if (this._vm.ValidateUser())
            {
                SessionModel.GetInstance().StatusCode = SessionModel.STATUS_NOTICE;
                SessionModel.GetInstance().StatusMessage = "You have successfully logged in. Welcome!";

                EventsView eventsScreen = new EventsView();
                eventsScreen.SetupNavigationHandler(this.NavigationService);
                this.NavigationService.Navigate(eventsScreen);
            }
            else
            {
                MessageBox.Show(
                    "Your matriculation number and password were not recognized. Please check and try again.",
                    "Authentication Failed",
                    MessageBoxButton.OK,
                    MessageBoxImage.Exclamation
                );
            }
        }
コード例 #4
0
        private void LoginButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            this._vm.Login.Password = this.passwordText.Password;

            if (this._vm.ValidateUser())
            {
                SessionModel.GetInstance().StatusCode    = SessionModel.STATUS_NOTICE;
                SessionModel.GetInstance().StatusMessage = "You have successfully logged in. Welcome!";

                EventsView eventsScreen = new EventsView();
                eventsScreen.SetupNavigationHandler(this.NavigationService);
                this.NavigationService.Navigate(eventsScreen);
            }
            else
            {
                MessageBox.Show(
                    "Your matriculation number and password were not recognized. Please check and try again.",
                    "Authentication Failed",
                    MessageBoxButton.OK,
                    MessageBoxImage.Exclamation
                    );
            }
        }
コード例 #5
0
        private void cancelButton_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult result = MessageBox.Show("Are you sure you wish to cancel? Any unsaved changes will be lost!", "Cancel", MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (result == MessageBoxResult.Yes)
            {
                // Redirect back to Event Main screen with notify box showing that it is cancelled.
                EventsView eventsScreen = new EventsView();
                eventsScreen.SetupNavigationHandler(this.NavigationService);
                this.NavigationService.Navigate(eventsScreen);
            }
        }
コード例 #6
0
        private void ExecuteSave(object sender, ExecutedRoutedEventArgs e)
        {
            if (!this._vm.CanSave)
            {
                this.statusMessage.Content = "Please ensure that all event and programme information has been entered correctly.";
                Storyboard sb = (Storyboard)this.FindResource("StatusMessageFadeIn");
                this.statusMessage.BeginStoryboard(sb);
            }
            else
            {
                if (this._vm.Save())
                {
                    // Redirect back to Event Main screen with notify box showing that it has been saved.
                    SessionModel.GetInstance().StatusCode = SessionModel.STATUS_NOTICE;
                    if (this._vm.IsNewEvent)
                    {
                        SessionModel.GetInstance().StatusMessage = "Your event has been successfully created.";
                    }
                    else
                    {
                        SessionModel.GetInstance().StatusMessage = "Your event has been successfully edited.";
                    }

                    EventsView eventsScreen = new EventsView();
                    eventsScreen.SetupNavigationHandler(this.NavigationService);
                    this.NavigationService.Navigate(eventsScreen);
                }
            }
        }
コード例 #7
0
 public void SetEventsScreen(EventsView p)
 {
     this._eventsView = p;
 }