Skip to content

Commit

Permalink
Point of Sale Milestone 1 Complete.
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertOstermann committed Oct 14, 2019
1 parent 75c5719 commit 4eec274
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 7 deletions.
9 changes: 6 additions & 3 deletions PointOfSale/DrinkSelection.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,26 @@
Sodasaurus
</TextBlock>
</Button>
<Button Style="{StaticResource SimpleButton}" Grid.Row="1" Name="TyrannoteaButton">
<Button Style="{StaticResource SimpleButton}" Grid.Row="1"
Name="TyrannoteaButton" Click="SelectTyrannotea">
<Button.Background>
<ImageBrush ImageSource="Assets/DinoDiner-13.png" Opacity="0.25"/>
</Button.Background>
<TextBlock Style="{StaticResource SimpleTextBlock}">
Tyrannotea
</TextBlock>
</Button>
<Button Style="{StaticResource SimpleButton}" Grid.Row="2" Name="JurassicJavaButton">
<Button Style="{StaticResource SimpleButton}" Grid.Row="2"
Name="JurassicJavaButton" Click="SelectJurrasicJava">
<Button.Background>
<ImageBrush ImageSource="Assets/DinoDiner-12.png" Opacity="0.25"/>
</Button.Background>
<TextBlock Style="{StaticResource SimpleTextBlock}">
Jurrasic Java
</TextBlock>
</Button>
<Button Style="{StaticResource SimpleButton}" Grid.Row="3" Name="WaterButton">
<Button Style="{StaticResource SimpleButton}" Grid.Row="3"
Name="WaterButton" Click="SelectWater">
<Button.Background>
<ImageBrush ImageSource="Assets/DinoDiner-15.png" Opacity="0.25"/>
</Button.Background>
Expand Down
98 changes: 95 additions & 3 deletions PointOfSale/DrinkSelection.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ public DrinkSelection()
SelectDecafButton.IsEnabled = false;
SelectDecafButton.Visibility = Visibility.Hidden;
SelectFlavorButton.IsEnabled = false;
SelectFlavorButton.Visibility = Visibility.Hidden;
SelectFlavorButton.Visibility = Visibility.Visible;
WaterButton.BorderBrush = Brushes.LightGreen;
WaterButton.BorderThickness = new Thickness(2.5);
//WaterButton.ClearValue(Control.BorderBrushProperty);
//WaterButton.ClearValue(Control.BorderThicknessProperty);
}

/// <summary>
Expand All @@ -65,6 +63,7 @@ private void SelectSodasaurus(object obj, RoutedEventArgs args)
SelectDecafButton.Visibility = Visibility.Hidden;
SelectFlavorButton.IsEnabled = true;
SelectFlavorButton.Visibility = Visibility.Visible;
AddLemonButton.IsEnabled = false;
SodasaurusButton.BorderBrush = Brushes.LightGreen;
SodasaurusButton.BorderThickness = new Thickness(2.5);

Expand All @@ -76,6 +75,99 @@ private void SelectSodasaurus(object obj, RoutedEventArgs args)
WaterButton.ClearValue(Control.BorderThicknessProperty);
}

/// <summary>
/// Sets the drink to tyrannotea.
/// Enables the sweet button.
/// Enables the lemon button.
/// </summary>
/// <param name="obj"></param>
/// <param name="args"></param>
private void SelectTyrannotea(object obj, RoutedEventArgs args)
{
Drink = new Tyrannotea();
SmallButton.Background = Brushes.LightGreen;
MediumButton.ClearValue(Control.BackgroundProperty);
LargeButton.ClearValue(Control.BackgroundProperty);
SelectSweetButton.IsEnabled = true;
SelectSweetButton.Visibility = Visibility.Visible;
SelectDecafButton.IsEnabled = false;
SelectDecafButton.Visibility = Visibility.Hidden;
SelectFlavorButton.IsEnabled = false;
SelectFlavorButton.Visibility = Visibility.Hidden;
AddLemonButton.IsEnabled = true;
TyrannoteaButton.BorderBrush = Brushes.LightGreen;
TyrannoteaButton.BorderThickness = new Thickness(2.5);

SodasaurusButton.ClearValue(Control.BorderBrushProperty);
SodasaurusButton.ClearValue(Control.BorderThicknessProperty);
JurassicJavaButton.ClearValue(Control.BorderBrushProperty);
JurassicJavaButton.ClearValue(Control.BorderThicknessProperty);
WaterButton.ClearValue(Control.BorderBrushProperty);
WaterButton.ClearValue(Control.BorderThicknessProperty);
}

