diff --git a/Magazyn_Client/.gitignore b/Magazyn_Client/.gitignore
new file mode 100644
index 0000000..84c9832
--- /dev/null
+++ b/Magazyn_Client/.gitignore
@@ -0,0 +1,341 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+
+# User-specific files
+*.rsuser
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUNIT
+*.VisualState.xml
+TestResult.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_h.h
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding add-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+# ASP.NET Core default setup: bower directory is configured as wwwroot/lib/ and bower restore is true
+**/wwwroot/lib/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# JetBrains Rider
+.idea/
+*.sln.iml
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
\ No newline at end of file
diff --git a/Magazyn_Client/Magazyn.sln b/Magazyn_Client/Magazyn.sln
new file mode 100644
index 0000000..741d861
--- /dev/null
+++ b/Magazyn_Client/Magazyn.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26730.15
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Magazyn", "Magazyn\Magazyn.csproj", "{C50EC6F3-86E6-405C-991F-1B4157C04B34}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {C50EC6F3-86E6-405C-991F-1B4157C04B34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C50EC6F3-86E6-405C-991F-1B4157C04B34}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C50EC6F3-86E6-405C-991F-1B4157C04B34}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C50EC6F3-86E6-405C-991F-1B4157C04B34}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {BD938214-689F-4C4B-846E-9D7E3A4CD156}
+ EndGlobalSection
+EndGlobal
diff --git a/Magazyn_Client/Magazyn/App.config b/Magazyn_Client/Magazyn/App.config
new file mode 100644
index 0000000..00bfd11
--- /dev/null
+++ b/Magazyn_Client/Magazyn/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Magazyn_Client/Magazyn/App.xaml b/Magazyn_Client/Magazyn/App.xaml
new file mode 100644
index 0000000..4ce9918
--- /dev/null
+++ b/Magazyn_Client/Magazyn/App.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/Magazyn_Client/Magazyn/App.xaml.cs b/Magazyn_Client/Magazyn/App.xaml.cs
new file mode 100644
index 0000000..4461381
--- /dev/null
+++ b/Magazyn_Client/Magazyn/App.xaml.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace Magazyn
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : Application
+ {
+ }
+}
diff --git a/Magazyn_Client/Magazyn/DataModels/Fruit.cs b/Magazyn_Client/Magazyn/DataModels/Fruit.cs
new file mode 100644
index 0000000..6c97d6a
--- /dev/null
+++ b/Magazyn_Client/Magazyn/DataModels/Fruit.cs
@@ -0,0 +1,66 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Magazyn.DataModels
+{
+ public class Fruit
+ {
+ int id;
+ string name;
+ int quantity;
+ float price;
+ string imageLink;
+
+ public int Id
+ {
+ get
+ {
+ return id;
+ }
+ }
+
+ public string Name
+ {
+ get
+ {
+ return name;
+ }
+ }
+
+ public int Quantity
+ {
+ get
+ {
+ return quantity;
+ }
+ }
+
+ public float Price
+ {
+ get
+ {
+ return price;
+ }
+ }
+
+ public string ImageLink
+ {
+ get
+ {
+ return imageLink;
+ }
+ }
+
+ public Fruit(int id, string name, int quantity, float price, string imageLink)
+ {
+ this.id = id;
+ this.name = name;
+ this.quantity = quantity;
+ this.price = price;
+ this.imageLink = imageLink;
+ }
+ }
+}
diff --git a/Magazyn_Client/Magazyn/Images/add.png b/Magazyn_Client/Magazyn/Images/add.png
new file mode 100644
index 0000000..eb457bc
Binary files /dev/null and b/Magazyn_Client/Magazyn/Images/add.png differ
diff --git a/Magazyn_Client/Magazyn/Images/sub.png b/Magazyn_Client/Magazyn/Images/sub.png
new file mode 100644
index 0000000..aab09d5
Binary files /dev/null and b/Magazyn_Client/Magazyn/Images/sub.png differ
diff --git a/Magazyn_Client/Magazyn/Magazyn.csproj b/Magazyn_Client/Magazyn/Magazyn.csproj
new file mode 100644
index 0000000..35fe037
--- /dev/null
+++ b/Magazyn_Client/Magazyn/Magazyn.csproj
@@ -0,0 +1,120 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {C50EC6F3-86E6-405C-991F-1B4157C04B34}
+ WinExe
+ Magazyn
+ Magazyn
+ v4.6.1
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll
+
+
+
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+
+ FruitView.xaml
+
+
+ AmountWindow.xaml
+
+
+ MSBuild:Compile
+ Designer
+
+
+ App.xaml
+ Code
+
+
+ MainWindow.xaml
+ Code
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+
+
+ Code
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Magazyn_Client/Magazyn/MainWindow.xaml b/Magazyn_Client/Magazyn/MainWindow.xaml
new file mode 100644
index 0000000..764fe25
--- /dev/null
+++ b/Magazyn_Client/Magazyn/MainWindow.xaml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
diff --git a/Magazyn_Client/Magazyn/MainWindow.xaml.cs b/Magazyn_Client/Magazyn/MainWindow.xaml.cs
new file mode 100644
index 0000000..a487ae9
--- /dev/null
+++ b/Magazyn_Client/Magazyn/MainWindow.xaml.cs
@@ -0,0 +1,85 @@
+using Magazyn.DataModels;
+using Magazyn.Views;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net.Http;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using Newtonsoft.Json;
+
+namespace Magazyn
+{
+
+ public partial class MainWindow : Window
+ {
+
+ HttpClient client;
+
+ public MainWindow()
+ {
+ InitializeComponent();
+ client = new HttpClient();
+ }
+
+ private void Button_Click(object sender, RoutedEventArgs e)
+ {
+ RefreshListOfFruits();
+ }
+
+ private void FruitViewSaveChangingAmountOfFruits(int amountChanged, Fruit fruit)
+ {
+ string json = "{\"id\": " + fruit.Id.ToString() + ", \"change\": " + amountChanged.ToString() + " }";
+
+ Task response = client.PostAsync("https://sysmag.herokuapp.com/api/change-quantity", new StringContent(json, Encoding.UTF8, "application/json"));
+ while (response.IsCompleted != true) ;
+
+ RefreshListOfFruits();
+
+ }
+
+ private void RefreshListOfFruits()
+ {
+ Task response = client.GetAsync("https://sysmag.herokuapp.com/api/get-all");
+ while (response.IsCompleted != true) ;
+
+ Fruit[] fruits = JsonConvert.DeserializeObject(response.Result.Content.ReadAsStringAsync().Result.ToString());
+
+ UpdateListOfFruits(fruits);
+ }
+
+ private void UpdateListOfFruits(Fruit[] list)
+ {
+ fruitList.Items.Clear();
+
+ foreach (Fruit item in list)
+ {
+ FruitView fruitView = new FruitView(item);
+ fruitView.SaveChangingAmountOfFruits += FruitViewSaveChangingAmountOfFruits;
+ fruitList.Items.Add(fruitView);
+ }
+ }
+
+ private string GetWarehousePrice()
+ {
+ Task response = client.GetAsync("https://sysmag.herokuapp.com/api/get-price-of-all");
+ while (response.IsCompleted != true) ;
+ return response.Result.Content.ReadAsStringAsync().Result.ToString();
+ }
+
+ private void Button_Click_1(object sender, RoutedEventArgs e)
+ {
+ MessageBox.Show("Value of warehouse: " + GetWarehousePrice());
+ }
+ }
+}
+
diff --git a/Magazyn_Client/Magazyn/Properties/AssemblyInfo.cs b/Magazyn_Client/Magazyn/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..08a4e79
--- /dev/null
+++ b/Magazyn_Client/Magazyn/Properties/AssemblyInfo.cs
@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Magazyn")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Magazyn")]
+[assembly: AssemblyCopyright("Copyright © 2019")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+//In order to begin building localizable applications, set
+//CultureYouAreCodingWith in your .csproj file
+//inside a . For example, if you are using US english
+//in your source files, set the to en-US. Then uncomment
+//the NeutralResourceLanguage attribute below. Update the "en-US" in
+//the line below to match the UICulture setting in the project file.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
+
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Magazyn_Client/Magazyn/Properties/Resources.Designer.cs b/Magazyn_Client/Magazyn/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..97d553e
--- /dev/null
+++ b/Magazyn_Client/Magazyn/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Magazyn.Properties
+{
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Magazyn.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/Magazyn_Client/Magazyn/Properties/Resources.resx b/Magazyn_Client/Magazyn/Properties/Resources.resx
new file mode 100644
index 0000000..ffecec8
--- /dev/null
+++ b/Magazyn_Client/Magazyn/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Magazyn_Client/Magazyn/Properties/Settings.Designer.cs b/Magazyn_Client/Magazyn/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..1721c7b
--- /dev/null
+++ b/Magazyn_Client/Magazyn/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Magazyn.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/Magazyn_Client/Magazyn/Properties/Settings.settings b/Magazyn_Client/Magazyn/Properties/Settings.settings
new file mode 100644
index 0000000..8f2fd95
--- /dev/null
+++ b/Magazyn_Client/Magazyn/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Magazyn_Client/Magazyn/Views/FruitView.xaml b/Magazyn_Client/Magazyn/Views/FruitView.xaml
new file mode 100644
index 0000000..b537c84
--- /dev/null
+++ b/Magazyn_Client/Magazyn/Views/FruitView.xaml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Magazyn_Client/Magazyn/Views/FruitView.xaml.cs b/Magazyn_Client/Magazyn/Views/FruitView.xaml.cs
new file mode 100644
index 0000000..2c25e01
--- /dev/null
+++ b/Magazyn_Client/Magazyn/Views/FruitView.xaml.cs
@@ -0,0 +1,72 @@
+using Magazyn.DataModels;
+using Magazyn.Windows;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace Magazyn.Views
+{
+ ///
+ /// Interaction logic for FruitView.xaml
+ ///
+ public partial class FruitView : UserControl
+ {
+ Fruit fruit;
+
+ public delegate void ChangingAmountOfFruits(int amountChanged, Fruit fruit);
+ public event ChangingAmountOfFruits SaveChangingAmountOfFruits;
+
+ public FruitView(Fruit fruit)
+ {
+ InitializeComponent();
+
+ this.fruit = fruit;
+
+ fruitName.Text = fruit.Name;
+ fruitAmount.Text = fruit.Quantity.ToString();
+ fruitPrice.Text = fruit.Price.ToString();
+ allPrice.Text = (fruit.Quantity * fruit.Price).ToString();
+
+ try
+ {
+ imges.Source = new BitmapImage(new Uri(fruit.ImageLink));
+ }
+ catch (Exception ex)
+ {
+ }
+
+ }
+
+ private void subButton_Click(object sender, RoutedEventArgs e)
+ {
+ AmountWindow window = new AmountWindow(fruit, -1);
+ window.SaveChangingAmountOfFruits += WindowSaveChangingAmountOfFruits;
+ window.Show();
+ }
+
+ private void addButton_Click(object sender, RoutedEventArgs e)
+ {
+ AmountWindow window = new AmountWindow(fruit, 1);
+ window.SaveChangingAmountOfFruits += WindowSaveChangingAmountOfFruits;
+ window.Show();
+ }
+
+ private void WindowSaveChangingAmountOfFruits(int amountChanged)
+ {
+ SaveChangingAmountOfFruits.Invoke(amountChanged, fruit);
+ }
+ }
+}
diff --git a/Magazyn_Client/Magazyn/Windows/AmountWindow.xaml b/Magazyn_Client/Magazyn/Windows/AmountWindow.xaml
new file mode 100644
index 0000000..c2617e5
--- /dev/null
+++ b/Magazyn_Client/Magazyn/Windows/AmountWindow.xaml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
diff --git a/Magazyn_Client/Magazyn/Windows/AmountWindow.xaml.cs b/Magazyn_Client/Magazyn/Windows/AmountWindow.xaml.cs
new file mode 100644
index 0000000..b0e68e1
--- /dev/null
+++ b/Magazyn_Client/Magazyn/Windows/AmountWindow.xaml.cs
@@ -0,0 +1,53 @@
+using Magazyn.DataModels;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace Magazyn.Windows
+{
+ ///
+ /// Interaction logic for AmountWindow.xaml
+ ///
+ public partial class AmountWindow : Window
+ {
+ Fruit fruit;
+ int type;
+
+ public delegate void ChangingAmountOfFruits(int amountChanged);
+ public event ChangingAmountOfFruits SaveChangingAmountOfFruits;
+
+ public AmountWindow(Fruit fruit, int type)
+ {
+ InitializeComponent();
+ this.fruit = fruit;
+ this.type = type;
+
+ fruitName.Text = fruit.Name;
+ }
+
+ private void saveButton_Click(object sender, RoutedEventArgs e)
+ {
+ int amount = 0;
+
+ try
+ {
+ amount = int.Parse(amountToChange.Text);
+ } catch (Exception ex) {
+ throw new NotImplementedException(ex.Message);
+ }
+
+ SaveChangingAmountOfFruits.Invoke((type>0)?amount:-amount);
+ this.Close();
+ }
+ }
+}
diff --git a/Magazyn_Client/Magazyn/packages.config b/Magazyn_Client/Magazyn/packages.config
new file mode 100644
index 0000000..1cafd81
--- /dev/null
+++ b/Magazyn_Client/Magazyn/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file