From c74362cc4d856ec7ee35d7681aa4ea848edfc265 Mon Sep 17 00:00:00 2001 From: marcinzelent Date: Sat, 27 May 2017 14:59:42 +0200 Subject: Removed old board member pages and classes. --- .../ApartmentManager/Handler/BoardMemberHandler.cs | 128 -------------------- .../Handler/BoardResidentsHandler.cs | 132 --------------------- .../Singletons/BoardMemberCatalogSingleton.cs | 46 ------- .../View/BoardMemberCreateApartmentPage.xaml | 35 ------ .../View/BoardMemberCreateApartmentPage.xaml.cs | 30 ----- .../View/BoardMemberManageApartment.xaml | 33 ------ .../View/BoardMemberManageApartment.xaml.cs | 56 --------- .../View/BoardMembersDefectsPage.xaml | 30 ----- .../View/BoardMembersDefectsPage.xaml.cs | 35 ------ .../View/BoardMembersMainPage.xaml | 29 ----- .../View/BoardMembersMainPage.xaml.cs | 45 ------- .../View/DefectsPicturesBoard.xaml | 30 ----- .../View/DefectsPicturesBoard.xaml.cs | 30 ----- .../ApartmentManager/View/InfoForBoardMembers.xaml | 48 -------- .../View/InfoForBoardMembers.xaml.cs | 30 ----- .../ViewModel/BoardMemberViewModel.cs | 104 ---------------- 16 files changed, 841 deletions(-) delete mode 100644 ApartmentManager/ApartmentManager/Handler/BoardMemberHandler.cs delete mode 100644 ApartmentManager/ApartmentManager/Handler/BoardResidentsHandler.cs delete mode 100644 ApartmentManager/ApartmentManager/Singletons/BoardMemberCatalogSingleton.cs delete mode 100644 ApartmentManager/ApartmentManager/View/BoardMemberCreateApartmentPage.xaml delete mode 100644 ApartmentManager/ApartmentManager/View/BoardMemberCreateApartmentPage.xaml.cs delete mode 100644 ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml delete mode 100644 ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml.cs delete mode 100644 ApartmentManager/ApartmentManager/View/BoardMembersDefectsPage.xaml delete mode 100644 ApartmentManager/ApartmentManager/View/BoardMembersDefectsPage.xaml.cs delete mode 100644 ApartmentManager/ApartmentManager/View/BoardMembersMainPage.xaml delete mode 100644 ApartmentManager/ApartmentManager/View/BoardMembersMainPage.xaml.cs delete mode 100644 ApartmentManager/ApartmentManager/View/DefectsPicturesBoard.xaml delete mode 100644 ApartmentManager/ApartmentManager/View/DefectsPicturesBoard.xaml.cs delete mode 100644 ApartmentManager/ApartmentManager/View/InfoForBoardMembers.xaml delete mode 100644 ApartmentManager/ApartmentManager/View/InfoForBoardMembers.xaml.cs delete mode 100644 ApartmentManager/ApartmentManager/ViewModel/BoardMemberViewModel.cs diff --git a/ApartmentManager/ApartmentManager/Handler/BoardMemberHandler.cs b/ApartmentManager/ApartmentManager/Handler/BoardMemberHandler.cs deleted file mode 100644 index c642b02..0000000 --- a/ApartmentManager/ApartmentManager/Handler/BoardMemberHandler.cs +++ /dev/null @@ -1,128 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Linq.Expressions; -using System.Text; -using System.Threading.Tasks; -using Windows.UI.Popups; -using ApartmentManager.Model; -using ApartmentManager.Persistency; -using ApartmentManager.ViewModel; -using Newtonsoft.Json; - -namespace ApartmentManager.Handler -{ - public class BoardMemberHandler - { - public BoardMemberViewModel BoardMemberViewModel { get; set; } - - public BoardMemberHandler(BoardMemberViewModel boardMemberViewModel) - { - BoardMemberViewModel = boardMemberViewModel; - } - - public void GetApartments() - { - Apartment apartment= new Apartment(); - apartment.ApartmentId = BoardMemberViewModel.ApartmentsNumber; - - var apartmentsFromDatabase = ApiClient.GetData("api/Apartments/"); - IEnumerable apartmentslist = JsonConvert.DeserializeObject>(apartmentsFromDatabase); - - BoardMemberViewModel.BoardMemberCatalogSingleton.Apartment.Clear(); - BoardMemberViewModel.NewApartment = new Apartment(); - foreach (var apartment2 in apartmentslist) - { - BoardMemberViewModel.BoardMemberCatalogSingleton.Apartment.Add(apartment2); - } - } - - public void CreateApartment() - { - try - { - Apartment apartment = new Apartment(); - apartment.ApartmentId = BoardMemberViewModel.ApartmentsNumber; - apartment.Address = BoardMemberViewModel.NewApartment.Address; - apartment.Floor = BoardMemberViewModel.NewApartment.Floor; - apartment.MonthlyCharge = BoardMemberViewModel.NewApartment.MonthlyCharge; - apartment.NumberOfRooms = BoardMemberViewModel.NewApartment.NumberOfRooms; - apartment.Size = BoardMemberViewModel.NewApartment.Size; - - ApiClient.PostData("api/Apartments/", apartment); - - var apartmentsFromDatabase = ApiClient.GetData("api/Apartments/" + apartment.ApartmentId); - IEnumerable apartmentlist = JsonConvert.DeserializeObject>(apartmentsFromDatabase); - - BoardMemberViewModel.BoardMemberCatalogSingleton.Apartment.Clear(); - BoardMemberViewModel.NewApartment = new Apartment(); - foreach (var apartment2 in apartmentlist) - { - BoardMemberViewModel.BoardMemberCatalogSingleton.Apartment.Add(apartment2); - } - } - catch (Exception e) - { - new MessageDialog(e.Message).ShowAsync(); - } - } - public void UpdateApartment() - { - try - { - Apartment apartment = new Apartment(); - apartment.ApartmentId = BoardMemberViewModel.ApartmentsNumber; - apartment.Address = BoardMemberViewModel.NewApartment.Address; - apartment.Floor = BoardMemberViewModel.NewApartment.Floor; - apartment.MonthlyCharge = BoardMemberViewModel.NewApartment.MonthlyCharge; - apartment.NumberOfRooms = BoardMemberViewModel.NewApartment.NumberOfRooms; - apartment.Size = BoardMemberViewModel.NewApartment.Size; - - ApiClient.PutData("api/Apartments/" + apartment.ApartmentId, apartment); - var apartmentsFromDatabase = ApiClient.GetData("api/Apartments/" + apartment.ApartmentId); - IEnumerable apartmentslist = JsonConvert.DeserializeObject>(apartmentsFromDatabase); - - BoardMemberViewModel.BoardMemberCatalogSingleton.Apartment.Clear(); - BoardMemberViewModel.NewApartment = new Apartment(); - foreach (var apartment2 in apartmentslist) - { - BoardMemberViewModel.BoardMemberCatalogSingleton.Apartment.Add(apartment2); - } - } - catch (Exception e) - { - new MessageDialog(e.Message).ShowAsync(); - } - } - public void DeleteApartment() - { - try - { - Apartment apartment = new Apartment(); - apartment.ApartmentId = BoardMemberViewModel.ApartmentsNumber; - apartment.Address = BoardMemberViewModel.NewApartment.Address; - apartment.Floor = BoardMemberViewModel.NewApartment.Floor; - apartment.MonthlyCharge = BoardMemberViewModel.NewApartment.MonthlyCharge; - apartment.NumberOfRooms = BoardMemberViewModel.NewApartment.NumberOfRooms; - apartment.Size = BoardMemberViewModel.NewApartment.Size; - - ApiClient.DeleteData("api/Apartments/" + apartment.ApartmentId); - - var apartmentsFromDatabase = ApiClient.GetData("api/Apartments/" + apartment.ApartmentId); - IEnumerable apartmentslist = JsonConvert.DeserializeObject>(apartmentsFromDatabase); - - BoardMemberViewModel.BoardMemberCatalogSingleton.Apartment.Clear(); - BoardMemberViewModel.NewApartment = new Apartment(); - foreach (var apartment2 in apartmentslist) - { - BoardMemberViewModel.BoardMemberCatalogSingleton.Apartment.Add(apartment2); - } - } - catch (Exception e) - { - new MessageDialog(e.Message).ShowAsync(); - } - } - } -} diff --git a/ApartmentManager/ApartmentManager/Handler/BoardResidentsHandler.cs b/ApartmentManager/ApartmentManager/Handler/BoardResidentsHandler.cs deleted file mode 100644 index 3f6086e..0000000 --- a/ApartmentManager/ApartmentManager/Handler/BoardResidentsHandler.cs +++ /dev/null @@ -1,132 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Windows.UI.Popups; -using ApartmentManager.Model; -using ApartmentManager.Persistency; -using ApartmentManager.ViewModel; -using Newtonsoft.Json; - -namespace ApartmentManager.Handler -{ - public class BoardResidentsHandler - { - public BoardMemberViewModel BoardMemberViewModel { get; set; } - - public BoardResidentsHandler(BoardMemberViewModel boardMemberViewModel) - { - BoardMemberViewModel = boardMemberViewModel; - } - public void GetApartmentsResidents() - { - Resident resident = new Resident(); - resident.ApartmentId = BoardMemberViewModel.ApartmentsNumber; - - var residentsFromDatabase = ApiClient.GetData("api/ApartmentResidents/" + resident.ApartmentId); - IEnumerable residentlist = JsonConvert.DeserializeObject>(residentsFromDatabase); - - BoardMemberViewModel.BoardMemberCatalogSingleton.Residents.Clear(); - BoardMemberViewModel.NewResident = new Resident(); - foreach (var resident2 in residentlist) - { - BoardMemberViewModel.BoardMemberCatalogSingleton.Residents.Add(resident2); - } - } - - public void CreateResident() - { - try - { - Resident resident = new Resident(); - - resident.ApartmentId = BoardMemberViewModel.ApartmentsNumber; - resident.FirstName = BoardMemberViewModel.NewResident.FirstName; - resident.LastName = BoardMemberViewModel.NewResident.LastName; - resident.BirthDate = BoardMemberViewModel.NewResident.BirthDate; - resident.Email = BoardMemberViewModel.NewResident.Email; - resident.Picture = BoardMemberViewModel.NewResident.Picture; - resident.Phone = BoardMemberViewModel.NewResident.Phone; - - ApiClient.PostData("api/residents/", resident); - - var residentsFromDatabase = ApiClient.GetData("api/ApartmentResidents/" + resident.ApartmentId); - IEnumerable residentlist = JsonConvert.DeserializeObject>(residentsFromDatabase); - - BoardMemberViewModel.BoardMemberCatalogSingleton.Residents.Clear(); - BoardMemberViewModel.NewResident = new Resident(); - foreach (var resident2 in residentlist) - { - BoardMemberViewModel.BoardMemberCatalogSingleton.Residents.Add(resident2); - } - } - catch (Exception e) - { - new MessageDialog(e.Message).ShowAsync(); - } - } - - public void DeleteResident() - { - try - { - Resident resident = new Resident(); - resident.ResidentId = BoardMemberViewModel.NewResident.ResidentId; - resident.ApartmentId = BoardMemberViewModel.ApartmentsNumber; - resident.FirstName = BoardMemberViewModel.NewResident.FirstName; - resident.LastName = BoardMemberViewModel.NewResident.LastName; - resident.BirthDate = BoardMemberViewModel.NewResident.BirthDate; - resident.Email = BoardMemberViewModel.NewResident.Email; - resident.Picture = BoardMemberViewModel.NewResident.Picture; - resident.Phone = BoardMemberViewModel.NewResident.Phone; - - ApiClient.DeleteData("api/residents/" + resident.ResidentId); - - var residentsFromDatabase = ApiClient.GetData("api/ApartmentResidents/" + resident.ApartmentId); - IEnumerable residentlist = JsonConvert.DeserializeObject>(residentsFromDatabase); - - BoardMemberViewModel.BoardMemberCatalogSingleton.Residents.Clear(); - BoardMemberViewModel.NewResident = new Resident(); - foreach (var resident2 in residentlist) - { - BoardMemberViewModel.BoardMemberCatalogSingleton.Residents.Add(resident2); - } - } - catch (Exception e) - { - new MessageDialog(e.Message).ShowAsync(); - } - } - public void UpdateResident() - { - try - { - Resident resident = new Resident(); - resident.ResidentId = BoardMemberViewModel.NewResident.ResidentId; - resident.ApartmentId = BoardMemberViewModel.ApartmentsNumber; - resident.FirstName = BoardMemberViewModel.NewResident.FirstName; - resident.LastName = BoardMemberViewModel.NewResident.LastName; - resident.BirthDate = BoardMemberViewModel.NewResident.BirthDate; - resident.Email = BoardMemberViewModel.NewResident.Email; - resident.Picture = BoardMemberViewModel.NewResident.Picture; - resident.Phone = BoardMemberViewModel.NewResident.Phone; - - ApiClient.PutData("api/residents/" + resident.ResidentId, resident); - var residentsFromDatabase = ApiClient.GetData("api/ApartmentResidents/" + resident.ApartmentId); - IEnumerable residentlist = JsonConvert.DeserializeObject>(residentsFromDatabase); - - BoardMemberViewModel.BoardMemberCatalogSingleton.Residents.Clear(); - BoardMemberViewModel.NewResident = new Resident(); - foreach (var resident2 in residentlist) - { - BoardMemberViewModel.BoardMemberCatalogSingleton.Residents.Add(resident2); - } - } - catch (Exception e) - { - new MessageDialog(e.Message).ShowAsync(); - } - } - } -} \ No newline at end of file diff --git a/ApartmentManager/ApartmentManager/Singletons/BoardMemberCatalogSingleton.cs b/ApartmentManager/ApartmentManager/Singletons/BoardMemberCatalogSingleton.cs deleted file mode 100644 index 1a563ef..0000000 --- a/ApartmentManager/ApartmentManager/Singletons/BoardMemberCatalogSingleton.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Media; -using Windows.UI.Xaml.Media.Imaging; - -namespace ApartmentManager.Model -{ - public class BoardMemberCatalogSingleton - { - private static BoardMemberCatalogSingleton instance = new BoardMemberCatalogSingleton(); - - public static BoardMemberCatalogSingleton Instance => instance; - - public ObservableCollection Apartment { get; set; } - public ObservableCollection User { get; set; } - public ObservableCollection Residents { get; set; } - public ObservableCollection Defects { get; set; } - private BoardMemberCatalogSingleton() - { - Apartment = new ObservableCollection(); - - User = new ObservableCollection(); - //User.Add(new User("Bibis", "Kiausiai", "3214568", new DateTime(2017, 1, 5, 2, 27, 0), "Bibis@mail.com", 1)); - //Apartment = new ObservableCollection(); - //Apartment.Add(new Apartment(1, "30 Square meters", 2, "200", 0, "adresas")); - //Apartment.Add(new Apartment(2, "40 Square meters", 4, "300", 1, "kvaerkebyvej")); - //Apartment.Add(new Apartment(3, "28 Square meters", 1, "125", 0, "ugandavej")); - - Residents = new ObservableCollection(); - //Residents.Add(new Resident("Bibis", "Kiausiai", 3214568, new DateTime(2017, 1, 5, 0, 0, 0), "Bibis@mail.com", 1)); - //Residents.Add(new Resident("Bibis", "Kiausiai", 3214568, new DateTime(2017, 1, 5, 0, 0, 0), "Bibis@mail.com", 1)); - //Residents.Add(new Resident("Bibis", "Kiausiai", 3214568, new DateTime(2017, 1, 5, 0, 0, 0), "Bibis@mail.com", 1)); - //Residents.Add(new Resident("Bibis", "Kiausiai", 3214568, new DateTime(2017, 1, 5, 0, 0, 0), "Bibis@mail.com", 1)); - - Defects = new ObservableCollection(); - //Defects.Add(new Defect(1, 2, "Leaking downpipe", DateTime.Now, new Image(), new Image(), new Image(), "downpipe will explode, do something!", "hello", "Not fixed")); - //Defects.Add(new Defect(1, 2, "Leaking downpipe", DateTime.Now, new Image(), new Image(), new Image(), "downpipe will explode, do something!", "hello", "Not fixed")); - //Defects.Add(new Defect(1, 2, "Leaking downpipe", DateTime.Now, new Image(), new Image(), new Image(), "downpipe will explode, do something!", "hello", "Fixed")); - } - } -} diff --git a/ApartmentManager/ApartmentManager/View/BoardMemberCreateApartmentPage.xaml b/ApartmentManager/ApartmentManager/View/BoardMemberCreateApartmentPage.xaml deleted file mode 100644 index d243381..0000000 --- a/ApartmentManager/ApartmentManager/View/BoardMemberCreateApartmentPage.xaml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ApartmentManager/ApartmentManager/View/BoardMemberCreateApartmentPage.xaml.cs b/ApartmentManager/ApartmentManager/View/BoardMemberCreateApartmentPage.xaml.cs deleted file mode 100644 index 8098474..0000000 --- a/ApartmentManager/ApartmentManager/View/BoardMemberCreateApartmentPage.xaml.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices.WindowsRuntime; -using Windows.Foundation; -using Windows.Foundation.Collections; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Controls.Primitives; -using Windows.UI.Xaml.Data; -using Windows.UI.Xaml.Input; -using Windows.UI.Xaml.Media; -using Windows.UI.Xaml.Navigation; - -// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 - -namespace ApartmentManager.View -{ - /// - /// An empty page that can be used on its own or navigated to within a Frame. - /// - public sealed partial class BoardMemberCreateApartmentPage : Page - { - public BoardMemberCreateApartmentPage() - { - this.InitializeComponent(); - } - } -} diff --git a/ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml b/ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml deleted file mode 100644 index 7e164a5..0000000 --- a/ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml.cs b/ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml.cs deleted file mode 100644 index bbda517..0000000 --- a/ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices.WindowsRuntime; -using Windows.Foundation; -using Windows.Foundation.Collections; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Controls.Primitives; -using Windows.UI.Xaml.Data; -using Windows.UI.Xaml.Input; -using Windows.UI.Xaml.Media; -using Windows.UI.Xaml.Navigation; -using ApartmentManager.Model; -using ApartmentManager.Singletons; - -// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 - -namespace ApartmentManager.View -{ - /// - /// An empty page that can be used on its own or navigated to within a Frame. - /// - public sealed partial class BoardMemberManageApartment : Page - { - public BoardMemberManageApartment() - { - this.InitializeComponent(); - } - - private void ButtonBase_OnClick(object sender, RoutedEventArgs e) - { - this.Frame.Navigate(typeof(InfoForBoardMembers)); - } - - private void CreateApartment(object sender, RoutedEventArgs e) - { - this.Frame.Navigate(typeof(BoardMemberCreateApartmentPage)); - } - - //private bool ApartmentFilter(object item) - //{ - // if (String.IsNullOrEmpty(TextFilter.Text)) - // return true; - // else - // return BoardMemberCatalogSingleton.Instance.Apartment.IndexOf(TextFilter.Text)); - //} - - //private void txtFilter_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e) - //{ - // CollectionViewSource.GetDefaultView(lvUsers.ItemsSource).Refresh(); - //} - } -} diff --git a/ApartmentManager/ApartmentManager/View/BoardMembersDefectsPage.xaml b/ApartmentManager/ApartmentManager/View/BoardMembersDefectsPage.xaml deleted file mode 100644 index 28766d5..0000000 --- a/ApartmentManager/ApartmentManager/View/BoardMembersDefectsPage.xaml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/ApartmentManager/ApartmentManager/View/BoardMembersDefectsPage.xaml.cs b/ApartmentManager/ApartmentManager/View/BoardMembersDefectsPage.xaml.cs deleted file mode 100644 index d910d39..0000000 --- a/ApartmentManager/ApartmentManager/View/BoardMembersDefectsPage.xaml.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices.WindowsRuntime; -using Windows.Foundation; -using Windows.Foundation.Collections; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Controls.Primitives; -using Windows.UI.Xaml.Data; -using Windows.UI.Xaml.Input; -using Windows.UI.Xaml.Media; -using Windows.UI.Xaml.Navigation; - -// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 - -namespace ApartmentManager.View -{ - /// - /// An empty page that can be used on its own or navigated to within a Frame. - /// - public sealed partial class BoardMembersDefectsPage : Page - { - public BoardMembersDefectsPage() - { - this.InitializeComponent(); - } - - private void PicturesDefects(object sender, RoutedEventArgs e) - { - this.Frame.Navigate(typeof(DefectsPicturesBoard)); - } - } -} diff --git a/ApartmentManager/ApartmentManager/View/BoardMembersMainPage.xaml b/ApartmentManager/ApartmentManager/View/BoardMembersMainPage.xaml deleted file mode 100644 index 0cc58ab..0000000 --- a/ApartmentManager/ApartmentManager/View/BoardMembersMainPage.xaml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - -