diff options
19 files changed, 502 insertions, 8 deletions
diff --git a/ApartmentManager/ApartmentManager.sln b/ApartmentManager/ApartmentManager.sln index 031a632..3cb16cf 100644 --- a/ApartmentManager/ApartmentManager.sln +++ b/ApartmentManager/ApartmentManager.sln @@ -20,6 +20,8 @@ Global EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {95401ED6-D03C-417D-8897-81B5454D2426}.Debug|Any CPU.ActiveCfg = Debug|x86 + {95401ED6-D03C-417D-8897-81B5454D2426}.Debug|Any CPU.Build.0 = Debug|x86 + {95401ED6-D03C-417D-8897-81B5454D2426}.Debug|Any CPU.Deploy.0 = Debug|x86 {95401ED6-D03C-417D-8897-81B5454D2426}.Debug|ARM.ActiveCfg = Debug|ARM {95401ED6-D03C-417D-8897-81B5454D2426}.Debug|ARM.Build.0 = Debug|ARM {95401ED6-D03C-417D-8897-81B5454D2426}.Debug|ARM.Deploy.0 = Debug|ARM diff --git a/ApartmentManager/ApartmentManager/ApartmentManager.csproj b/ApartmentManager/ApartmentManager/ApartmentManager.csproj index 722865c..26f9885 100644 --- a/ApartmentManager/ApartmentManager/ApartmentManager.csproj +++ b/ApartmentManager/ApartmentManager/ApartmentManager.csproj @@ -100,8 +100,11 @@ </Compile> <Compile Include="Common\RelayCommand.cs" /> <Compile Include="Controls\NavMenuListView.cs" /> - <Compile Include="Handler\ResidentsHandler.cs" /> + <Compile Include="Handler\ApartmentHandler.cs" /> + <Compile Include="Handler\BoardApartmentsHandler.cs" /> <Compile Include="Model\Apartment.cs" /> + <Compile Include="Model\ApartmentsCatalogSingleton.cs" /> + <Compile Include="Model\Defect.cs" /> <Compile Include="Model\NavMenuItem.cs" /> <Compile Include="Model\CatalogSingleton.cs" /> <Compile Include="Model\Resident.cs" /> @@ -109,10 +112,23 @@ <Compile Include="Persistency\PersistenceFacade.cs" /> <Compile Include="Properties\Annotations.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="ViewModel\ApartmentsViewModel.cs" /> <Compile Include="ViewModel\ApartmenViewModel.cs" /> <Compile Include="View\ApartmentPage.xaml.cs"> <DependentUpon>ApartmentPage.xaml</DependentUpon> </Compile> + <Compile Include="View\BoardMembersDefectsPage.xaml.cs"> + <DependentUpon>BoardMembersDefectsPage.xaml</DependentUpon> + </Compile> + <Compile Include="View\BoardMembersPage.xaml.cs"> + <DependentUpon>BoardMembersPage.xaml</DependentUpon> + </Compile> + <Compile Include="View\DefectsPicturesBoard.xaml.cs"> + <DependentUpon>DefectsPicturesBoard.xaml</DependentUpon> + </Compile> + <Compile Include="View\InfoForBoardMembers.xaml.cs"> + <DependentUpon>InfoForBoardMembers.xaml</DependentUpon> + </Compile> <Compile Include="View\LoginPage.xaml.cs"> <DependentUpon>LoginPage.xaml</DependentUpon> </Compile> @@ -132,6 +148,10 @@ </AppxManifest> </ItemGroup> <ItemGroup> + <Content Include="Assets\BrokenDownpipe.jpg" /> + <Content Include="Assets\Person1.jpg" /> + <Content Include="Assets\Person2.jpg" /> + <Content Include="Assets\Person3.jpg" /> <Content Include="Assets\plan.jpg" /> <Content Include="Properties\Default.rd.xml" /> <Content Include="Assets\LockScreenLogo.scale-200.png" /> @@ -159,6 +179,22 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="View\BoardMembersDefectsPage.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="View\BoardMembersPage.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="View\DefectsPicturesBoard.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="View\InfoForBoardMembers.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="View\LoginPage.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> diff --git a/ApartmentManager/ApartmentManager/Assets/BrokenDownpipe.jpg b/ApartmentManager/ApartmentManager/Assets/BrokenDownpipe.jpg Binary files differnew file mode 100644 index 0000000..34cb5b2 --- /dev/null +++ b/ApartmentManager/ApartmentManager/Assets/BrokenDownpipe.jpg diff --git a/ApartmentManager/ApartmentManager/Assets/Person1.jpg b/ApartmentManager/ApartmentManager/Assets/Person1.jpg Binary files differnew file mode 100644 index 0000000..edf9716 --- /dev/null +++ b/ApartmentManager/ApartmentManager/Assets/Person1.jpg diff --git a/ApartmentManager/ApartmentManager/Assets/Person2.jpg b/ApartmentManager/ApartmentManager/Assets/Person2.jpg Binary files differnew file mode 100644 index 0000000..4e67876 --- /dev/null +++ b/ApartmentManager/ApartmentManager/Assets/Person2.jpg diff --git a/ApartmentManager/ApartmentManager/Assets/Person3.jpg b/ApartmentManager/ApartmentManager/Assets/Person3.jpg Binary files differnew file mode 100644 index 0000000..b9ed3a7 --- /dev/null +++ b/ApartmentManager/ApartmentManager/Assets/Person3.jpg diff --git a/ApartmentManager/ApartmentManager/Handler/BoardApartmentsHandler.cs b/ApartmentManager/ApartmentManager/Handler/BoardApartmentsHandler.cs new file mode 100644 index 0000000..f988489 --- /dev/null +++ b/ApartmentManager/ApartmentManager/Handler/BoardApartmentsHandler.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using ApartmentManager.ViewModel; + +namespace ApartmentManager.Handler +{ + class BoardApartmentsHandler + { + public ApartmentsViewModel ApartmentsViewModel { get; set; } + + public BoardApartmentsHandler(ApartmentsViewModel apartmentsViewModel) + { + ApartmentsViewModel = apartmentsViewModel; + } + } +} diff --git a/ApartmentManager/ApartmentManager/Model/Apartment.cs b/ApartmentManager/ApartmentManager/Model/Apartment.cs index fb67904..1a37f96 100644 --- a/ApartmentManager/ApartmentManager/Model/Apartment.cs +++ b/ApartmentManager/ApartmentManager/Model/Apartment.cs @@ -28,12 +28,11 @@ namespace ApartmentManager.Model } - //public override string ToString() - //{ - // return string.Format($"Name {Name} LastName {LastName} Phone {Phone}"); - //} - - - + public override string ToString() + { + return string.Format( + "Apartment No: {0} Size: {1} NoOfRooms: {2} MonthlyCharge: {3} Floor: {4} Address: {5}", + ApartmentNumber, Size, NumberOfRooms, MonthlyCharge, Floor, Address); + } } } diff --git a/ApartmentManager/ApartmentManager/Model/ApartmentsCatalogSingleton.cs b/ApartmentManager/ApartmentManager/Model/ApartmentsCatalogSingleton.cs new file mode 100644 index 0000000..b9e8bfc --- /dev/null +++ b/ApartmentManager/ApartmentManager/Model/ApartmentsCatalogSingleton.cs @@ -0,0 +1,45 @@ +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 +{ + class ApartmentsCatalogSingleton + { + private static ApartmentsCatalogSingleton instance = new ApartmentsCatalogSingleton(); + + public static ApartmentsCatalogSingleton 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 ApartmentsCatalogSingleton() + { + 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(), "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/Model/Defect.cs b/ApartmentManager/ApartmentManager/Model/Defect.cs new file mode 100644 index 0000000..f695c95 --- /dev/null +++ b/ApartmentManager/ApartmentManager/Model/Defect.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Windows.UI.Xaml.Controls; + +namespace ApartmentManager.Model +{ + 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 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) + { + this.DefectNumber = DefectNumber; + this.ApartmentNumber = ApartmentNumber; + this.Name = Name; + this.DateUploaded = DateUploaded; + this.Picture = Picture; + this.Picture2 = Picture2; + this.Picture3 = Picture3; + this.Description = Description; + this.Comment = Comment; + this.Status = Status; + } + public override string ToString() + { + return string.Format($"Defect Number: {DefectNumber}, Apartment Number: {ApartmentNumber}, Name: {Name}, Date Uploaded {DateUploaded}, {Picture}, {Picture2}, {Picture3}, Description: {Description}, Comment: {Comment}, Status: {Status}"); + } + } +} diff --git a/ApartmentManager/ApartmentManager/View/BoardMembersDefectsPage.xaml b/ApartmentManager/ApartmentManager/View/BoardMembersDefectsPage.xaml new file mode 100644 index 0000000..58b0f3d --- /dev/null +++ b/ApartmentManager/ApartmentManager/View/BoardMembersDefectsPage.xaml @@ -0,0 +1,30 @@ +<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:ApartmentsViewModel/> + </Page.DataContext> + + <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> + <StackPanel> + <ListView Margin="100" ItemsSource="{Binding ApartmentsCatalogSingleton.Defects}" SelectedItem="{Binding NewDefect, Mode=TwoWay}"/> + <StackPanel Margin="100 0" > + <TextBlock Text="{Binding ApartmentsCatalogSingleton.Defects[0].ApartmentNumber}" FontSize="20"/> + <TextBlock Text="{Binding ApartmentsCatalogSingleton.Defects[0].Name}"></TextBlock> + <TextBlock Text="{Binding ApartmentsCatalogSingleton.Defects[0].DateUploaded}"></TextBlock> + <TextBlock Text="{Binding ApartmentsCatalogSingleton.Defects[0].Comment}"></TextBlock> + <TextBlock Text="{Binding ApartmentsCatalogSingleton.Defects[0].DefectNumber}"></TextBlock> + <TextBlock Text="{Binding ApartmentsCatalogSingleton.Defects[0].Description}"></TextBlock> + <TextBlock Text="{Binding ApartmentsCatalogSingleton.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 new file mode 100644 index 0000000..d910d39 --- /dev/null +++ b/ApartmentManager/ApartmentManager/View/BoardMembersDefectsPage.xaml.cs @@ -0,0 +1,35 @@ +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/BoardMembersPage.xaml b/ApartmentManager/ApartmentManager/View/BoardMembersPage.xaml new file mode 100644 index 0000000..9acc60e --- /dev/null +++ b/ApartmentManager/ApartmentManager/View/BoardMembersPage.xaml @@ -0,0 +1,25 @@ +<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.BoardMembersPage" + mc:Ignorable="d"> + <Page.DataContext> + <ViewModel:ApartmentsViewModel/> + </Page.DataContext> + + + <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> + <StackPanel Margin="50" Orientation="Vertical" HorizontalAlignment="Right" VerticalAlignment="top" > + <ListView HorizontalAlignment="Left" Margin="0,0,50,0" VerticalAlignment="Top" ItemsSource="{Binding ApartmentsCatalogSingleton.Apartment}" SelectedItem="{Binding NewApartment, Mode=TwoWay}"/> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 100"> + <Button Width="150" Content="Residents" Click="Apartment" VerticalAlignment="Bottom" HorizontalAlignment="Center"></Button> + <Button Width="150" Margin="40 0" Content="Defects" Click="ButtonBase_OnClick" VerticalAlignment="Bottom" HorizontalAlignment="Center"></Button> + <Button Width="150" Content="Apartment" VerticalAlignment="Bottom" HorizontalAlignment="Center"></Button> + </StackPanel> + </StackPanel> + </Grid> +</Page> diff --git a/ApartmentManager/ApartmentManager/View/BoardMembersPage.xaml.cs b/ApartmentManager/ApartmentManager/View/BoardMembersPage.xaml.cs new file mode 100644 index 0000000..2ac43c8 --- /dev/null +++ b/ApartmentManager/ApartmentManager/View/BoardMembersPage.xaml.cs @@ -0,0 +1,40 @@ +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 BoardMembersPage : Page + { + public BoardMembersPage() + { + this.InitializeComponent(); + } + + private void ButtonBase_OnClick(object sender, RoutedEventArgs e) + { + Frame.Navigate(typeof(BoardMembersDefectsPage)); + } + + private void Apartment(object sender, RoutedEventArgs e) + { + this.Frame.Navigate(typeof(InfoForBoardMembers)); + } + } +} diff --git a/ApartmentManager/ApartmentManager/View/DefectsPicturesBoard.xaml b/ApartmentManager/ApartmentManager/View/DefectsPicturesBoard.xaml new file mode 100644 index 0000000..6c038c7 --- /dev/null +++ b/ApartmentManager/ApartmentManager/View/DefectsPicturesBoard.xaml @@ -0,0 +1,29 @@ +<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:ApartmentsViewModel/> + </Page.DataContext> + + <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> + <StackPanel Margin="0 50" Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Center"> + <Image Width="500" Source="../Assets/Person3.jpg"></Image> + <StackPanel> + <Image Width="500" Source="../Assets/Person1.jpg" Height="309"></Image> + </StackPanel> + <StackPanel> + <Image Width="500" Source="../Assets/Person2.jpg"></Image> + </StackPanel> + <!--<Image Source="{Binding ApartmentsCatalogSingleton.Defects[0].Picture}"></Image> + <Image Source="{Binding ApartmentsCatalogSingleton.Defects[0].Picture2}"></Image> + <Image Source="{Binding ApartmentsCatalogSingleton.Defects[0].Picture3}"></Image>--> + </StackPanel> + </Grid> +</Page> diff --git a/ApartmentManager/ApartmentManager/View/DefectsPicturesBoard.xaml.cs b/ApartmentManager/ApartmentManager/View/DefectsPicturesBoard.xaml.cs new file mode 100644 index 0000000..de9332c --- /dev/null +++ b/ApartmentManager/ApartmentManager/View/DefectsPicturesBoard.xaml.cs @@ -0,0 +1,30 @@ +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 new file mode 100644 index 0000000..6ff3559 --- /dev/null +++ b/ApartmentManager/ApartmentManager/View/InfoForBoardMembers.xaml @@ -0,0 +1,49 @@ +<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:ApartmentsViewModel/> + </Page.DataContext> + + <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> + <StackPanel Margin="50" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="top" > + + <StackPanel Width="650"> + <StackPanel> + <ListView ItemsSource="{Binding ApartmentsCatalogSingleton.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 new file mode 100644 index 0000000..ebefddc --- /dev/null +++ b/ApartmentManager/ApartmentManager/View/InfoForBoardMembers.xaml.cs @@ -0,0 +1,30 @@ +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/ApartmentsViewModel.cs b/ApartmentManager/ApartmentManager/ViewModel/ApartmentsViewModel.cs new file mode 100644 index 0000000..088023c --- /dev/null +++ b/ApartmentManager/ApartmentManager/ViewModel/ApartmentsViewModel.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; +using ApartmentManager.Annotations; +using ApartmentManager.Model; + +namespace ApartmentManager.ViewModel +{ + class ApartmentsViewModel : INotifyPropertyChanged + { + public ApartmentsCatalogSingleton ApartmentsCatalogSingleton { get; set; } + private User _newUser; + private Resident _newResident; + private Apartment _newApartment; + private Defect _newDefect; + + public static int ApartmentsNumber { get; set; } + public Handler.BoardApartmentsHandler BoardApartmentsHandler { get; set; } + + public ApartmentsViewModel() + { + NewUser = new User(); + NewResident = new Resident(); + NewApartment = new Apartment(); + NewDefect = new Defect(); + BoardApartmentsHandler = new Handler.BoardApartmentsHandler(this); + ApartmentsCatalogSingleton = ApartmentsCatalogSingleton.Instance; + ApartmentsNumber = ApartmentsCatalogSingleton.User[0].ApartmentNr; + } + + 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)); + } + } +} |