1
0
forked from s434786/DINO_SCRUM

Merge branch 'master' of s442333/DINO_SCRUM into master

This commit is contained in:
s1202077 2019-01-17 15:30:52 +00:00 committed by Gogs
commit cbfd3f6797
5 changed files with 36 additions and 18 deletions

View File

@ -1,4 +1,4 @@
<Window x:Class="Magazyn.MainWindow" <Window x:Class="Magazyn.MainWindow"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
TextElement.Foreground="{DynamicResource MaterialDesignBody}" TextElement.Foreground="{DynamicResource MaterialDesignBody}"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
@ -9,11 +9,10 @@
mc:Ignorable="d" mc:Ignorable="d"
Title="Fruit Warehouse" Height="400" Width="520"> Title="Fruit Warehouse" Height="400" Width="520">
<Grid> <Grid>
<ListBox x:Name="fruitList" Margin="10,35,10,0" Height="239" VerticalAlignment="Top"/> <ListBox x:Name="fruitList" Margin="10,35,10,95"/>
<Button Name="sum" Content="Sum" Margin="0,288,24,0" Height="35" Background="Teal" Click="Button_Click_1" HorizontalAlignment="Right" Width="74" VerticalAlignment="Top"/> <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"/>
<TextBlock Name="payment" Margin="0,328,24,0" TextWrapping="Wrap" HorizontalAlignment="Right" Width="74" Height="16" VerticalAlignment="Top" FontWeight="Bold"/> <ProgressBar Name="loadingContent" HorizontalAlignment="Right" Height="10" Margin="0,0,10,80" Width="100" VerticalAlignment="Bottom"/>
<ProgressBar Name="loadingContent" HorizontalAlignment="Left" Height="10" Margin="304,294,0,0" VerticalAlignment="Top" Width="100"/>
<Label Content="Fruit list:" FontWeight="Bold" HorizontalAlignment="Left" Margin="10,4,0,0" VerticalAlignment="Top" Width="100"/> <Label Content="Fruit list:" FontWeight="Bold" HorizontalAlignment="Left" Margin="10,4,0,0" VerticalAlignment="Top" Width="100"/>

View File

@ -89,8 +89,7 @@ namespace Magazyn
private void Button_Click_1(object sender, RoutedEventArgs e) private void Button_Click_1(object sender, RoutedEventArgs e)
{ {
payment.Text = GetWarehousePrice().Price.ToString(); MessageBox.Show("Wartość magazynu to: " + GetWarehousePrice().Price.ToString() + "zł", "Wartość magazynu" );
//MessageBox.Show("Value of warehouse: " + GetWarehousePrice().Price.ToString() );
} }

View File

@ -54,14 +54,14 @@ namespace Magazyn.Views
{ {
AmountWindow window = new AmountWindow(fruit, -1); AmountWindow window = new AmountWindow(fruit, -1);
window.SaveChangingAmountOfFruits += WindowSaveChangingAmountOfFruits; window.SaveChangingAmountOfFruits += WindowSaveChangingAmountOfFruits;
window.Show(); window.ShowDialog();
} }
private void addButton_Click(object sender, RoutedEventArgs e) private void addButton_Click(object sender, RoutedEventArgs e)
{ {
AmountWindow window = new AmountWindow(fruit, 1); AmountWindow window = new AmountWindow(fruit, 1);
window.SaveChangingAmountOfFruits += WindowSaveChangingAmountOfFruits; window.SaveChangingAmountOfFruits += WindowSaveChangingAmountOfFruits;
window.Show(); window.ShowDialog();
} }
private void WindowSaveChangingAmountOfFruits(int amountChanged) private void WindowSaveChangingAmountOfFruits(int amountChanged)

View File

@ -5,11 +5,15 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Magazyn.Windows" xmlns:local="clr-namespace:Magazyn.Windows"
mc:Ignorable="d" mc:Ignorable="d"
Title="Change Quantity" Height="100" Width="280"> Title="Change Quantity" Height="205" Width="220"
ResizeMode="NoResize">
<Grid> <Grid>
<TextBlock x:Name="fruitName" HorizontalAlignment="Left" Margin="10,36,0,0" TextWrapping="Wrap" Text="fruitName" VerticalAlignment="Top" Width="64"/> <TextBlock x:Name="fruitName" HorizontalAlignment="Left" Margin="10,82,0,0" TextWrapping="Wrap" Text="fruitName" Width="64" Height="16" VerticalAlignment="Top"/>
<TextBox x:Name="amountToChange" HorizontalAlignment="Left" Margin="74,0,0,10" TextWrapping="Wrap" Text="0" Width="64" Height="32" VerticalAlignment="Bottom" RenderTransformOrigin="1.456,0.316"/> <TextBlock x:Name="messageBox" HorizontalAlignment="Left" Margin="80,10,0,0" TextWrapping="Wrap" Text="messageBox" VerticalAlignment="Top" Width="125" Height="64"/>
<Button x:Name="saveButton" Content="Save" Margin="175,0,10,10" VerticalAlignment="Bottom" Click="saveButton_Click" /> <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> </Grid>
</Window> </Window>

View File

@ -33,6 +33,17 @@ namespace Magazyn.Windows
this.type = type; this.type = type;
fruitName.Text = fruit.Name; fruitName.Text = fruit.Name;
messageBox.Text = String.Format("Jaką ilość produktu chcesz {0} do magazynu?", (type > 0) ? "dodać":"odjąć");
try
{
fruitImage.Source = new BitmapImage(new Uri(fruit.ImageLink));
}
catch (Exception ex)
{
}
} }
private void saveButton_Click(object sender, RoutedEventArgs e) private void saveButton_Click(object sender, RoutedEventArgs e)
@ -49,5 +60,10 @@ namespace Magazyn.Windows
SaveChangingAmountOfFruits.Invoke((type>0)?amount:-amount); SaveChangingAmountOfFruits.Invoke((type>0)?amount:-amount);
this.Close(); this.Close();
} }
private void cancelButton_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
} }
} }