コード例 #1
0
        private void create_kit_button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                checkMandatoryFields();
                DataTable toRequest = verifyUnits();

                MessageBoxResult confirm = System.Windows.MessageBox.Show(
                    "Do you confirm the kit creation?",
                    "Kit Creation Confirmation",
                    MessageBoxButton.YesNo,
                    MessageBoxImage.Question
                    );
                if (confirm == MessageBoxResult.Yes)
                {
                    Kit kit = submitKitCreation(toRequest);
                    System.Windows.MessageBox.Show("Kit has been succesfully created!");
                    StaffWindow window = (StaffWindow)Window.GetWindow(this);
                    window.goToKitPage(kit, true);
                }
            }
            catch (SqlException exc)
            {
                Helpers.ShowCustomDialogBox(exc);
            }
            catch (Exception exc)
            {
                System.Windows.MessageBox.Show(exc.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
コード例 #2
0
        private void kit_info_Click(object sender, RoutedEventArgs e)
        {
            // Go to selected kit's page
            Kit         kit    = (Kit)(sender as Button).DataContext;
            StaffWindow window = (StaffWindow)Window.GetWindow(this);

            window.goToKitPage(kit);
        }