diff options
16 files changed, 0 insertions, 841 deletions
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<Apartment> apartmentslist = JsonConvert.DeserializeObject<IEnumerable<Apartment>>(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<Apartment> apartmentlist = JsonConvert.DeserializeObject<IEnumerable<Apartment>>(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<Apartment> apartmentslist = JsonConvert.DeserializeObject<IEnumerable<Apartment>>(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<Apartment> apartmentslist = JsonConvert.DeserializeObject<IEnumerable<Apartment>>(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<Resident> residentlist = JsonConvert.DeserializeObject<IEnumerable<Resident>>(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<Resident> residentlist = JsonConvert.DeserializeObject<IEnumerable<Resident>>(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<Resident> residentlist = JsonConvert.DeserializeObject<IEnumerable<Resident>>(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<Resident> residentlist = JsonConvert.DeserializeObject<IEnumerable<Resident>>(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> Apartment { get; set; } - public ObservableCollection<User> User { get; set; } - public ObservableCollection<Resident> Residents { get; set; } - public ObservableCollection<Defect> Defects { get; set; } - private BoardMemberCatalogSingleton() - { - Apartment = new ObservableCollection<Apartment>(); - - User = new ObservableCollection<User>(); - //User.Add(new User("Bibis", "Kiausiai", "3214568", new DateTime(2017, 1, 5, 2, 27, 0), "Bibis@mail.com", 1)); - //Apartment = new ObservableCollection<Apartment>(); - //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<Resident>(); - //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<Defect>(); - //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 @@ -<Page - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:ApartmentManager.View" - xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:ViewModel="using:ApartmentManager.ViewModel" - x:Class="ApartmentManager.View.BoardMemberCreateApartmentPage" - mc:Ignorable="d"> - - - <Page.DataContext> - <ViewModel:BoardMemberViewModel/> - </Page.DataContext> - - - <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> - <StackPanel HorizontalAlignment="Center" Orientation="Vertical" VerticalAlignment="Center"> - <TextBlock Margin="0,10,0,10" Text="Apartment information:" HorizontalAlignment="Center" FontSize="20" FontWeight="Bold"/> - <TextBlock Margin="0,10,0,10" Text="Apartment number:"/> - <TextBox Text="{Binding NewApartment.ApartmentNumber, Mode=TwoWay}" /> - <TextBlock Margin="0,10,0,10" Text="Square meters:"/> - <TextBox Text="{Binding NewApartment.Size, Mode=TwoWay}" /> - <TextBlock Margin="0,10,0,10" Text="Number of rooms:"/> - <TextBox Text="{Binding NewApartment.NumberOfRooms}"></TextBox> - <TextBlock Margin="0,10,0,10" Text="Monthly charge:"/> - <TextBox Text="{Binding NewApartment.MonthlyCharge, Mode=TwoWay}" /> - <TextBlock Margin="0,10,0,10" Text="Floor:"/> - <TextBox Text="{Binding NewApartment.Floor, Mode=TwoWay}" /> - <TextBlock Margin="0,10,0,10" Text="Address:" ></TextBlock> - <TextBox Text="{Binding NewApartment.Floor, Mode=TwoWay}"></TextBox> - <Button Content="Add" Width="225" Margin="0 20" Command="{Binding CreateApartmentCommand}"></Button> - </StackPanel> - </Grid> -</Page> 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 -{ - /// <summary> - /// An empty page that can be used on its own or navigated to within a Frame. - /// </summary> - 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 @@ -<Page - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:ApartmentManager.View" - xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:ViewModel="using:ApartmentManager.ViewModel" - x:Class="ApartmentManager.View.BoardMemberManageApartment" - mc:Ignorable="d"> - - - <Page.DataContext> - <ViewModel:BoardMemberViewModel/> - </Page.DataContext> - - <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> - - <StackPanel Margin="0 0" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="top" Width="1100" > - <StackPanel Orientation="Vertical"> - <Frame Background="Bisque"> - <ListView FontSize="20" FontWeight="Bold" FontFamily="Georgia" HorizontalAlignment="Left" VerticalAlignment="Top" Width="1100" ItemsSource="{Binding BoardMemberCatalogSingleton.Apartment}" SelectedItem="{Binding NewApartment, Mode=TwoWay}" Height="567"/> - </Frame> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0 0"> - <Button Width="150" Margin="50 0" Content="View residents" Click="ButtonBase_OnClick"></Button> - <Button Width="150" Content="Add apartment" Click="CreateApartment" VerticalAlignment="Bottom" HorizontalAlignment="Center"></Button> - <Button Width="150" Margin="50 0" Content="Delete apartment" Command="{Binding DeleteApartmentCommand}" VerticalAlignment="Bottom" HorizontalAlignment="Center"></Button> - <Button Width="150" Content="Update apartment" VerticalAlignment="Bottom" HorizontalAlignment="Center"></Button> - <TextBox Width="150" Text="Filter apartments" Margin="50 0" Name="TextFilter"></TextBox> - </StackPanel> - </StackPanel> - </StackPanel> - </Grid> -</Page> 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 -{ - /// <summary> - /// An empty page that can be used on its own or navigated to within a Frame. - /// </summary> - 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 @@ -<Page - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:ApartmentManager.View" - xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:ViewModel="using:ApartmentManager.ViewModel" - x:Class="ApartmentManager.View.BoardMembersDefectsPage" - mc:Ignorable="d"> - - <Page.DataContext> - <ViewModel:BoardMemberViewModel/> - </Page.DataContext> - - <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> - <StackPanel> - <ListView Margin="100" ItemsSource="{Binding BoardMemberCatalogSingleton.Defects}" SelectedItem="{Binding NewDefect, Mode=TwoWay}"/> - <StackPanel Margin="100 0" > - <TextBlock Text="{Binding BoardMemberCatalogSingleton.Defects[0].ApartmentNumber}" FontSize="20"/> - <TextBlock Text="{Binding BoardMemberCatalogSingleton.Defects[0].Name}"></TextBlock> - <TextBlock Text="{Binding BoardMemberCatalogSingleton.Defects[0].DateUploaded}"></TextBlock> - <TextBlock Text="{Binding BoardMemberCatalogSingleton.Defects[0].Comment}"></TextBlock> - <TextBlock Text="{Binding BoardMemberCatalogSingleton.Defects[0].DefectNumber}"></TextBlock> - <TextBlock Text="{Binding BoardMemberCatalogSingleton.Defects[0].Description}"></TextBlock> - <TextBlock Text="{Binding BoardMemberCatalogSingleton.Defects[0].Status}"></TextBlock> - </StackPanel> - <Button Content="View pictures" Margin="100 40" Click="PicturesDefects"></Button> - </StackPanel> - </Grid> -</Page> 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 -{ - /// <summary> - /// An empty page that can be used on its own or navigated to within a Frame. - /// </summary> - 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 @@ -<Page - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:ApartmentManager.View" - xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:ViewModel="using:ApartmentManager.ViewModel" - x:Class="ApartmentManager.View.BoardMembersMainPage" - mc:Ignorable="d"> - <Page.DataContext> - <ViewModel:BoardMemberViewModel/> - </Page.DataContext> - - - <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> - <StackPanel Orientation="Vertical"> - <TextBlock Text="Welcome to board memeber page" HorizontalAlignment="Center" FontSize="30" Margin="0 10"></TextBlock> - <StackPanel Orientation="Vertical" HorizontalAlignment="Right" VerticalAlignment="top" > - <Image Source="../Assets/Ostbanehus.jpg" Margin="0 0 0 40" Width="600"/> - <TextBlock Text="Manage:" FontSize="30" HorizontalAlignment="Center" Margin="0 20"></TextBlock> - <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="270 0"> - <!--<Button Width="150" Height="80" Content="Residents" Click="Residents" VerticalAlignment="Bottom" HorizontalAlignment="Center"/>--> - <Button Width="150" Height="80" Margin="150 0" Content="Defects" Click="Defects" VerticalAlignment="Bottom" HorizontalAlignment="Center"/> - <Button Width="150" Height="80" Margin="100 0" Content="Apartments" Click="Apartments" VerticalAlignment="Bottom" HorizontalAlignment="Center"/> - </StackPanel> - </StackPanel> - </StackPanel> - </Grid> -</Page> diff --git a/ApartmentManager/ApartmentManager/View/BoardMembersMainPage.xaml.cs b/ApartmentManager/ApartmentManager/View/BoardMembersMainPage.xaml.cs deleted file mode 100644 index 3cde697..0000000 --- a/ApartmentManager/ApartmentManager/View/BoardMembersMainPage.xaml.cs +++ /dev/null @@ -1,45 +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 -{ - /// <summary> - /// An empty page that can be used on its own or navigated to within a Frame. - /// </summary> - public sealed partial class BoardMembersMainPage : Page - { - public BoardMembersMainPage() - { - this.InitializeComponent(); - } - - private void Defects(object sender, RoutedEventArgs e) - { - Frame.Navigate(typeof(BoardMembersDefectsPage)); - } - - private void Apartments(object sender, RoutedEventArgs e) - { - this.Frame.Navigate(typeof(BoardMemberManageApartment)); - } - - private void Residents(object sender, RoutedEventArgs e) - { - this.Frame.Navigate(typeof(ApartmentResidentsPage)); - } - } -} diff --git a/ApartmentManager/ApartmentManager/View/DefectsPicturesBoard.xaml b/ApartmentManager/ApartmentManager/View/DefectsPicturesBoard.xaml deleted file mode 100644 index aea4544..0000000 --- a/ApartmentManager/ApartmentManager/View/DefectsPicturesBoard.xaml +++ /dev/null @@ -1,30 +0,0 @@ -<Page - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:ApartmentManager.View" - xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:ViewModel="using:ApartmentManager.ViewModel" - x:Class="ApartmentManager.View.DefectsPicturesBoard" - mc:Ignorable="d"> - - <Page.DataContext> - <ViewModel:BoardMemberViewModel/> - </Page.DataContext> - - <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> - <StackPanel Orientation="Vertical"> - <StackPanel Margin="0 50" Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Center"> - <Image Width="500" Source="../Assets/Person3.jpg"></Image> - <Image Width="500" Source="../Assets/Person1.jpg" Height="309"></Image> - <Image Width="500" Source="../Assets/Person2.jpg"></Image> - </StackPanel> - <StackPanel Orientation="Vertical"> - <TextBlock Text="Description of the deffect:" HorizontalAlignment="Center" FontSize="20"></TextBlock> - <TextBlock Text="{Binding BoardMemberCatalogSingleton.Defects[0].Description}" TextWrapping="Wrap" Margin="0 10" Width="400"></TextBlock> - <TextBlock Text="Comment" HorizontalAlignment="Center" FontSize="20"></TextBlock> - <TextBlock Text="{Binding BoardMemberCatalogSingleton.Defects[0].Comment}" TextWrapping="Wrap" Margin="0 10" Width="400"></TextBlock> - </StackPanel> - </StackPanel> - </Grid> -</Page> diff --git a/ApartmentManager/ApartmentManager/View/DefectsPicturesBoard.xaml.cs b/ApartmentManager/ApartmentManager/View/DefectsPicturesBoard.xaml.cs deleted file mode 100644 index de9332c..0000000 --- a/ApartmentManager/ApartmentManager/View/DefectsPicturesBoard.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 -{ - /// <summary> - /// An empty page that can be used on its own or navigated to within a Frame. - /// </summary> - public sealed partial class DefectsPicturesBoard : Page - { - public DefectsPicturesBoard() - { - this.InitializeComponent(); - } - } -} diff --git a/ApartmentManager/ApartmentManager/View/InfoForBoardMembers.xaml b/ApartmentManager/ApartmentManager/View/InfoForBoardMembers.xaml deleted file mode 100644 index e5400a1..0000000 --- a/ApartmentManager/ApartmentManager/View/InfoForBoardMembers.xaml +++ /dev/null @@ -1,48 +0,0 @@ -<Page - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:ApartmentManager.View" - xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:ViewModel="using:ApartmentManager.ViewModel" - x:Class="ApartmentManager.View.InfoForBoardMembers" - mc:Ignorable="d"> - - <Page.DataContext> - <ViewModel:BoardMemberViewModel/> - </Page.DataContext> - - <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> - <StackPanel Margin="50" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="top" > - <StackPanel Width="650"> - <StackPanel> - <ListView ItemsSource="{Binding BoardMemberCatalogSingleton.Residents}" SelectedItem="{Binding NewResident, Mode=TwoWay}"></ListView> - </StackPanel> - </StackPanel> - <StackPanel Margin="50" Orientation="Horizontal" HorizontalAlignment="Right"> - <StackPanel Width="400" Margin="0,0,50,0"> - <StackPanel Orientation="Vertical" HorizontalAlignment="Left"> - <Image Source="../Assets/Person1.jpg"></Image> - <TextBlock Margin="0,10,0,10" Text="Resident Info" HorizontalAlignment="Center" FontSize="20" FontWeight="Bold"/> - <TextBlock Margin="0,10,0,10" Text="Name"/> - <TextBox Text="{Binding NewResident.Name, Mode=TwoWay}" /> - <TextBlock Margin="0,10,0,10" Text="Last Name"/> - <TextBox Text="{Binding NewResident.LastName, Mode=TwoWay}" /> - <TextBlock Margin="0,10,0,10" Text="Birthdate"/> - <DatePicker HorizontalAlignment="Stretch" Date="{Binding NewResident.BirthDate, Mode=TwoWay}"/> - <TextBlock Margin="0,10,0,10" Text="Email Address"/> - <TextBox Text="{Binding NewResident.Email, Mode=TwoWay}" /> - <TextBlock Margin="0,10,0,10" Text="Phone Number"/> - <TextBox Text="{Binding NewResident.Phone, Mode=TwoWay}" /> - <StackPanel Orientation="Horizontal"> - <Button Margin="0,10,12,10" Content="Create" Width="125"/> - <Button Margin="0,10,0,10" Content="Delte" Width="125"/> - <Button Margin="13,10,0,10" Content="Update" Width="125"/> - </StackPanel> - </StackPanel> - </StackPanel> - </StackPanel> - </StackPanel> - - </Grid> -</Page> diff --git a/ApartmentManager/ApartmentManager/View/InfoForBoardMembers.xaml.cs b/ApartmentManager/ApartmentManager/View/InfoForBoardMembers.xaml.cs deleted file mode 100644 index ebefddc..0000000 --- a/ApartmentManager/ApartmentManager/View/InfoForBoardMembers.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 -{ - /// <summary> - /// An empty page that can be used on its own or navigated to within a Frame. - /// </summary> - public sealed partial class InfoForBoardMembers : Page - { - public InfoForBoardMembers() - { - this.InitializeComponent(); - } - } -} diff --git a/ApartmentManager/ApartmentManager/ViewModel/BoardMemberViewModel.cs b/ApartmentManager/ApartmentManager/ViewModel/BoardMemberViewModel.cs deleted file mode 100644 index db80503..0000000 --- a/ApartmentManager/ApartmentManager/ViewModel/BoardMemberViewModel.cs +++ /dev/null @@ -1,104 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Input; -using ApartmentManager.Annotations; -using ApartmentManager.Common; -using ApartmentManager.Model; -using ApartmentManager.Singletons; - -namespace ApartmentManager.ViewModel -{ - public class BoardMemberViewModel : INotifyPropertyChanged - { - public BoardMemberCatalogSingleton BoardMemberCatalogSingleton { get; set; } - - public UserSingleton UserSingleton { get; set; } - private User _newUser; - private Resident _newResident; - private Apartment _newApartment; - private Defect _newDefect; - - public static int ApartmentsNumber { get; set; } - public Handler.BoardMemberHandler BoardMemberHandler { get; set; } - - public Handler.BoardResidentsHandler BoardResidentsHandler { get; set; } - - public ICommand CreateApartmentCommand { get; set; } - public ICommand DeleteApartmentCommand { get; set; } - public ICommand UpdateApartmentCommand { get; set; } - - public ICommand DeleteDefectCommand { get; set; } - - public BoardMemberViewModel() - { - NewUser = new User(); - NewResident = new Resident(); - NewApartment = new Apartment(); - NewDefect = new Defect(); - - BoardResidentsHandler = new Handler.BoardResidentsHandler(this); - BoardMemberHandler = new Handler.BoardMemberHandler(this); - BoardMemberCatalogSingleton = BoardMemberCatalogSingleton.Instance; - UserSingleton = UserSingleton.Instance; - ApartmentsNumber = UserSingleton.CurrentUser.ApartmentId; - - CreateApartmentCommand = new RelayCommand(BoardMemberHandler.CreateApartment); - DeleteApartmentCommand = new RelayCommand(BoardMemberHandler.DeleteApartment); - UpdateApartmentCommand = new RelayCommand(BoardMemberHandler.UpdateApartment); - BoardMemberHandler.GetApartments(); - BoardResidentsHandler.GetApartmentsResidents(); - } - - public User NewUser - { - get => _newUser; - set - { - _newUser = value; - OnPropertyChanged(); - } - } - public Resident NewResident - { - get => _newResident; - set - { - _newResident = value; - OnPropertyChanged(); - } - } - - public Apartment NewApartment - { - get => _newApartment; - set - { - _newApartment = value; - OnPropertyChanged(); - } - } - - public Defect NewDefect - { - get => _newDefect; - set - { - _newDefect = value; - OnPropertyChanged(); - } - } - - public event PropertyChangedEventHandler PropertyChanged; - - [NotifyPropertyChangedInvocator] - protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) - { - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); - } - } -} |