forked from s442333/DINO_SCRUM
Merge branch 'master' of s442333/DINO_SCRUM into master
This commit is contained in:
commit
cbfd3f6797
@ -1,4 +1,4 @@
|
||||
<Window x:Class="Magazyn.MainWindow"
|
||||
<Window x:Class="Magazyn.MainWindow"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
@ -8,14 +8,13 @@
|
||||
xmlns:local="clr-namespace:Magazyn"
|
||||
mc:Ignorable="d"
|
||||
Title="Fruit Warehouse" Height="400" Width="520">
|
||||
<Grid>
|
||||
<ListBox x:Name="fruitList" Margin="10,35,10,0" Height="239" VerticalAlignment="Top"/>
|
||||
<Grid>
|
||||
<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"/>
|
||||
<TextBlock Name="payment" Margin="0,328,24,0" TextWrapping="Wrap" HorizontalAlignment="Right" Width="74" Height="16" VerticalAlignment="Top" FontWeight="Bold"/>
|
||||
<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"/>
|
||||
<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>
|
||||
</Window>
|
||||
|
@ -89,8 +89,7 @@ namespace Magazyn
|
||||
|
||||
private void Button_Click_1(object sender, RoutedEventArgs e)
|
||||
{
|
||||
payment.Text = GetWarehousePrice().Price.ToString();
|
||||
//MessageBox.Show("Value of warehouse: " + GetWarehousePrice().Price.ToString() );
|
||||
MessageBox.Show("Wartość magazynu to: " + GetWarehousePrice().Price.ToString() + "zł", "Wartość magazynu" );
|
||||
}
|
||||
|
||||
|
||||
|
@ -54,14 +54,14 @@ namespace Magazyn.Views
|
||||
{
|
||||
AmountWindow window = new AmountWindow(fruit, -1);
|
||||
window.SaveChangingAmountOfFruits += WindowSaveChangingAmountOfFruits;
|
||||
window.Show();
|
||||
window.ShowDialog();
|
||||
}
|
||||
|
||||
private void addButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
AmountWindow window = new AmountWindow(fruit, 1);
|
||||
window.SaveChangingAmountOfFruits += WindowSaveChangingAmountOfFruits;
|
||||
window.Show();
|
||||
window.ShowDialog();
|
||||
}
|
||||
|
||||
private void WindowSaveChangingAmountOfFruits(int amountChanged)
|
||||
|
@ -5,11 +5,15 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:Magazyn.Windows"
|
||||
mc:Ignorable="d"
|
||||
Title="Change Quantity" Height="100" Width="280">
|
||||
<Grid>
|
||||
<TextBlock x:Name="fruitName" HorizontalAlignment="Left" Margin="10,36,0,0" TextWrapping="Wrap" Text="fruitName" VerticalAlignment="Top" Width="64"/>
|
||||
<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"/>
|
||||
<Button x:Name="saveButton" Content="Save" Margin="175,0,10,10" VerticalAlignment="Bottom" Click="saveButton_Click" />
|
||||
Title="Change Quantity" Height="205" Width="220"
|
||||
ResizeMode="NoResize">
|
||||
<Grid>
|
||||
<TextBlock x:Name="fruitName" HorizontalAlignment="Left" Margin="10,82,0,0" TextWrapping="Wrap" Text="fruitName" Width="64" Height="16" VerticalAlignment="Top"/>
|
||||
<TextBlock x:Name="messageBox" HorizontalAlignment="Left" Margin="80,10,0,0" TextWrapping="Wrap" Text="messageBox" VerticalAlignment="Top" Width="125" Height="64"/>
|
||||
<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>
|
||||
|
@ -33,6 +33,17 @@ namespace Magazyn.Windows
|
||||
this.type = type;
|
||||
|
||||
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)
|
||||
@ -49,5 +60,10 @@ namespace Magazyn.Windows
|
||||
SaveChangingAmountOfFruits.Invoke((type>0)?amount:-amount);
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void cancelButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user