f0bea75284
All the changes necessary to save shopping cart to DB
100 lines
4.4 KiB
XML
100 lines
4.4 KiB
XML
<UserControl x:Class="RMWPFUserInterface.Views.SalesView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:local="clr-namespace:RMWPFUserInterface.Views"
|
|
mc:Ignorable="d" Background="White" FontSize="24"
|
|
d:DesignHeight="550" d:DesignWidth="800">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="auto"/>
|
|
<RowDefinition Height="auto" />
|
|
<RowDefinition Height="auto" />
|
|
<RowDefinition Height="auto" />
|
|
<RowDefinition Height="auto" />
|
|
<RowDefinition Height="auto" />
|
|
<RowDefinition Height="auto" />
|
|
<RowDefinition Height="auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="auto"/>
|
|
<ColumnDefinition Width="auto"/>
|
|
<ColumnDefinition Width="auto"/>
|
|
<ColumnDefinition Width="auto"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<!-- Header -->
|
|
<TextBlock Text="Sales Page" FontSize="48"
|
|
Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3"
|
|
Margin="0 0 0 30"/>
|
|
<!-- Column 0 -->
|
|
<TextBlock Text="Items" Grid.Row="1" Grid.Column="0"/>
|
|
<ListBox x:Name="Products" Grid.Row="2" Grid.Column="0"
|
|
MinHeight="200" MinWidth="150" SelectedItem="{Binding SelectedProduct}">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<StackPanel Orientation="Vertical">
|
|
<TextBlock Text="{Binding ProductName}"/>
|
|
<StackPanel Orientation="Horizontal">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Text="Price : " FontSize="14"/>
|
|
<TextBlock Text="{ Binding RetailPrice, StringFormat='{}{0:C}'}" FontSize="14"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Margin="5 0 0 0 ">
|
|
<TextBlock Text="Quantity : " FontSize="14"/>
|
|
<TextBlock Text="{ Binding QuantityInStock}" FontSize="14"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
|
|
<!-- Column 1 -->
|
|
<StackPanel Orientation="Vertical" Grid.Column="1"
|
|
Grid.Row="2" Margin="20 0" >
|
|
<TextBlock Text="Quantity" />
|
|
<TextBox x:Name="ItemQuantity" MinWidth="100" Margin="0 0 0 10"/>
|
|
<Button x:Name="AddToCart" Content="Add to Cart" Margin="0 0 0 30"
|
|
Padding="5"/>
|
|
<Button x:Name="RemoveFromCart" Content="Remove from Cart"
|
|
Padding="5"/>
|
|
</StackPanel>
|
|
|
|
<!-- Column 2 -->
|
|
<TextBlock Text="Cart" Grid.Row="1" Grid.Column="2"/>
|
|
<ListBox x:Name="Cart" Grid.Row="2" Grid.Column="2"
|
|
MinHeight="200" MinWidth="150">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding DisplayText}"/>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
|
|
<DockPanel Grid.Row="3" Grid.Column="2">
|
|
<TextBlock Text="SubTotal: " Margin="0 0 15 0"/>
|
|
<TextBlock x:Name="SubTotal" Text="$0.00"
|
|
TextAlignment="Right"/>
|
|
</DockPanel>
|
|
|
|
<DockPanel Grid.Row="4" Grid.Column="2">
|
|
<TextBlock Text="Tax: " />
|
|
<TextBlock x:Name="Tax" Text="$0.00"
|
|
TextAlignment="Right"/>
|
|
</DockPanel>
|
|
|
|
<DockPanel Grid.Row="5" Grid.Column="2">
|
|
<TextBlock Text="Total: " />
|
|
<TextBlock x:Name="Total" Text="$0.00"
|
|
TextAlignment="Right"/>
|
|
</DockPanel>
|
|
|
|
<Button x:Name="CheckOut" Grid.Row="6" Grid.Column="2"
|
|
Content="Check Out"
|
|
Margin="0 20 0 0" Padding="5"/>
|
|
</Grid>
|
|
</UserControl>
|