forked from s442333/DINO_SCRUM
Poprawa obslugi komunikatow bledu
This commit is contained in:
parent
23e1fd4ef7
commit
9e7aa5b697
@ -21,23 +21,3 @@
|
||||
</Grid>
|
||||
</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>-->
|
||||
|
@ -77,17 +77,21 @@ namespace Magazyn.Windows
|
||||
|
||||
if ((quantity + amount > maxAmount) && amount >= 0 && type == 1)
|
||||
{
|
||||
MessageBox.Show("Przepełnienie magazynu", "Przepełnienie, maxymalnie 2500 sztuk", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
MessageBox.Show("Przepełnienie magazynu", "Przepełnienie, maksymalnie 2500 sztuk", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
amountToChange.Text = "0";
|
||||
return;
|
||||
|
||||
} else if ((quantity - amount < 0) && amount >= 0 && type == -1)
|
||||
{
|
||||
MessageBox.Show("Niedobór magazynu", "Ilość przedmiotów nie możę być mniejsza niz 0", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
amountToChange.Text = "0";
|
||||
return;
|
||||
} else
|
||||
{
|
||||
SaveChangingAmountOfFruits.Invoke((type > 0) ? amount : -amount);
|
||||
this.Close();
|
||||
}
|
||||
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void cancelButton_Click(object sender, RoutedEventArgs e)
|
||||
|
Loading…
Reference in New Issue
Block a user