Commit be4ce77f authored by islater's avatar islater
Browse files

asdf

parent f0848c4c
......@@ -27,9 +27,13 @@ namespace CowboyCafe.Data
set
{
size = value;
if(PropertyChanged!=null)
PropertyChanged.Invoke(this, new PropertyChangedEventArgs("Size"));
}
}
/// <summary>
/// Returns the items price
/// </summary>
......
......@@ -28,7 +28,8 @@ namespace CowboyCafe.Data
{
size = value;
PropertyChanged.Invoke(this, new PropertyChangedEventArgs("Size"));
if (PropertyChanged != null)
PropertyChanged.Invoke(this, new PropertyChangedEventArgs("Size"));
}
}
/// <summary>
......
......@@ -26,7 +26,8 @@ namespace CowboyCafe.Data
set
{
size = value;
PropertyChanged.Invoke(this, new PropertyChangedEventArgs("Size"));
if (PropertyChanged != null)
PropertyChanged.Invoke(this, new PropertyChangedEventArgs("Size"));
}
}
/// <summary>
......
......@@ -27,7 +27,8 @@ namespace CowboyCafe.Data
set
{
size = value;
PropertyChanged.Invoke(this, new PropertyChangedEventArgs("Size"));
if (PropertyChanged != null)
PropertyChanged.Invoke(this, new PropertyChangedEventArgs("Size"));
}
}
......
......@@ -34,6 +34,7 @@ namespace CowboyCafe.Data
set
{
size = value;
if (PropertyChanged != null)
PropertyChanged.Invoke(this, new PropertyChangedEventArgs("Size"));
}
}
......
using System;
using System.Collections.Generic;
using System.Text;
namespace CowboyCafe.Data
{
public static class Menu
{
private static List<IOrderItem> entrees;
private static List<IOrderItem> sides;
private static List<IOrderItem> drinks;
static Menu()
{
entrees = new List<IOrderItem>();
sides = new List<IOrderItem>();
drinks = new List<IOrderItem>();
entrees.Add(new AngryChicken());
entrees.Add(new CowpokeChili());
entrees.Add(new RustlersRibs());
entrees.Add(new PecosPulledPork());
entrees.Add(new TexasTripleBurger());
entrees.Add(new DakotaDoubleBurger());
sides.Add(new BakedBeans());
sides.Add(new ChiliCheeseFries());
sides.Add(new CornDodgers());
sides.Add(new PanDeCampo());
drinks.Add(new CowboyCoffee());
drinks.Add(new JerkedSoda());
drinks.Add(new TexasTea());
drinks.Add(new Water());
}
public static IEnumerable<IOrderItem> Entrees() { return entrees; }
public static IEnumerable<IOrderItem> Sides() { return sides; }
public static IEnumerable<IOrderItem> Drinks() { return drinks; }
}
}
......@@ -25,7 +25,8 @@ namespace CowboyCafe.Data
get { return size; }
set
{
PropertyChanged.Invoke(this, new PropertyChangedEventArgs("Size"));
if (PropertyChanged != null)
PropertyChanged.Invoke(this, new PropertyChangedEventArgs("Size"));
size = value;
}
}
......
......@@ -27,6 +27,8 @@ namespace CowboyCafe.Data
/// </summary>
public virtual IEnumerable<Size> SizeValues => Enum.GetValues(typeof(Size)).Cast<Size>();
/// <summary>
/// Gets the price of the side
/// </summary>
......@@ -37,6 +39,7 @@ namespace CowboyCafe.Data
/// </summary>
public abstract uint Calories { get; }
public virtual List<string> SpecialInstructions { get => new List<string>(); }
}
}
......@@ -28,7 +28,8 @@ namespace CowboyCafe.Data
set
{
size = value;
PropertyChanged.Invoke(this, new PropertyChangedEventArgs("Size"));
if (PropertyChanged != null)
PropertyChanged.Invoke(this, new PropertyChangedEventArgs("Size"));
}
}
......
......@@ -29,7 +29,8 @@ namespace CowboyCafe.Data
set
{
size = value;
PropertyChanged.Invoke(this, new PropertyChangedEventArgs("Size"));
if (PropertyChanged != null)
PropertyChanged.Invoke(this, new PropertyChangedEventArgs("Size"));
}
}
......
@page
@using CowboyCafe.Data
@model IndexModel
@{
ViewData["Title"] = "Home page";
}
<div class="text-center">
<h1 class="display-4">Welcome</h1>
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
</div>
<div class="text-center">
<h1 class="display-4">Welcome</h1>
<p>We at Cowboy Cafe are proud to bring you authentic trail meals from the American West. Shake off the dust on your boots and sake your thirst with one of our old-fashioned hand-jerked sodas. Dip your Pan de Campo into a bowl of beans. Or conquer the the mighty Texas Triple Burger! You’ve had a hard ride - so take it easy with us.</p>
@*<div class="Menu-items">*@
<div class="entrees">
<h2>Entrees</h2>
@foreach (Entree entree in Menu.Entrees())
{
@entree.ToString()
<span>Price: </span>@entree.Price
<span>Calories: </span>@entree.Calories<br><br />
}
</div>
<div class="sides">
<h2>Sides</h2>
@foreach (Side sides in Menu.Sides())
{
{@sides.ToString().Substring(6)}<br />
<span>Price | Small: $</span>@sides.Price
{ sides.Size = Size.Medium; }
<span> Medium: $</span>@sides.Price
{ sides.Size = Size.Large; }
<span> Large: $</span>@sides.Price<br />
{ sides.Size = Size.Small; }
<span>Calories | Small: </span>@sides.Calories
{ sides.Size = Size.Medium; }
<span> Medium: </span>@sides.Calories
{ sides.Size = Size.Large; }
<span> Large: </span>@sides.Calories<br /><br />
}
</div>
<div class="drinks">
<h2>Drinks</h2>
@foreach (Drink drinks in Menu.Drinks())
{
{@drinks.ToString().Substring(6)}<br />
<span>Price | Small: $</span>@drinks.Price
{ drinks.Size = Size.Medium; }
<span> Medium: $</span>@drinks.Price
{ drinks.Size = Size.Large; }
<span> Large: $</span>@drinks.Price<br />
{ drinks.Size = Size.Small; }
<span>Calories | Small: </span>@drinks.Calories
{ drinks.Size = Size.Medium; }
<span> Medium: </span>@drinks.Calories
{ drinks.Size = Size.Large; }
<span> Large: </span>@drinks.Calories<br /><br />
}
@*</div>*@
</div>
</div>
\ No newline at end of file
......@@ -5,6 +5,7 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
using CowboyCafe.Data;
namespace Website.Pages
{
......@@ -17,6 +18,11 @@ namespace Website.Pages
_logger = logger;
}
public void nop()
{
}
public void OnGet()
{
......
@using Website
@using System.Collections.Generic
@using CowboyCafe.Data
@namespace Website.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
......@@ -18,4 +18,15 @@
<None Include="wwwroot\Pictures\Chuckwagon_Texas_1900.jpg" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Data\Data.csproj" />
<ProjectReference Include="..\PointOfSale\PointOfSale.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="CowboyCafe.Data">
<HintPath>..\Data\bin\Debug\netcoreapp3.1\CowboyCafe.Data.dll</HintPath>
</Reference>
</ItemGroup>
</Project>
/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
for details on configuring this project to bundle and minify static web assets. */
/*.entress {
width: 55%;
margin-right: 2%;
float: left;
}
.sides {
width: 42%;
float: left;
}
.drinks {
float: right;
width: 25%;
height: 280px;
}
.Menu-items {
text-align: center;
}*/
a.navbar-brand {
white-space: normal;
text-align: center;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment