Exemplo n.º 1
0
        private void backButton_Click(object sender, RoutedEventArgs e)
        {
            Memory_Selection memoryMenu = new Memory_Selection();

            memoryMenu.Show();
            this.Close();
        }
        private void menuButton_Click(object sender, RoutedEventArgs e)
        {
            Memory_Selection menuWindow = new Memory_Selection();

            menuWindow.Show();
            this.Close();
        }
Exemplo n.º 3
0
        private void updateFlag()
        {
            String updateQuery = "UPDATE memory SET displayed=0 WHERE memory_id=" + memoryId;

            bool errorOccurred = false;

            MySqlConnection mySQLCon         = new MySqlConnection();
            MySqlConnection connectionString = new MySqlConnection("Server=localhost;Database=bomber_command;Uid=root;Pwd=IBCCProject17;");

            try
            {
                MySqlCommand command = connectionString.CreateCommand();
                command.CommandText = updateQuery;
                connectionString.Open();
                command.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                // ex.Message;
                errorOccurred = true;
                MessageBox.Show("An error has occurred in writing the data. Please report this to an administrator.");
                MessageBox.Show(ex.Message);
            }
            finally
            {
                connectionString.Close();
            }

            if (!errorOccurred)
            {
                Popup1.IsOpen = false;
                MessageBox.Show("Successfully removed inappropriate entry. Thank you for your assistance!");

                Memory_Selection memoryScreen = new Memory_Selection();
                memoryScreen.Show();
                this.Close();
            }
            else
            {
                Popup1.IsOpen = false;
                MessageBox.Show("A problem occurred in removing the memory. Please inform a member of staff.");
            }
        }