From 5cdf3578112ad3023f5ac8328350bbff5483b6ef Mon Sep 17 00:00:00 2001 From: Mifd39 Date: Sun, 11 Jun 2017 12:19:38 +0200 Subject: final report --- FinalReportDelta.odt | Bin 0 -> 1665853 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FinalReportDelta.odt diff --git a/FinalReportDelta.odt b/FinalReportDelta.odt new file mode 100644 index 0000000..8dceff6 Binary files /dev/null and b/FinalReportDelta.odt differ -- cgit v1.2.3 From d8c1f62465035a31fdcd3f6413532564c01a05d5 Mon Sep 17 00:00:00 2001 From: Mifd39 Date: Tue, 13 Jun 2017 16:17:08 +0200 Subject: Add files via upload GG EZ --- Exam presentation.docx | Bin 0 -> 14552 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 Exam presentation.docx diff --git a/Exam presentation.docx b/Exam presentation.docx new file mode 100644 index 0000000..4070646 Binary files /dev/null and b/Exam presentation.docx differ -- cgit v1.2.3 From 1646e477e0f01d095e4e1064049e53cac445c1ff Mon Sep 17 00:00:00 2001 From: Mifd39 Date: Tue, 13 Jun 2017 17:10:03 +0200 Subject: Add files via upload some changes --- Exam presentation.docx | Bin 14552 -> 14661 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Exam presentation.docx b/Exam presentation.docx index 4070646..a4c90c0 100644 Binary files a/Exam presentation.docx and b/Exam presentation.docx differ -- cgit v1.2.3 From bcb90080d68d04c6ba2a1842d9d8a9177d31e9d0 Mon Sep 17 00:00:00 2001 From: Mifd39 Date: Tue, 13 Jun 2017 17:46:26 +0200 Subject: Add files via upload more updates --- Exam presentation.docx | Bin 14661 -> 14687 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Exam presentation.docx b/Exam presentation.docx index a4c90c0..6f8135d 100644 Binary files a/Exam presentation.docx and b/Exam presentation.docx differ -- cgit v1.2.3 From 8275d584dd49a8e1cd864c21237eab0e2fa22303 Mon Sep 17 00:00:00 2001 From: Donatas Adamonis Date: Wed, 14 Jun 2017 17:33:46 +0200 Subject: asd --- ApartmentManager/ApartmentManager/View/ApartmentDefectPage.xaml | 4 ++-- ApartmentManager/ApartmentManager/View/BmMainPage.xaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ApartmentManager/ApartmentManager/View/ApartmentDefectPage.xaml b/ApartmentManager/ApartmentManager/View/ApartmentDefectPage.xaml index a102840..cbea483 100644 --- a/ApartmentManager/ApartmentManager/View/ApartmentDefectPage.xaml +++ b/ApartmentManager/ApartmentManager/View/ApartmentDefectPage.xaml @@ -52,14 +52,14 @@ - + + > diff --git a/ApartmentManager/ApartmentManager/View/BmMainPage.xaml b/ApartmentManager/ApartmentManager/View/BmMainPage.xaml index 3cf03a3..2fd5ab2 100644 --- a/ApartmentManager/ApartmentManager/View/BmMainPage.xaml +++ b/ApartmentManager/ApartmentManager/View/BmMainPage.xaml @@ -76,7 +76,7 @@ Content="Apartment changes"> - + -- cgit v1.2.3 From 7653784bc7231825fde33f5d2f5c23740a27c215 Mon Sep 17 00:00:00 2001 From: Donatas Adamonis Date: Wed, 14 Jun 2017 21:36:14 +0200 Subject: changes --- .../ApartmentManager/Handler/ApartmentHandler.cs | 12 +++++++----- .../ApartmentManager/Handler/BmApartmentsHandler.cs | 3 ++- .../ApartmentManager/Handler/BmChangesHandler.cs | 4 ++-- .../ApartmentManager/Handler/BmDefectsHandler.cs | 4 ++-- .../ApartmentManager/Handler/BmResidentsHandler.cs | 4 ++-- .../ApartmentManager/Handler/BmUsersHandler.cs | 4 ++-- .../ApartmentManager/Handler/LoginHandler.cs | 18 ++++++++++++++++++ .../ApartmentManager/Singletons/BmSingleton.cs | 9 ++++++++- .../ApartmentManager/Singletons/CatalogSingleton.cs | 3 +++ .../View/Board member pages/BmUsersPage.xaml | 2 +- 10 files changed, 47 insertions(+), 16 deletions(-) diff --git a/ApartmentManager/ApartmentManager/Handler/ApartmentHandler.cs b/ApartmentManager/ApartmentManager/Handler/ApartmentHandler.cs index b89680c..086785a 100644 --- a/ApartmentManager/ApartmentManager/Handler/ApartmentHandler.cs +++ b/ApartmentManager/ApartmentManager/Handler/ApartmentHandler.cs @@ -25,10 +25,10 @@ namespace ApartmentManager.Handler public ApartmentHandler(ApartmentViewModel apartmenViewModel) { ApartmentViewModel = apartmenViewModel; - if (CatalogSingleton.Instance.Apartment == null) GetApartment(); - if (CatalogSingleton.Instance.Residents == null) GetApartmentResidents(); - if (CatalogSingleton.Instance.Defects == null) GetApartmentDefects(); - if (CatalogSingleton.Instance.Changes == null) GetApartmentChanges(); + GetApartment(); + if (CatalogSingleton.Instance.Residents.Count==0) GetApartmentResidents(); + if (CatalogSingleton.Instance.Defects.Count == 0) GetApartmentDefects(); + if (CatalogSingleton.Instance.Changes.Count == 0) GetApartmentChanges(); } @@ -58,7 +58,7 @@ namespace ApartmentManager.Handler { var residentsFromDatabase = ApiClient.GetData("api/ApartmentResidents/" + UserSingleton.Instance.CurrentUser.ApartmentId); var residentlist = JsonConvert.DeserializeObject>(residentsFromDatabase); - CatalogSingleton.Instance.Residents = new ObservableCollection(); + CatalogSingleton.Instance.Residents.Clear(); foreach (var resident in residentlist) { CatalogSingleton.Instance.Residents.Add(resident); @@ -175,6 +175,7 @@ namespace ApartmentManager.Handler var defectsFromDatabase = ApiClient.GetData("api/ApartmentDefects/" + Defect.ApartmentId); var defecttlist = JsonConvert.DeserializeObject>(defectsFromDatabase); CatalogSingleton.Instance.Defects = new ObservableCollection(); + CatalogSingleton.Instance.Defects.Clear(); foreach (var defect in defecttlist) { defect.Pictures = JsonConvert.DeserializeObject>(ApiClient.GetData("api/DefectPicturesById/" + defect.DefectId)); @@ -278,6 +279,7 @@ namespace ApartmentManager.Handler var changesFromDatabase = ApiClient.GetData("api/ChangesByApartmentId/" + change.ApartmentId); var changeslist = JsonConvert.DeserializeObject>(changesFromDatabase); CatalogSingleton.Instance.Changes = new ObservableCollection(); + CatalogSingleton.Instance.Changes.Clear(); foreach (var apartmentChange in changeslist) { apartmentChange.Documents = JsonConvert.DeserializeObject>(ApiClient.GetData("api/DocumentsByChangeId/" + apartmentChange.ChangeId)); diff --git a/ApartmentManager/ApartmentManager/Handler/BmApartmentsHandler.cs b/ApartmentManager/ApartmentManager/Handler/BmApartmentsHandler.cs index 349f29c..de74491 100644 --- a/ApartmentManager/ApartmentManager/Handler/BmApartmentsHandler.cs +++ b/ApartmentManager/ApartmentManager/Handler/BmApartmentsHandler.cs @@ -16,11 +16,12 @@ namespace ApartmentManager.Handler public BmApartmentsHandler(BmApartmentsViewModel vm) { _vm = vm; - if (BmSingleton.Instance.Apartments == null) GetApartments(); + if (BmSingleton.Instance.Apartments.Count==0) GetApartments(); } public void GetApartments() { + BmSingleton.Instance.Apartments.Clear(); BmSingleton.Instance.Apartments = JsonConvert.DeserializeObject>(ApiClient.GetData("api/Apartments/")); } diff --git a/ApartmentManager/ApartmentManager/Handler/BmChangesHandler.cs b/ApartmentManager/ApartmentManager/Handler/BmChangesHandler.cs index 87ea656..35b67e5 100644 --- a/ApartmentManager/ApartmentManager/Handler/BmChangesHandler.cs +++ b/ApartmentManager/ApartmentManager/Handler/BmChangesHandler.cs @@ -17,13 +17,13 @@ namespace ApartmentManager.Handler public BmChangesHandler(BmChangesViewModel vm) { _vm = vm; - if (BmSingleton.Instance.Changes == null) GetChanges(); + if (BmSingleton.Instance.Changes.Count == 0) GetChanges(); } public void GetChanges() { var changes = JsonConvert.DeserializeObject>(ApiClient.GetData("api/Changes/")); - BmSingleton.Instance.Changes = new ObservableCollection(); + BmSingleton.Instance.Changes.Clear(); foreach (var change in changes) { change.Documents = JsonConvert.DeserializeObject>(ApiClient.GetData("api/DocumentsByChangeId/" + change.ChangeId)); diff --git a/ApartmentManager/ApartmentManager/Handler/BmDefectsHandler.cs b/ApartmentManager/ApartmentManager/Handler/BmDefectsHandler.cs index 27a9680..34a68f5 100644 --- a/ApartmentManager/ApartmentManager/Handler/BmDefectsHandler.cs +++ b/ApartmentManager/ApartmentManager/Handler/BmDefectsHandler.cs @@ -17,13 +17,13 @@ namespace ApartmentManager.Handler public BmDefectsHandler(BmDefectsViewModel vm) { _vm = vm; - if (BmSingleton.Instance.Defects == null) GetDefects(); + if (BmSingleton.Instance.Defects.Count == 0) GetDefects(); } public void GetDefects() { var defects = JsonConvert.DeserializeObject>(ApiClient.GetData("api/Defects/")); - BmSingleton.Instance.Defects = new ObservableCollection(); + BmSingleton.Instance.Defects.Clear(); foreach (var defect in defects) { defect.Pictures = JsonConvert.DeserializeObject>(ApiClient.GetData("api/DefectPicturesById/" + defect.DefectId)); diff --git a/ApartmentManager/ApartmentManager/Handler/BmResidentsHandler.cs b/ApartmentManager/ApartmentManager/Handler/BmResidentsHandler.cs index 1e43f4d..45fbb01 100644 --- a/ApartmentManager/ApartmentManager/Handler/BmResidentsHandler.cs +++ b/ApartmentManager/ApartmentManager/Handler/BmResidentsHandler.cs @@ -16,13 +16,13 @@ namespace ApartmentManager.Handler public BmResidentsHandler(BmResidentsViewModel vm) { _vm = vm; - if (BmSingleton.Instance.Residents == null) GetResidents(); + if (BmSingleton.Instance.Residents.Count == 0) GetResidents(); } public void GetResidents() { var residents = JsonConvert.DeserializeObject>(ApiClient.GetData("api/Residents/")); - BmSingleton.Instance.Residents = new ObservableCollection(); + BmSingleton.Instance.Residents.Clear(); foreach (var resident in residents) BmSingleton.Instance.Residents.Add(resident); } diff --git a/ApartmentManager/ApartmentManager/Handler/BmUsersHandler.cs b/ApartmentManager/ApartmentManager/Handler/BmUsersHandler.cs index cf07594..19a34ce 100644 --- a/ApartmentManager/ApartmentManager/Handler/BmUsersHandler.cs +++ b/ApartmentManager/ApartmentManager/Handler/BmUsersHandler.cs @@ -20,13 +20,13 @@ namespace ApartmentManager.Handler public BmUsersHandler(BmUsersViewModel vm) { _vm = vm; - if (BmSingleton.Instance.Users == null) GetUsers(); + if (BmSingleton.Instance.Users.Count == 0) GetUsers(); } public void GetUsers() { var users = JsonConvert.DeserializeObject>(ApiClient.GetData("api/Users/")); - BmSingleton.Instance.Users = new ObservableCollection(); + BmSingleton.Instance.Users.Clear(); foreach (var user in users) BmSingleton.Instance.Users.Add(user); } diff --git a/ApartmentManager/ApartmentManager/Handler/LoginHandler.cs b/ApartmentManager/ApartmentManager/Handler/LoginHandler.cs index 02e6009..f31a948 100644 --- a/ApartmentManager/ApartmentManager/Handler/LoginHandler.cs +++ b/ApartmentManager/ApartmentManager/Handler/LoginHandler.cs @@ -2,6 +2,7 @@ using ApartmentManager.Persistency; using Newtonsoft.Json; using System; +using System.Collections.ObjectModel; using ApartmentManager.ViewModel; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; @@ -46,6 +47,23 @@ namespace ApartmentManager.Handler public void LogOut() { + if (UserSingleton.Instance.CurrentUser.IsBm) + { + BmSingleton.Instance.Apartments = new ObservableCollection(); + BmSingleton.Instance.Users = new ObservableCollection(); + BmSingleton.Instance.Residents = new ObservableCollection(); + BmSingleton.Instance.Defects = new ObservableCollection(); + BmSingleton.Instance.Changes = new ObservableCollection(); + } + else + { + CatalogSingleton.Instance.SelectedChange = new Change(); + CatalogSingleton.Instance.Apartment = new Apartment(); + CatalogSingleton.Instance.Changes = new ObservableCollection(); + CatalogSingleton.Instance.Defects = new ObservableCollection(); + CatalogSingleton.Instance.Residents = new ObservableCollection(); + CatalogSingleton.Instance.SelectedDefect = new Defect(); + } UserSingleton.Instance.CurrentUser = null; NavigateToLoginPage(); } diff --git a/ApartmentManager/ApartmentManager/Singletons/BmSingleton.cs b/ApartmentManager/ApartmentManager/Singletons/BmSingleton.cs index 255c4ce..410b938 100644 --- a/ApartmentManager/ApartmentManager/Singletons/BmSingleton.cs +++ b/ApartmentManager/ApartmentManager/Singletons/BmSingleton.cs @@ -14,6 +14,13 @@ namespace ApartmentManager.Singletons public ObservableCollection Defects { get; set; } public ObservableCollection Changes { get; set; } - private BmSingleton() { } + private BmSingleton() + { + Apartments = new ObservableCollection(); + Users = new ObservableCollection(); + Residents = new ObservableCollection(); + Defects = new ObservableCollection(); + Changes = new ObservableCollection(); + } } } diff --git a/ApartmentManager/ApartmentManager/Singletons/CatalogSingleton.cs b/ApartmentManager/ApartmentManager/Singletons/CatalogSingleton.cs index f32dd7a..90e8ee0 100644 --- a/ApartmentManager/ApartmentManager/Singletons/CatalogSingleton.cs +++ b/ApartmentManager/ApartmentManager/Singletons/CatalogSingleton.cs @@ -25,6 +25,9 @@ namespace ApartmentManager.Singletons ////////// Constructor ////////// private CatalogSingleton() { + Residents = new ObservableCollection(); + Defects = new ObservableCollection(); + Changes = new ObservableCollection(); SelectedDefect = new Defect(); SelectedChange = new Change(); } diff --git a/ApartmentManager/ApartmentManager/View/Board member pages/BmUsersPage.xaml b/ApartmentManager/ApartmentManager/View/Board member pages/BmUsersPage.xaml index f5b5f3e..0f084ea 100644 --- a/ApartmentManager/ApartmentManager/View/Board member pages/BmUsersPage.xaml +++ b/ApartmentManager/ApartmentManager/View/Board member pages/BmUsersPage.xaml @@ -128,7 +128,7 @@ Command="{Binding UploadUserPhotoCommand}" Content="Upload Picture" /> - + -- cgit v1.2.3 From 23cac0c8345efab99d3b5b44f0f1eac8acd891ed Mon Sep 17 00:00:00 2001 From: Donatas Adamonis Date: Wed, 14 Jun 2017 21:36:52 +0200 Subject: database --- .../HousingWebApi/App_Data/housingdb.mdf | Bin 8388608 -> 8388608 bytes .../HousingWebApi/App_Data/housingdb_log.ldf | Bin 8388608 -> 8388608 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/ApartmentManager/HousingWebApi/App_Data/housingdb.mdf b/ApartmentManager/HousingWebApi/App_Data/housingdb.mdf index 6fb4146..27a99d2 100644 Binary files a/ApartmentManager/HousingWebApi/App_Data/housingdb.mdf and b/ApartmentManager/HousingWebApi/App_Data/housingdb.mdf differ diff --git a/ApartmentManager/HousingWebApi/App_Data/housingdb_log.ldf b/ApartmentManager/HousingWebApi/App_Data/housingdb_log.ldf index b33338f..e486221 100644 Binary files a/ApartmentManager/HousingWebApi/App_Data/housingdb_log.ldf and b/ApartmentManager/HousingWebApi/App_Data/housingdb_log.ldf differ -- cgit v1.2.3