From 431f0eba3470476116b1be4f77b2a771059bf467 Mon Sep 17 00:00:00 2001 From: Paulius Klezys Date: Fri, 5 May 2017 00:20:19 +0200 Subject: Update --- ApartmentManager/ApartmentManager.sln | 4 +- .../ApartmentManager/ApartmentManager.csproj | 8 + ApartmentManager/ApartmentManager/AppShell.xaml.cs | 26 +- .../ApartmentManager/Assets/Ostbanehus.jpg | Bin 0 -> 106556 bytes .../Handler/BoardApartmentsHandler.cs | 17 ++ .../View/BoardMemberManageApartment.xaml | 31 ++ .../View/BoardMemberManageApartment.xaml.cs | 30 ++ .../ApartmentManager/View/BoardMembersPage.xaml | 22 +- .../ApartmentManager/View/BoardMembersPage.xaml.cs | 7 +- .../View/DefectsPicturesBoard.xaml | 17 +- .../ApartmentManager/View/LoginPage.xaml.cs | 2 +- .../ViewModel/ApartmentsViewModel.cs | 10 + .../HousingWebApi/HousingWebApi.csproj | 315 +++++++++++++++++++++ 13 files changed, 470 insertions(+), 19 deletions(-) create mode 100644 ApartmentManager/ApartmentManager/Assets/Ostbanehus.jpg create mode 100644 ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml create mode 100644 ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml.cs create mode 100644 ApartmentManager/HousingWebApi/HousingWebApi.csproj diff --git a/ApartmentManager/ApartmentManager.sln b/ApartmentManager/ApartmentManager.sln index 3cb16cf..e9cafc6 100644 --- a/ApartmentManager/ApartmentManager.sln +++ b/ApartmentManager/ApartmentManager.sln @@ -41,8 +41,8 @@ Global {95401ED6-D03C-417D-8897-81B5454D2426}.Release|x86.ActiveCfg = Release|x86 {95401ED6-D03C-417D-8897-81B5454D2426}.Release|x86.Build.0 = Release|x86 {95401ED6-D03C-417D-8897-81B5454D2426}.Release|x86.Deploy.0 = Release|x86 - {D777744A-9676-4193-BD59-6F30C724C87A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D777744A-9676-4193-BD59-6F30C724C87A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D777744A-9676-4193-BD59-6F30C724C87A}.Debug|Any CPU.ActiveCfg = Release|Any CPU + {D777744A-9676-4193-BD59-6F30C724C87A}.Debug|Any CPU.Build.0 = Release|Any CPU {D777744A-9676-4193-BD59-6F30C724C87A}.Debug|ARM.ActiveCfg = Debug|Any CPU {D777744A-9676-4193-BD59-6F30C724C87A}.Debug|ARM.Build.0 = Debug|Any CPU {D777744A-9676-4193-BD59-6F30C724C87A}.Debug|x64.ActiveCfg = Debug|Any CPU diff --git a/ApartmentManager/ApartmentManager/ApartmentManager.csproj b/ApartmentManager/ApartmentManager/ApartmentManager.csproj index bf8ee95..74d3c6c 100644 --- a/ApartmentManager/ApartmentManager/ApartmentManager.csproj +++ b/ApartmentManager/ApartmentManager/ApartmentManager.csproj @@ -117,6 +117,9 @@ ApartmentPage.xaml + + BoardMemberManageApartment.xaml + BoardMembersDefectsPage.xaml @@ -149,6 +152,7 @@ + @@ -179,6 +183,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/ApartmentManager/ApartmentManager/AppShell.xaml.cs b/ApartmentManager/ApartmentManager/AppShell.xaml.cs index 0bd4f7f..ca9fb3b 100644 --- a/ApartmentManager/ApartmentManager/AppShell.xaml.cs +++ b/ApartmentManager/ApartmentManager/AppShell.xaml.cs @@ -25,6 +25,30 @@ namespace ApartmentManager Label = "Home", DestPage = typeof(ApartmentPage), IsSelected = true + }, + + new NavMenuItem() + { + Symbol = Symbol.Comment, + Label = "Defects", + DestPage = typeof(BoardMembersDefectsPage), + IsSelected = false + }, + + new NavMenuItem() + { + Symbol = Symbol.Bookmarks, + Label = "Residents", + DestPage = typeof(InfoForBoardMembers), + IsSelected = false + }, + + new NavMenuItem() + { + Symbol = Symbol.Bookmarks, + Label = "Apartments", + DestPage = typeof(BoardMembersPage), + IsSelected = false } }); @@ -39,7 +63,7 @@ namespace ApartmentManager { InitializeComponent(); - List topNavMenuItems = navMenuItems.GetRange(0, 1); + List topNavMenuItems = navMenuItems.GetRange(0, 4); // List bottomNavMenuItems = navMenuItems.GetRange(3, 2); NavMenuList.ItemsSource = topNavMenuItems; diff --git a/ApartmentManager/ApartmentManager/Assets/Ostbanehus.jpg b/ApartmentManager/ApartmentManager/Assets/Ostbanehus.jpg new file mode 100644 index 0000000..a0d11c6 Binary files /dev/null and b/ApartmentManager/ApartmentManager/Assets/Ostbanehus.jpg differ diff --git a/ApartmentManager/ApartmentManager/Handler/BoardApartmentsHandler.cs b/ApartmentManager/ApartmentManager/Handler/BoardApartmentsHandler.cs index f988489..5a2929f 100644 --- a/ApartmentManager/ApartmentManager/Handler/BoardApartmentsHandler.cs +++ b/ApartmentManager/ApartmentManager/Handler/BoardApartmentsHandler.cs @@ -3,6 +3,9 @@ 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; namespace ApartmentManager.Handler @@ -15,5 +18,19 @@ namespace ApartmentManager.Handler { ApartmentsViewModel = apartmentsViewModel; } + + public void CreateApartment() + { + try + { + Apartment apartment = new Apartment(); + apartment.ApartmentNumber = ApartmentsViewModel.ApartmentsNumber; + + } + catch (Exception e) + { + new MessageDialog(e.Message).ShowAsync(); + } + } } } diff --git a/ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml b/ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml new file mode 100644 index 0000000..5deab23 --- /dev/null +++ b/ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml.cs b/ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.xaml.cs new file mode 100644 index 0000000..c291b8b --- /dev/null +++ b/ApartmentManager/ApartmentManager/View/BoardMemberManageApartment.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 +{ + /// + /// 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(); + } + } +} diff --git a/ApartmentManager/ApartmentManager/View/BoardMembersPage.xaml b/ApartmentManager/ApartmentManager/View/BoardMembersPage.xaml index 9acc60e..b606754 100644 --- a/ApartmentManager/ApartmentManager/View/BoardMembersPage.xaml +++ b/ApartmentManager/ApartmentManager/View/BoardMembersPage.xaml @@ -13,12 +13,22 @@ - - - - - - + + + + + + + diff --git a/ApartmentManager/ApartmentManager/View/BoardMembersPage.xaml.cs b/ApartmentManager/ApartmentManager/View/BoardMembersPage.xaml.cs index 2ac43c8..b7eb548 100644 --- a/ApartmentManager/ApartmentManager/View/BoardMembersPage.xaml.cs +++ b/ApartmentManager/ApartmentManager/View/BoardMembersPage.xaml.cs @@ -27,7 +27,7 @@ namespace ApartmentManager.View this.InitializeComponent(); } - private void ButtonBase_OnClick(object sender, RoutedEventArgs e) + private void Defect(object sender, RoutedEventArgs e) { Frame.Navigate(typeof(BoardMembersDefectsPage)); } @@ -36,5 +36,10 @@ namespace ApartmentManager.View { this.Frame.Navigate(typeof(InfoForBoardMembers)); } + + private void ApartmentManage(object sender, RoutedEventArgs e) + { + this.Frame.Navigate(typeof(BoardMemberManageApartment)); + } } } diff --git a/ApartmentManager/ApartmentManager/View/DefectsPicturesBoard.xaml b/ApartmentManager/ApartmentManager/View/DefectsPicturesBoard.xaml index 6c038c7..e77d634 100644 --- a/ApartmentManager/ApartmentManager/View/DefectsPicturesBoard.xaml +++ b/ApartmentManager/ApartmentManager/View/DefectsPicturesBoard.xaml @@ -13,17 +13,18 @@ - - - + + + - - - + + + + + + diff --git a/ApartmentManager/ApartmentManager/View/LoginPage.xaml.cs b/ApartmentManager/ApartmentManager/View/LoginPage.xaml.cs index 6f3a86b..4bb12ec 100644 --- a/ApartmentManager/ApartmentManager/View/LoginPage.xaml.cs +++ b/ApartmentManager/ApartmentManager/View/LoginPage.xaml.cs @@ -50,7 +50,7 @@ namespace ApartmentManager.View { // When the navigation stack isn't restored, navigate to the first page // suppressing the initial entrance animation. - appShell.AppFrame.Navigate(typeof(ApartmentPage)); + appShell.AppFrame.Navigate(typeof(BoardMembersPage)); } // Ensure the current window is active diff --git a/ApartmentManager/ApartmentManager/ViewModel/ApartmentsViewModel.cs b/ApartmentManager/ApartmentManager/ViewModel/ApartmentsViewModel.cs index 088023c..e00ef07 100644 --- a/ApartmentManager/ApartmentManager/ViewModel/ApartmentsViewModel.cs +++ b/ApartmentManager/ApartmentManager/ViewModel/ApartmentsViewModel.cs @@ -5,7 +5,9 @@ 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; namespace ApartmentManager.ViewModel @@ -21,6 +23,12 @@ namespace ApartmentManager.ViewModel public static int ApartmentsNumber { get; set; } public Handler.BoardApartmentsHandler BoardApartmentsHandler { get; set; } + public ICommand CreateApartmentCommand { get; set; } + public ICommand DeleteApartmentCommand { get; set; } + public ICommand UpdateApartmentCommand { get; set; } + + public ICommand DeleteDefectCommand { get; set; } + public ApartmentsViewModel() { NewUser = new User(); @@ -30,6 +38,8 @@ namespace ApartmentManager.ViewModel BoardApartmentsHandler = new Handler.BoardApartmentsHandler(this); ApartmentsCatalogSingleton = ApartmentsCatalogSingleton.Instance; ApartmentsNumber = ApartmentsCatalogSingleton.User[0].ApartmentNr; + CreateApartmentCommand = new RelayCommand(BoardApartmentsHandler.CreateApartment); + } public User NewUser diff --git a/ApartmentManager/HousingWebApi/HousingWebApi.csproj b/ApartmentManager/HousingWebApi/HousingWebApi.csproj new file mode 100644 index 0000000..f824c8e --- /dev/null +++ b/ApartmentManager/HousingWebApi/HousingWebApi.csproj @@ -0,0 +1,315 @@ + + + + + + + Debug + AnyCPU + + + 2.0 + {D777744A-9676-4193-BD59-6F30C724C87A} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + HousingWebApi + HousingWebApi + v4.5.2 + false + true + + + + + + + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + + + true + pdbonly + true + bin\ + TRACE + prompt + 4 + + + + ..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll + + + ..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll + + + ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll + + + + + + + + + + + + + + + + + + + + True + ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll + + + ..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll + + + + + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll + + + + + True + ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll + + + ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll + + + ..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll + + + True + ..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll + + + ..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll + + + True + ..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll + + + True + ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll + + + True + ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll + + + True + ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll + + + True + ..\packages\WebGrease.1.5.2\lib\WebGrease.dll + + + True + ..\packages\Antlr.3.4.1.9004\lib\Antlr3.Runtime.dll + + + + + ..\packages\Microsoft.ApplicationInsights.2.2.0\lib\net45\Microsoft.ApplicationInsights.dll + + + ..\packages\Microsoft.ApplicationInsights.Agent.Intercept.2.0.6\lib\net45\Microsoft.AI.Agent.Intercept.dll + + + ..\packages\Microsoft.ApplicationInsights.DependencyCollector.2.2.0\lib\net45\Microsoft.AI.DependencyCollector.dll + + + ..\packages\Microsoft.ApplicationInsights.PerfCounterCollector.2.2.0\lib\net45\Microsoft.AI.PerfCounterCollector.dll + + + ..\packages\Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.2.2.0\lib\net45\Microsoft.AI.ServerTelemetryChannel.dll + + + ..\packages\Microsoft.ApplicationInsights.WindowsServer.2.2.0\lib\net45\Microsoft.AI.WindowsServer.dll + + + ..\packages\Microsoft.ApplicationInsights.Web.2.2.0\lib\net45\Microsoft.AI.Web.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Global.asax + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + + + + + + + + + + Web.config + + + Web.config + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + + + + True + True + 58478 + / + http://localhost:60916/ + False + False + + + False + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + \ No newline at end of file -- cgit v1.2.3