From e116a32b7c8c9c11b37653b43a7cc3243cfe660e Mon Sep 17 00:00:00 2001 From: Donatas Adamonis Date: Wed, 10 May 2017 23:46:45 +0200 Subject: defect page --- ApartmentManager/ApartmentManager/Model/Defect.cs | 12 +-- .../Singletons/ApartmentsCatalogSingleton.cs | 6 +- .../Singletons/CatalogSingleton.cs | 19 +++- .../ApartmentManager/View/ApartmentDefectPage.xaml | 113 ++++++++++++++------- .../ApartmentManager/View/ApartmentNewDefect.xaml | 25 +++-- .../ApartmentManager/View/ApartmentPage.xaml | 2 +- .../ApartmentManager/View/ApartmentPage.xaml.cs | 5 + .../ViewModel/ApartmenViewModel.cs | 18 +++- 8 files changed, 137 insertions(+), 63 deletions(-) diff --git a/ApartmentManager/ApartmentManager/Model/Defect.cs b/ApartmentManager/ApartmentManager/Model/Defect.cs index f695c95..5d97831 100644 --- a/ApartmentManager/ApartmentManager/Model/Defect.cs +++ b/ApartmentManager/ApartmentManager/Model/Defect.cs @@ -7,24 +7,24 @@ using Windows.UI.Xaml.Controls; namespace ApartmentManager.Model { - class Defect + public class Defect { public int DefectNumber { get; set; } public int ApartmentNumber { get; set; } public string Name { get; set; } public DateTime DateUploaded { get; set; } - public Image Picture { get; set; } - public Image Picture2 { get; set; } - public Image Picture3 { get; set; } + public string Picture { get; set; } + public string Picture2 { get; set; } + public string Picture3 { get; set; } public string Description { get; set; } public string Comment { get; set; } public string Status { get; set; } public Defect() { } - public Defect(int DefectNumber, int ApartmentNumber, string Name, DateTime DateUploaded, Image Picture, Image Picture2, Image Picture3, string Description, string Comment, string Status) + public Defect( int ApartmentNumber, string Name, DateTime DateUploaded, string Picture, string Picture2, string Picture3, string Description, string Comment, string Status) { - this.DefectNumber = DefectNumber; + this.ApartmentNumber = ApartmentNumber; this.Name = Name; this.DateUploaded = DateUploaded; diff --git a/ApartmentManager/ApartmentManager/Singletons/ApartmentsCatalogSingleton.cs b/ApartmentManager/ApartmentManager/Singletons/ApartmentsCatalogSingleton.cs index c65c241..bcdd13c 100644 --- a/ApartmentManager/ApartmentManager/Singletons/ApartmentsCatalogSingleton.cs +++ b/ApartmentManager/ApartmentManager/Singletons/ApartmentsCatalogSingleton.cs @@ -37,9 +37,9 @@ namespace ApartmentManager.Model //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(), "Ze fokin daun paip iz aboot to ekslpod bois", "Iditi vse naxui", "Not fixed")); - Defects.Add(new Defect(1, 2, "Leaking downpipe", DateTime.Now, new Image(), new Image(), new Image(), "Ze fokin daun paip iz aboot to ekslpod bois", "Iditi vse naxui", "Not fixed")); - Defects.Add(new Defect(1, 2, "Leaking downpipe", DateTime.Now, new Image(), new Image(), new Image(), "Ze fokin daun paip iz aboot to ekslpod bois", "Iditi vse naxui", "Fixed")); + //Defects.Add(new Defect(1, 2, "Leaking downpipe", DateTime.Now, new Image(), new Image(), new Image(), "Ze fokin daun paip iz aboot to ekslpod bois", "Iditi vse naxui", "Not fixed")); + //Defects.Add(new Defect(1, 2, "Leaking downpipe", DateTime.Now, new Image(), new Image(), new Image(), "Ze fokin daun paip iz aboot to ekslpod bois", "Iditi vse naxui", "Not fixed")); + //Defects.Add(new Defect(1, 2, "Leaking downpipe", DateTime.Now, new Image(), new Image(), new Image(), "Ze fokin daun paip iz aboot to ekslpod bois", "Iditi vse naxui", "Fixed")); } } } diff --git a/ApartmentManager/ApartmentManager/Singletons/CatalogSingleton.cs b/ApartmentManager/ApartmentManager/Singletons/CatalogSingleton.cs index 998bfb3..490ac49 100644 --- a/ApartmentManager/ApartmentManager/Singletons/CatalogSingleton.cs +++ b/ApartmentManager/ApartmentManager/Singletons/CatalogSingleton.cs @@ -1,4 +1,5 @@ -using System.Collections.ObjectModel; +using System; +using System.Collections.ObjectModel; using ApartmentManager.Model; namespace ApartmentManager.Singletons @@ -9,13 +10,21 @@ namespace ApartmentManager.Singletons public static CatalogSingleton Instance => instance; - + public Apartment Apartment { get; set; } public ObservableCollection Residents { get; set; } + public ObservableCollection Defects { get; set; } private CatalogSingleton() - { - Residents = new ObservableCollection(); - + { + Residents = new ObservableCollection(); + Defects = new ObservableCollection(); + Defects.Add(new Defect(1, "Broken Pipe", new DateTime(1988, 8, 8), "https://cdn.theatlantic.com/assets/media/img/photo/2011/09/vladimir-putin-action-man/p34_DWI22303/main_900.jpg?1420519465", "https://cdn.theatlantic.com/assets/media/img/photo/2011/09/vladimir-putin-action-man/p34_DWI22303/main_900.jpg?1420519465", "https://cdn.theatlantic.com/assets/media/img/photo/2011/09/vladimir-putin-action-man/p34_DWI22303/main_900.jpg?1420519465", "description", "comment", "status")); + Defects.Add(new Defect(1, "Broken Pipe", new DateTime(1988, 8, 8), "https://cdn.theatlantic.com/assets/media/img/photo/2011/09/vladimir-putin-action-man/p34_DWI22303/main_900.jpg?1420519465", "https://cdn.theatlantic.com/assets/media/img/photo/2011/09/vladimir-putin-action-man/p34_DWI22303/main_900.jpg?1420519465", "https://cdn.theatlantic.com/assets/media/img/photo/2011/09/vladimir-putin-action-man/p34_DWI22303/main_900.jpg?1420519465", "description", "comment", "status")); + Defects.Add(new Defect(1, "Broken Pipe", new DateTime(1988, 8, 8), "https://cdn.theatlantic.com/assets/media/img/photo/2011/09/vladimir-putin-action-man/p34_DWI22303/main_900.jpg?1420519465", "https://cdn.theatlantic.com/assets/media/img/photo/2011/09/vladimir-putin-action-man/p34_DWI22303/main_900.jpg?1420519465", "https://cdn.theatlantic.com/assets/media/img/photo/2011/09/vladimir-putin-action-man/p34_DWI22303/main_900.jpg?1420519465", "description", "comment", "status")); + Defects.Add(new Defect(1, "Broken Pipe", new DateTime(1988, 8, 8), "https://cdn.theatlantic.com/assets/media/img/photo/2011/09/vladimir-putin-action-man/p34_DWI22303/main_900.jpg?1420519465", "https://cdn.theatlantic.com/assets/media/img/photo/2011/09/vladimir-putin-action-man/p34_DWI22303/main_900.jpg?1420519465", "https://cdn.theatlantic.com/assets/media/img/photo/2011/09/vladimir-putin-action-man/p34_DWI22303/main_900.jpg?1420519465", "description", "comment", "status")); + + Defects.Add(new Defect(1, "Broken Pipe", new DateTime(1988, 8, 8), "https://cdn.theatlantic.com/assets/media/img/photo/2011/09/vladimir-putin-action-man/p34_DWI22303/main_900.jpg?1420519465", "https://cdn.theatlantic.com/assets/media/img/photo/2011/09/vladimir-putin-action-man/p34_DWI22303/main_900.jpg?1420519465", "https://cdn.theatlantic.com/assets/media/img/photo/2011/09/vladimir-putin-action-man/p34_DWI22303/main_900.jpg?1420519465", "description", "comment", "status")); + } } } diff --git a/ApartmentManager/ApartmentManager/View/ApartmentDefectPage.xaml b/ApartmentManager/ApartmentManager/View/ApartmentDefectPage.xaml index 760d56f..a69fe96 100644 --- a/ApartmentManager/ApartmentManager/View/ApartmentDefectPage.xaml +++ b/ApartmentManager/ApartmentManager/View/ApartmentDefectPage.xaml @@ -1,46 +1,91 @@  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ApartmentManager/ApartmentManager/View/ApartmentNewDefect.xaml b/ApartmentManager/ApartmentManager/View/ApartmentNewDefect.xaml index b67aad6..c6332e1 100644 --- a/ApartmentManager/ApartmentManager/View/ApartmentNewDefect.xaml +++ b/ApartmentManager/ApartmentManager/View/ApartmentNewDefect.xaml @@ -1,12 +1,17 @@  + + + + @@ -16,29 +21,29 @@ - - + + + + + +