diff --git a/Magazyn_Client/Magazyn/App.xaml b/Magazyn_Client/Magazyn/App.xaml
index 4ce9918..7e77365 100644
--- a/Magazyn_Client/Magazyn/App.xaml
+++ b/Magazyn_Client/Magazyn/App.xaml
@@ -4,6 +4,13 @@
xmlns:local="clr-namespace:Magazyn"
StartupUri="MainWindow.xaml">
-
+
+
+
+
+
+
+
+
diff --git a/Magazyn_Client/Magazyn/Images/minus.png b/Magazyn_Client/Magazyn/Images/minus.png
new file mode 100644
index 0000000..15f03cc
Binary files /dev/null and b/Magazyn_Client/Magazyn/Images/minus.png differ
diff --git a/Magazyn_Client/Magazyn/Images/plus.png b/Magazyn_Client/Magazyn/Images/plus.png
new file mode 100644
index 0000000..b501bf8
Binary files /dev/null and b/Magazyn_Client/Magazyn/Images/plus.png differ
diff --git a/Magazyn_Client/Magazyn/Magazyn.csproj b/Magazyn_Client/Magazyn/Magazyn.csproj
index 14f524c..ea2bb93 100644
--- a/Magazyn_Client/Magazyn/Magazyn.csproj
+++ b/Magazyn_Client/Magazyn/Magazyn.csproj
@@ -34,6 +34,12 @@
4
+
+ ..\packages\MaterialDesignColors.1.1.1\lib\net45\MaterialDesignColors.dll
+
+
+ ..\packages\MaterialDesignThemes.2.5.0.1205\lib\net45\MaterialDesignThemes.Wpf.dll
+
..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll
@@ -117,5 +123,11 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Magazyn_Client/Magazyn/MainWindow.xaml b/Magazyn_Client/Magazyn/MainWindow.xaml
index b9f660d..33ff95d 100644
--- a/Magazyn_Client/Magazyn/MainWindow.xaml
+++ b/Magazyn_Client/Magazyn/MainWindow.xaml
@@ -1,15 +1,22 @@
-
-
-
-
+ Title="Fruit Warehouse" Height="400" Width="520">
+
+
-
+
+
+
+
+
+
+
+
diff --git a/Magazyn_Client/Magazyn/MainWindow.xaml.cs b/Magazyn_Client/Magazyn/MainWindow.xaml.cs
index 899217a..a275d9e 100644
--- a/Magazyn_Client/Magazyn/MainWindow.xaml.cs
+++ b/Magazyn_Client/Magazyn/MainWindow.xaml.cs
@@ -28,8 +28,10 @@ namespace Magazyn
public MainWindow()
{
InitializeComponent();
- client = new HttpClient();
- }
+ loadingContent.IsIndeterminate = true;
+ client = new HttpClient();
+ RefreshListOfFruits();
+ }
private void Button_Click(object sender, RoutedEventArgs e)
{
@@ -49,13 +51,19 @@ namespace Magazyn
private void RefreshListOfFruits()
{
- Task response = client.GetAsync("https://sysmag.herokuapp.com/api/get-all");
- while (response.IsCompleted != true) ;
+ loadingContent.Visibility = Visibility.Visible;
+ loadingContent.IsIndeterminate = true;
+ Task response = client.GetAsync("https://sysmag.herokuapp.com/api/get-all");
+ while (response.IsCompleted != true)
+ {
+ loadingContent.IsIndeterminate = false;
+ loadingContent.Visibility = Visibility.Hidden;
+ }
Fruit[] fruits = JsonConvert.DeserializeObject(response.Result.Content.ReadAsStringAsync().Result.ToString());
UpdateListOfFruits(fruits);
- }
+ }
private void UpdateListOfFruits(Fruit[] list)
{
@@ -81,8 +89,11 @@ namespace Magazyn
private void Button_Click_1(object sender, RoutedEventArgs e)
{
- MessageBox.Show("Value of warehouse: " + GetWarehousePrice().Price.ToString() );
+ payment.Text = GetWarehousePrice().Price.ToString();
+ //MessageBox.Show("Value of warehouse: " + GetWarehousePrice().Price.ToString() );
}
- }
+
+
+ }
}
diff --git a/Magazyn_Client/Magazyn/Views/FruitView.xaml b/Magazyn_Client/Magazyn/Views/FruitView.xaml
index d21995a..b9f07d8 100644
--- a/Magazyn_Client/Magazyn/Views/FruitView.xaml
+++ b/Magazyn_Client/Magazyn/Views/FruitView.xaml
@@ -1,12 +1,28 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Magazyn_Client/Magazyn/Views/FruitView.xaml.cs b/Magazyn_Client/Magazyn/Views/FruitView.xaml.cs
index 2c25e01..6edc8fa 100644
--- a/Magazyn_Client/Magazyn/Views/FruitView.xaml.cs
+++ b/Magazyn_Client/Magazyn/Views/FruitView.xaml.cs
@@ -35,14 +35,14 @@ namespace Magazyn.Views
this.fruit = fruit;
- fruitName.Text = fruit.Name;
- fruitAmount.Text = fruit.Quantity.ToString();
- fruitPrice.Text = fruit.Price.ToString();
- allPrice.Text = (fruit.Quantity * fruit.Price).ToString();
+ fruitName.Text = fruit.Name;
+ fruitAmount.Text = fruit.Quantity.ToString();
+ fruitPrice.Text = fruit.Price.ToString();
+ allPrice.Text = (fruit.Quantity * fruit.Price).ToString();
- try
+ try
{
- imges.Source = new BitmapImage(new Uri(fruit.ImageLink));
+ fruitImage.Source = new BitmapImage(new Uri(fruit.ImageLink));
}
catch (Exception ex)
{
@@ -68,5 +68,5 @@ namespace Magazyn.Views
{
SaveChangingAmountOfFruits.Invoke(amountChanged, fruit);
}
- }
+ }
}
diff --git a/Magazyn_Client/Magazyn/Windows/AmountWindow.xaml b/Magazyn_Client/Magazyn/Windows/AmountWindow.xaml
index ea7b7ef..4170037 100644
--- a/Magazyn_Client/Magazyn/Windows/AmountWindow.xaml
+++ b/Magazyn_Client/Magazyn/Windows/AmountWindow.xaml
@@ -5,11 +5,11 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Magazyn.Windows"
mc:Ignorable="d"
- Title="Change Quantity" Height="100" Width="300">
-
-
-
-
+ Title="Change Quantity" Height="100" Width="280">
+
+
+
+
-
+
diff --git a/Magazyn_Client/Magazyn/packages.config b/Magazyn_Client/Magazyn/packages.config
index 1cafd81..401cf31 100644
--- a/Magazyn_Client/Magazyn/packages.config
+++ b/Magazyn_Client/Magazyn/packages.config
@@ -1,4 +1,6 @@
+
+
\ No newline at end of file