diff options
author | Donatas Adamonis <dona0169@edu.easj.dk> | 2017-05-10 19:53:42 +0200 |
---|---|---|
committer | Donatas Adamonis <dona0169@edu.easj.dk> | 2017-05-10 19:53:42 +0200 |
commit | 87f614c574572e567eb251a66438e3d370c3f1f5 (patch) | |
tree | 95d30c2d67e922fd33d1a17dc6aa6a58e37d1733 | |
parent | 3a34870caabcc05f7d07ad5d93b30d15169132ac (diff) |
qwe
6 files changed, 40 insertions, 45 deletions
diff --git a/ApartmentManager/ApartmentManager/Handler/ApartmentHandler.cs b/ApartmentManager/ApartmentManager/Handler/ApartmentHandler.cs index 0310f80..7bc39f9 100644 --- a/ApartmentManager/ApartmentManager/Handler/ApartmentHandler.cs +++ b/ApartmentManager/ApartmentManager/Handler/ApartmentHandler.cs @@ -24,7 +24,7 @@ namespace ApartmentManager.Handler { Resident resident = new Resident(); resident.ApartmentNr = ApartmentViewModel.ApartmentNumber; - + var residentsFromDatabase = ApiClient.GetData("api/ApartmentResidents/" + resident.ApartmentNr); IEnumerable<Resident> residentlist = JsonConvert.DeserializeObject<IEnumerable<Resident>>(residentsFromDatabase); @@ -32,18 +32,16 @@ namespace ApartmentManager.Handler ApartmentViewModel.NewResident = new Resident(); foreach (var resident2 in residentlist) { - ApartmentViewModel.CatalogSingleton.Residents.Add(resident2); + ApartmentViewModel.CatalogSingleton.Residents.Add(resident2); } - + } public void GetApartment() { string serializedApartment = ApiClient.GetData("api/Apartments/" + ApartmentViewModel.ApartmentNumber); - Apartment apartment= JsonConvert.DeserializeObject<Apartment>(serializedApartment); + Apartment apartment = JsonConvert.DeserializeObject<Apartment>(serializedApartment); ApartmentViewModel.CatalogSingleton.Apartment = apartment; - - } public void CreateResident() @@ -51,7 +49,6 @@ namespace ApartmentManager.Handler try { Resident resident = new Resident(); - resident.ApartmentNr = ApartmentViewModel.ApartmentNumber; resident.FirstName = ApartmentViewModel.NewResident.FirstName; resident.LastName = ApartmentViewModel.NewResident.LastName; @@ -123,7 +120,7 @@ namespace ApartmentManager.Handler resident.Picture = ApartmentViewModel.NewResident.Picture; resident.Phone = ApartmentViewModel.NewResident.Phone; - ApiClient.PutData("api/residents/" + resident.ResidentNr,resident); + ApiClient.PutData("api/residents/" + resident.ResidentNr, resident); var residentsFromDatabase = ApiClient.GetData("api/ApartmentResidents/" + resident.ApartmentNr); IEnumerable<Resident> residentlist = JsonConvert.DeserializeObject<IEnumerable<Resident>>(residentsFromDatabase); @@ -148,10 +145,10 @@ namespace ApartmentManager.Handler } catch (Exception e) { - - + + } - + } - } + } } diff --git a/ApartmentManager/ApartmentManager/Model/Apartment.cs b/ApartmentManager/ApartmentManager/Model/Apartment.cs index 1a37f96..c5754a9 100644 --- a/ApartmentManager/ApartmentManager/Model/Apartment.cs +++ b/ApartmentManager/ApartmentManager/Model/Apartment.cs @@ -14,6 +14,7 @@ namespace ApartmentManager.Model public string MonthlyCharge { get; set; } public int Floor { get; set; } public string Address { get; set; } + public string PlanPicture { get; set; } public Apartment() { } @@ -25,6 +26,7 @@ namespace ApartmentManager.Model this.MonthlyCharge = MonthlyCharge; this.Floor = Floor; this.Address = Address; + } diff --git a/ApartmentManager/ApartmentManager/View/ApartmentDefectPage.xaml b/ApartmentManager/ApartmentManager/View/ApartmentDefectPage.xaml index 405576c..760d56f 100644 --- a/ApartmentManager/ApartmentManager/View/ApartmentDefectPage.xaml +++ b/ApartmentManager/ApartmentManager/View/ApartmentDefectPage.xaml @@ -9,37 +9,32 @@ <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> - <Grid Background="LightGray" Height="170" Margin="0,0,0,5"> + <Grid Background="LightGray" Height="200" Margin="0,0,0,5"> <Grid.ColumnDefinitions> - <ColumnDefinition Width="170"/> + <ColumnDefinition Width="200"/> <ColumnDefinition /> </Grid.ColumnDefinitions> <Grid Grid.Column="0" Background="Gray" BorderThickness="0,0,2,0" BorderBrush="#CCFFFFFF" > <Image Stretch="Fill"/> </Grid> - <Grid Grid.Column="1" Margin="3,3,3,3"> + <Grid Grid.Column="1" Margin="2"> <StackPanel Margin="10"> <StackPanel Orientation="Horizontal"> - <TextBlock Text="First Name :" Margin="0,0,10,0" FontSize="30"></TextBlock> - <TextBlock Text="First Name :" Margin="0,0,10,0" FontSize="30"></TextBlock> - <TextBlock Text="Last Name :" Margin="0,0,10,0" FontSize="30"></TextBlock> - <TextBlock Text="Last Name :" Margin="0,0,10,0" FontSize="30"></TextBlock> + <TextBlock Text="Name :" Margin="0,0,10,0" FontSize="30" FontWeight="Bold"></TextBlock> + <TextBlock Text="Broken Pipe" Margin="0,0,10,0" FontSize="30"></TextBlock> + </StackPanel> <StackPanel Orientation="Horizontal"> - <TextBlock Text="Email Address :" Margin="0,0,10,0" FontSize="25"></TextBlock> - <TextBlock Text="Last Name :" Margin="0,0,10,0" FontSize="25"></TextBlock> - </StackPanel> - - <StackPanel Orientation="Horizontal"> - <TextBlock Text="Phone Number :" Margin="0,0,10,0" FontSize="25"></TextBlock> - <TextBlock Text="Last Name :" Margin="0,0,10,0" FontSize="25"></TextBlock> + <TextBlock Text="text text text text text text text text text text text text text texttext text text text text texttext text text text text texttext text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text " TextWrapping="Wrap" Margin="0,0,10,0" FontSize="20" Width="800"></TextBlock> </StackPanel> + <StackPanel Orientation="Horizontal"/> + <StackPanel Orientation="Horizontal"> - <TextBlock Text="Birth Date :" Margin="0,0,10,0" FontSize="25"></TextBlock> - <TextBlock Text="Last Name :" Margin="0,0,10,0" FontSize="25"></TextBlock> + <TextBlock Text="Status" Margin="0,0,10,0" FontSize="25"></TextBlock> + <TextBlock Text="Date" Margin="700,0,10,0" FontSize="25" HorizontalAlignment="Left"></TextBlock> </StackPanel> </StackPanel> diff --git a/ApartmentManager/ApartmentManager/View/ApartmentPage.xaml b/ApartmentManager/ApartmentManager/View/ApartmentPage.xaml index ac8aa40..14e67f7 100644 --- a/ApartmentManager/ApartmentManager/View/ApartmentPage.xaml +++ b/ApartmentManager/ApartmentManager/View/ApartmentPage.xaml @@ -16,7 +16,7 @@ <StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="50" > <StackPanel VerticalAlignment="Top" Margin="50,0,20,0"> - <Image Source="ms-appx:///Assets/plan.jpg" ></Image> + <Image Source="{Binding CatalogSingleton.Apartment.PlanPicture}" MaxWidth="800" MaxHeight="650"></Image> </StackPanel> <StackPanel> @@ -24,33 +24,33 @@ <StackPanel> <StackPanel Orientation="Horizontal"> - <TextBlock Text="Apartment Address :" FontSize="20" Margin="0,0,10,0" /> + <TextBlock Text="Address :" FontSize="20" Margin="0,0,10,0" FontWeight="Bold" /> <TextBlock Text="{Binding CatalogSingleton.Apartment.Address}" FontSize="20"/> </StackPanel> <StackPanel Orientation="Horizontal"> - <TextBlock Text="Floor :" FontSize="20" Margin="0,0,10,0" /> + <TextBlock Text="Floor :" FontSize="20" Margin="0,0,10,0" FontWeight="Bold" /> <TextBlock Text="{Binding CatalogSingleton.Apartment.Floor}" FontSize="20"/> </StackPanel> <StackPanel Orientation="Horizontal"> - <TextBlock Text="Apartment Number :" FontSize="20" Margin="0,0,10,0"/> + <TextBlock Text="Apartment Number :" FontSize="20" Margin="0,0,10,0" FontWeight="Bold"/> <TextBlock Text="{Binding CatalogSingleton.Apartment.ApartmentNumber}" FontSize="20"/> </StackPanel> <StackPanel Orientation="Horizontal"> - <TextBlock Text="Size :" FontSize="20" Margin="0,0,10,0"/> + <TextBlock Text="Size :" FontSize="20" Margin="0,0,10,0" FontWeight="Bold"/> <TextBlock Text="{Binding CatalogSingleton.Apartment.Size}" FontSize="20" Margin="0,0,10,0"/> <TextBlock Text="m2" FontSize="20"/> </StackPanel> <StackPanel Orientation="Horizontal"> - <TextBlock Text="Number of Rooms :" FontSize="20" Margin="0,0,10,0"/> + <TextBlock Text="Number of Rooms :" FontSize="20" Margin="0,0,10,0" FontWeight="Bold"/> <TextBlock Text="{Binding CatalogSingleton.Apartment.NumberOfRooms}" FontSize="20"/> </StackPanel> <StackPanel Orientation="Horizontal"> - <TextBlock Text="Monthly Charge:" FontSize="20" Margin="0,0,10,0"/> + <TextBlock Text="Monthly Charge:" FontSize="20" Margin="0,0,10,0" FontWeight="Bold"/> <TextBlock Text="{Binding CatalogSingleton.Apartment.MonthlyCharge}" FontSize="20" Margin="0,0,10,0"/> <TextBlock Text="DKK" FontSize="20"/> </StackPanel> diff --git a/ApartmentManager/ApartmentManager/View/ApartmentPlanPage.xaml b/ApartmentManager/ApartmentManager/View/ApartmentPlanPage.xaml index badc50f..a9b71e5 100644 --- a/ApartmentManager/ApartmentManager/View/ApartmentPlanPage.xaml +++ b/ApartmentManager/ApartmentManager/View/ApartmentPlanPage.xaml @@ -1,14 +1,19 @@ <Page - x:Class="ApartmentManager.View.ApartmentPlanPage" 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.ApartmentPlanPage" mc:Ignorable="d"> + <Page.DataContext> + <ViewModel:ApartmentViewModel/> + </Page.DataContext> + <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> - <Image Source="ms-appx:///Assets/plan.jpg" Margin="50"></Image> + <Image Source="{Binding CatalogSingleton.Apartment.PlanPicture}" MaxWidth="800" MaxHeight="650" Margin="50"/> </Grid> </Page> diff --git a/ApartmentManager/HousingWebApi/HousingWebApi.csproj b/ApartmentManager/HousingWebApi/HousingWebApi.csproj index da913ec..3c002fd 100644 --- a/ApartmentManager/HousingWebApi/HousingWebApi.csproj +++ b/ApartmentManager/HousingWebApi/HousingWebApi.csproj @@ -151,10 +151,9 @@ </Reference> </ItemGroup> <ItemGroup> - <Compile Include="ApartmentResident.cs" /> - <Compile Include="Controllers\ApartmentResidentsController.cs" /> - <Compile Include="database_firewall_rules.cs" /> + <Compile Include="Models\AllResident.cs" /> <Compile Include="Models\Apartment.cs" /> + <Compile Include="Models\ApartmentResident.cs" /> <Compile Include="Controllers\ApartmentsController.cs" /> <Compile Include="Controllers\DefectsController.cs" /> <Compile Include="Controllers\PastContractOwnersController.cs" /> @@ -193,20 +192,17 @@ <Compile Include="Areas\HelpPage\SampleGeneration\TextSample.cs" /> <Compile Include="Areas\HelpPage\XmlDocumentationProvider.cs" /> <Compile Include="Controllers\HomeController.cs" /> - <Compile Include="DataModel.cs" /> - <Compile Include="Models\ApartmentResident.cs" /> <Compile Include="Models\database_firewall_rules.cs" /> + <Compile Include="DataModel.cs" /> <Compile Include="Models\Defect.cs" /> <Compile Include="Global.asax.cs"> <DependentUpon>Global.asax</DependentUpon> </Compile> - <Compile Include="Models\ListApartmentResidents.cs" /> <Compile Include="Models\PastContractOwner.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="Models\Resident.cs" /> <Compile Include="Models\ResidentList.cs" /> + <Compile Include="Models\Resident.cs" /> <Compile Include="Models\User.cs" /> - <Compile Include="ViewContext.cs" /> </ItemGroup> <ItemGroup> <Content Include="Areas\HelpPage\HelpPage.css" /> |