/// <summary>
/// Sets the drink to Jurrasic Java.
/// Enables the Decaf button.
/// Disables the lemon button.
/// </summary>
/// <param name="obj"></param>
/// <param name="args"></param>
private void SelectJurrasicJava(object obj, RoutedEventArgs args)
{
Drink = new JurassicJava();
SmallButton.Background = Brushes.LightGreen;
MediumButton.ClearValue(Control.BackgroundProperty);
LargeButton.ClearValue(Control.BackgroundProperty);
SelectSweetButton.IsEnabled = false;
SelectSweetButton.Visibility = Visibility.Hidden;
SelectDecafButton.IsEnabled = true;
SelectDecafButton.Visibility = Visibility.Visible;
SelectFlavorButton.IsEnabled = false;
SelectFlavorButton.Visibility = Visibility.Hidden;
AddLemonButton.IsEnabled = false;
JurassicJavaButton.BorderBrush = Brushes.LightGreen;
JurassicJavaButton.BorderThickness = new Thickness(2.5);

SodasaurusButton.ClearValue(Control.BorderBrushProperty);
SodasaurusButton.ClearValue(Control.BorderThicknessProperty);
TyrannoteaButton.ClearValue(Control.BorderBrushProperty);
TyrannoteaButton.ClearValue(Control.BorderThicknessProperty);
WaterButton.ClearValue(Control.BorderBrushProperty);
WaterButton.ClearValue(Control.BorderThicknessProperty);
}

/// <summary>
/// Sets the drink to Water.
/// Disables Decaf/Sweet/Flavor buttons.
/// Enables the lemon button.
/// </summary>
/// <param name="obj"></param>
/// <param name="args"></param>
private void SelectWater(object obj, RoutedEventArgs args)
{
Drink = new Water();
SmallButton.Background = Brushes.LightGreen;
MediumButton.ClearValue(Control.BackgroundProperty);
LargeButton.ClearValue(Control.BackgroundProperty);
SelectSweetButton.IsEnabled = false;
SelectSweetButton.Visibility = Visibility.Hidden;
SelectDecafButton.IsEnabled = false;
SelectDecafButton.Visibility = Visibility.Hidden;
SelectFlavorButton.IsEnabled = false;
SelectFlavorButton.Visibility = Visibility.Visible;
AddLemonButton.IsEnabled = true;
WaterButton.BorderBrush = Brushes.LightGreen;
WaterButton.BorderThickness = new Thickness(2.5);

SodasaurusButton.ClearValue(Control.BorderBrushProperty);
SodasaurusButton.ClearValue(Control.BorderThicknessProperty);
TyrannoteaButton.ClearValue(Control.BorderBrushProperty);
TyrannoteaButton.ClearValue(Control.BorderThicknessProperty);
JurassicJavaButton.ClearValue(Control.BorderBrushProperty);
JurassicJavaButton.ClearValue(Control.BorderThicknessProperty);
}

/// <summary>
/// Navigate to the FlavorSelection page.
/// </summary>
Expand Down
5 changes: 4 additions & 1 deletion PointOfSale/FlavorSelection.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System;
/* FlavorSelection.xaml.cs
* Author: Robert Ostermann
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down

0 comments on commit 4eec274

Please sign in to comment.