I'm trying to make a program which reserves and shows available and unavailable seats for an "event". The errors I'm getting are as follows:
'System.Nullable' does not contain a definition for 'Yes' and no extension method 'Yes' accepting a first argument of type 'System.Nullable' could be found (are you missing a using directive or an assembly reference?)
(Same goes for "No") and
'System.Windows.Window.DialogResult' is a 'property' but is used like a 'type'.
This is what I have so far:
private void btnSeat1_Click(object sender, RoutedEventArgs e)
{
if (!Seat1)
{
DialogResult Result = MessageBox.Show("This Seat is Available, Would you like to pick it?", "Would you like this seat?", MessageBoxButton.YesNo, MessageBoxImage.Question);
if (Result == DialogResult.Yes)
{
MessageBox.Show("You Reserved this seat");
btnSeat1.Text = "Reserved";
}
else if (Result == DialogResult.No)
{
Environment.Exit(0);
}
Note: I only used Environment.Exit as a placeholder. It was intentional and will be changed accordingly. It isn't the source of the problem.