added column headers, fixed window start up position, changed colors, added "zł" to price, disabled windows resizing, changed size of main window #9
@ -1,4 +1,5 @@
|
||||
<Window x:Class="Magazyn.MainWindow"
|
||||
Name ="main"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
@ -7,14 +8,40 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:Magazyn"
|
||||
mc:Ignorable="d"
|
||||
Title="Fruit Warehouse" Height="400" Width="520">
|
||||
<Grid>
|
||||
<ListBox x:Name="fruitList" Margin="10,35,10,95"/>
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Title="Fruit Warehouse" Height="469.85" Width="837.599">
|
||||
<Grid>
|
||||
<ListBox x:Name="fruitList" Margin="10,99,10.666,69.667" Grid.ColumnSpan="3"/>
|
||||
<!--<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="Name"/>
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="Quantity"/>
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="Price / 1 pc."/>
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="Overall price"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="0" Text="{Binding ...}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>-->
|
||||
<Button Name="sum" Content="Wartość Magazynu" Margin="0,0,9.666,9.667" Height="35" Background="Teal" Click="Button_Click_1" HorizontalAlignment="Right" Width="164" VerticalAlignment="Bottom" Grid.ColumnSpan="2" Grid.Column="1"/>
|
||||
<ProgressBar Name="loadingContent" HorizontalAlignment="Right" Height="10" Margin="0,0,10.666,54.667" Width="100" VerticalAlignment="Bottom" Grid.ColumnSpan="2" Grid.Column="1"/>
|
||||
<Label Content="Fruit list:" FontWeight="Bold" HorizontalAlignment="Left" Margin="10,4,0,0" VerticalAlignment="Top" Width="100"/>
|
||||
<Grid Height="64" Margin="0,0,-0.334,346.667" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="831" Grid.ColumnSpan="3" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="128*"/>
|
||||
<ColumnDefinition Width="149*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock HorizontalAlignment="Left" Margin="125,28,0,0" VerticalAlignment="Top" Name="fruitName" TextWrapping="Wrap" Text="NAZWA" Width="116" FontSize="16" FontWeight="Bold" FontFamily="Segoe UI Black"/>
|
||||
<TextBlock x:Name="fruitQuantity" Margin="280,28,0,17" HorizontalAlignment="Left" TextWrapping="Wrap" Text="LICZBA" Width="137" FontSize="16" FontWeight="Bold" FontFamily="Segoe UI Black" Grid.ColumnSpan="2"/>
|
||||
<TextBlock Name="fruitPrice" Margin="54,28,235.333,0" Text="CENA / 1 SZT." VerticalAlignment="Top" IsEnabled="False" Height="20" FontSize="16" FontWeight="Bold" FontFamily="Segoe UI Black" Grid.Column="1"/>
|
||||
<TextBlock x:Name="allPrice" Margin="217,28,37.333,0" Text="CENA / ŁĄCZNIE" VerticalAlignment="Top" Height="19" FontSize="16" FontWeight="Bold" FontFamily="Segoe UI Black" Grid.Column="1"/>
|
||||
|
||||
|
||||
<Button Name="sum" Content="Wartość Magazynu" Margin="0,0,10,10" Height="35" Background="Teal" Click="Button_Click_1" HorizontalAlignment="Right" Width="164" VerticalAlignment="Bottom"/>
|
||||
<ProgressBar Name="loadingContent" HorizontalAlignment="Right" Height="10" Margin="0,0,10,80" Width="100" VerticalAlignment="Bottom"/>
|
||||
<Label Content="Fruit list:" FontWeight="Bold" HorizontalAlignment="Left" Margin="10,4,0,0" VerticalAlignment="Top" Width="100"/>
|
||||
</Grid>
|
||||
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
@ -29,6 +29,7 @@ namespace Magazyn
|
||||
{
|
||||
InitializeComponent();
|
||||
loadingContent.IsIndeterminate = true;
|
||||
|
||||
client = new HttpClient();
|
||||
RefreshListOfFruits();
|
||||
}
|
||||
@ -65,19 +66,19 @@ namespace Magazyn
|
||||
UpdateListOfFruits(fruits);
|
||||
}
|
||||
|
||||
private void UpdateListOfFruits(Fruit[] list)
|
||||
{
|
||||
fruitList.Items.Clear();
|
||||
private void UpdateListOfFruits(Fruit[] list)
|
||||
{
|
||||
fruitList.Items.Clear();
|
||||
|
||||
foreach (Fruit item in list)
|
||||
{
|
||||
FruitView fruitView = new FruitView(item);
|
||||
fruitView.SaveChangingAmountOfFruits += FruitViewSaveChangingAmountOfFruits;
|
||||
fruitList.Items.Add(fruitView);
|
||||
}
|
||||
}
|
||||
foreach (Fruit item in list)
|
||||
{
|
||||
FruitView fruitView = new FruitView(item);
|
||||
fruitView.SaveChangingAmountOfFruits += FruitViewSaveChangingAmountOfFruits;
|
||||
fruitList.Items.Add(fruitView);
|
||||
}
|
||||
}
|
||||
|
||||
private WarehousePrice GetWarehousePrice()
|
||||
private WarehousePrice GetWarehousePrice()
|
||||
{
|
||||
Task<HttpResponseMessage> response = client.GetAsync("https://sysmag.herokuapp.com/api/get-price-of-all");
|
||||
while (response.IsCompleted != true) ;
|
||||
|
@ -6,34 +6,21 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Magazyn.Views"
|
||||
mc:Ignorable="d" Height="64" Width="520">
|
||||
mc:Ignorable="d" Height="64" Width="782.692">
|
||||
|
||||
|
||||
<materialDesign:Card Height="64" Background="Teal">
|
||||
<!--<materialDesign:Card Height="64" Background="Teal">-->
|
||||
<Grid Height="64">
|
||||
<Image Name="fruitImage" HorizontalAlignment="Left" Margin="10,10,0,7" Width="50"/>
|
||||
<TextBlock Name="fruitName" HorizontalAlignment="Left" Margin="80,26,0,0" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top" Width="116"/>
|
||||
<TextBlock Name="fruitName" HorizontalAlignment="Left" Margin="73,28,0,0" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top" Width="116" TextAlignment="Center"/>
|
||||
<Image Name="minusImage" HorizontalAlignment="Left" Height="24" Margin="240,25,0,0" VerticalAlignment="Top" Width="24" Source="/Images/minus.png" MouseDown="subButton_Click" />
|
||||
<Image Name="plusImage" HorizontalAlignment="Left" Height="24" Margin="304,25,0,0" VerticalAlignment="Top" Width="24" Source="/Magazyn;component/Images/plus.png" RenderTransformOrigin="0.208,0.521" MouseDown="addButton_Click"/>
|
||||
<TextBlock Name="fruitAmount" HorizontalAlignment="Left" Margin="267,29,0,19" Width="34" TextAlignment="Center" RenderTransformOrigin="0.489,-0.623"/>
|
||||
<TextBlock Name="fruitPrice" Margin="362,26,106,0" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top" IsEnabled="False"/>
|
||||
<TextBlock x:Name="allPrice" Margin="425,26,43,0" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top"/>
|
||||
<TextBlock Name="fruitPrice" Margin="403,25,252.667,0" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top" IsEnabled="False" TextAlignment="Center"/>
|
||||
<TextBlock x:Name="allPrice" Margin="578,25,80.667,0" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top" TextAlignment="Center"/>
|
||||
|
||||
</Grid>
|
||||
</materialDesign:Card>
|
||||
<!--</materialDesign:Card>-->
|
||||
|
||||
<!--<Grid>
|
||||
<TextBlock x:Name="fruitName" HorizontalAlignment="Left" Margin="69,0,0,48" TextWrapping="Wrap" Text="fruitName" Width="72"/>
|
||||
<Button x:Name="subButton" BorderThickness="0" Padding="0" HorizontalAlignment="Left" Margin="138,21,0,27" Width="16" Click="subButton_Click" Background="{x:Null}">
|
||||
<Image Source="..\Images\sub.png" Stretch="Fill"/>
|
||||
</Button>
|
||||
<Button x:Name="addButton" BorderThickness="0" Padding="0" HorizontalAlignment="Left" Margin="180,21,0,27" Width="16" Click="addButton_Click" Background="{x:Null}">
|
||||
<Image Source="..\Images\add.png"/>
|
||||
</Button>
|
||||
<TextBlock x:Name="fruitAmount" HorizontalAlignment="Left" Margin="159,21,0,27" TextWrapping="Wrap" Text="-1" TextAlignment="Center" Width="16"/>
|
||||
<TextBlock x:Name="fruitPrice" HorizontalAlignment="Left" Margin="69,21,0,27" TextWrapping="Wrap" Text="fruitPrice" Width="64"/>
|
||||
<Image x:Name="imges" HorizontalAlignment="Left" Height="64" VerticalAlignment="Top" Width="64"/>
|
||||
<TextBlock x:Name="allPrice" HorizontalAlignment="Left" Margin="206,48,0,0" TextWrapping="Wrap" Text="allPrice" TextAlignment="Center" VerticalAlignment="Top" Width="48"/>
|
||||
|
||||
</Grid>-->
|
||||
</UserControl>
|
||||
|
@ -37,8 +37,8 @@ namespace Magazyn.Views
|
||||
|
||||
fruitName.Text = fruit.Name;
|
||||
fruitAmount.Text = fruit.Quantity.ToString();
|
||||
fruitPrice.Text = fruit.Price.ToString();
|
||||
allPrice.Text = (fruit.Quantity * fruit.Price).ToString();
|
||||
fruitPrice.Text = fruit.Price.ToString() + "zł";
|
||||
allPrice.Text = (fruit.Quantity * fruit.Price).ToString() + "zł";
|
||||
|
||||
try
|
||||
{
|
||||
@ -60,7 +60,7 @@ namespace Magazyn.Views
|
||||
private void addButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
AmountWindow window = new AmountWindow(fruit, 1);
|
||||
window.SaveChangingAmountOfFruits += WindowSaveChangingAmountOfFruits;
|
||||
window.SaveChangingAmountOfFruits += WindowSaveChangingAmountOfFruits;
|
||||
window.ShowDialog();
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
xmlns:local="clr-namespace:Magazyn.Windows"
|
||||
mc:Ignorable="d"
|
||||
Title="Change Quantity" Height="205" Width="220"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
ResizeMode="NoResize">
|
||||
<Grid>
|
||||
<TextBlock x:Name="fruitName" HorizontalAlignment="Left" Margin="10,82,0,0" TextWrapping="Wrap" Text="fruitName" Width="64" Height="16" VerticalAlignment="Top"/>
|
||||
@ -13,7 +14,6 @@
|
||||
<TextBox x:Name="amountToChange" Margin="0,71,9,0" TextWrapping="Wrap" Text="0" RenderTransformOrigin="1.456,0.316" Height="32" VerticalAlignment="Top" HorizontalAlignment="Right" Width="64"/>
|
||||
<Button x:Name="saveButton" Content="Zastosuj" Margin="105,122,0,0" VerticalAlignment="Top" Click="saveButton_Click" Width="90" HorizontalAlignment="Left"/>
|
||||
<Button x:Name="cancelButton" Content="Anuluj" Margin="10,122,0,0" VerticalAlignment="Top" Click="cancelButton_Click" Width="90" HorizontalAlignment="Left" />
|
||||
<Image x:Name="fruitImage" HorizontalAlignment="Left" Height="64" Margin="10,10,0,0" VerticalAlignment="Top" Width="64"/>
|
||||
|
||||
</Grid>
|
||||
<Image x:Name="fruitImage" HorizontalAlignment="Left" Height="64" Margin="10,10,0,0" VerticalAlignment="Top" Width="64"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
Loading…
Reference in New Issue
Block a user