1
0
forked from s442333/DINO_SCRUM

Zmiany po upstream

This commit is contained in:
Mati 2019-01-21 19:48:10 +01:00
commit 23e1fd4ef7
6 changed files with 59 additions and 8 deletions

View File

@ -13,6 +13,8 @@
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>

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"
@ -20,3 +20,24 @@
</Grid> </Grid>
</Window> </Window>
<!--<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"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
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"/>
<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>
</Window>-->

View File

@ -90,7 +90,11 @@ namespace Magazyn
private void Button_Click_1(object sender, RoutedEventArgs e) private void Button_Click_1(object sender, RoutedEventArgs e)
{ {
MessageBox.Show("Wartość magazynu: " + GetWarehousePrice().Price.ToString() );
MessageBox.Show("Wartość magazynu to: " + GetWarehousePrice().Price.ToString() + "zł", "Wartość magazynu" );
} }

View File

@ -54,14 +54,14 @@ namespace Magazyn.Views
{ {
AmountWindow window = new AmountWindow(fruit, -1, fruit.Quantity); AmountWindow window = new AmountWindow(fruit, -1, fruit.Quantity);
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, fruit.Quantity); AmountWindow window = new AmountWindow(fruit, 1, fruit.Quantity);
window.SaveChangingAmountOfFruits += WindowSaveChangingAmountOfFruits; window.SaveChangingAmountOfFruits += WindowSaveChangingAmountOfFruits;
window.Show(); window.ShowDialog();
} }
private void WindowSaveChangingAmountOfFruits(int amountChanged) private void WindowSaveChangingAmountOfFruits(int amountChanged)

View File

@ -6,10 +6,14 @@
xmlns:local="clr-namespace:Magazyn.Windows" xmlns:local="clr-namespace:Magazyn.Windows"
mc:Ignorable="d" mc:Ignorable="d"
Title="Magazyn" Height="100" Width="280"> Title="Magazyn" Height="100" Width="280">
<Grid>
<TextBlock x:Name="fruitName" HorizontalAlignment="Left" Margin="10,36,0,0" TextWrapping="Wrap" Text="fruitName" VerticalAlignment="Top" Width="64"/> <Grid>
<TextBox x:Name="amountToChange" HorizontalAlignment="Left" Margin="85,0,0,10" TextWrapping="Wrap" Text="0" Width="64" Height="32" VerticalAlignment="Bottom" RenderTransformOrigin="1.456,0.316"/> <TextBlock x:Name="fruitName" HorizontalAlignment="Left" Margin="10,82,0,0" TextWrapping="Wrap" Text="fruitName" Width="64" Height="16" VerticalAlignment="Top"/>
<Button x:Name="saveButton" Content="Zapisz" Margin="175,0,10,10" VerticalAlignment="Bottom" Click="saveButton_Click" /> <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> </Window>

View File

@ -34,12 +34,27 @@ namespace Magazyn.Windows
InitializeComponent(); InitializeComponent();
this.fruit = fruit; this.fruit = fruit;
this.type = type; this.type = type;
this.quantity = quantity; this.quantity = quantity;
if (type == -1) if (type == -1)
this.Title = "Zmniejsz ilość " + fruit.Name; this.Title = "Zmniejsz ilość " + fruit.Name;
else else
this.Title = "Zwiększ ilość " + fruit.Name; this.Title = "Zwiększ ilość " + fruit.Name;
fruitName.Text = fruit.Name; 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)
@ -74,5 +89,10 @@ namespace Magazyn.Windows
this.Close(); this.Close();
} }
private void cancelButton_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
} }
} }