diff options
-rw-r--r-- | ApartmentAdmin.odt | bin | 25200 -> 0 bytes | |||
-rw-r--r-- | ApartmentManager/ApartmentManager/AppShell.xaml.cs | 6 | ||||
-rw-r--r-- | ApartmentManager/ApartmentManager/Handler/LoginHandler.cs | 9 | ||||
-rw-r--r-- | ApartmentManager/ApartmentManager/Singletons/UserSingleton.cs | 4 | ||||
-rw-r--r-- | ApartmentManager/ApartmentManager/ViewModel/LoginViewModel.cs | 2 | ||||
-rw-r--r-- | Diagrams/Add-remove-edit apartment SSD.vsdx | bin | 0 -> 46730 bytes | |||
-rw-r--r-- | Diagrams/Add-remove-edit resident SSD.vsdx | bin | 0 -> 46594 bytes | |||
-rw-r--r-- | Diagrams/Add-remove-edit user SSD.vsdx | bin | 0 -> 46514 bytes | |||
-rw-r--r-- | Diagrams/Domain Model.vsdx | bin | 0 -> 38859 bytes | |||
-rw-r--r-- | Diagrams/Use Case Diagram.vsdx | bin | 0 -> 26390 bytes | |||
-rw-r--r-- | Report.odt | bin | 0 -> 27672 bytes | |||
-rw-r--r-- | Test queries/deleteapartmentanduser.sql | 2 | ||||
-rw-r--r-- | Test queries/insertapartmentanduser.sql | 2 | ||||
-rw-r--r-- | Test queries/selectapartmentanduser.sql | 1 | ||||
-rw-r--r-- | Test queries/updateapartmentanduser.sql | 2 | ||||
-rw-r--r-- | Use cases.odt | bin | 0 -> 6884 bytes |
16 files changed, 15 insertions, 13 deletions
diff --git a/ApartmentAdmin.odt b/ApartmentAdmin.odt Binary files differdeleted file mode 100644 index 470dcd5..0000000 --- a/ApartmentAdmin.odt +++ /dev/null diff --git a/ApartmentManager/ApartmentManager/AppShell.xaml.cs b/ApartmentManager/ApartmentManager/AppShell.xaml.cs index 9d4abe5..121989c 100644 --- a/ApartmentManager/ApartmentManager/AppShell.xaml.cs +++ b/ApartmentManager/ApartmentManager/AppShell.xaml.cs @@ -102,14 +102,14 @@ namespace ApartmentManager { InitializeComponent(); - if (UserSingleton.CurrentUser.Type == "B") navMenuItems = boardMemberMenuItems; + if (UserSingleton.Instance.CurrentUser.Type == "B") navMenuItems = boardMemberMenuItems; else navMenuItems = normalUserMenuItems; List<NavMenuItem> topNavMenuItems = navMenuItems.GetRange(0, navMenuItems.Count); - // List<NavMenuItem> bottomNavMenuItems = navMenuItems.GetRange(3, 2); + //List<NavMenuItem> bottomNavMenuItems = navMenuItems.GetRange(3, 2); NavMenuList.ItemsSource = topNavMenuItems; - // NavMenuList2.ItemsSource = bottomNavMenuItems; + //NavMenuList2.ItemsSource = bottomNavMenuItems; } public Frame AppFrame { get { return Frame; } } diff --git a/ApartmentManager/ApartmentManager/Handler/LoginHandler.cs b/ApartmentManager/ApartmentManager/Handler/LoginHandler.cs index a91fc2b..4cf5fed 100644 --- a/ApartmentManager/ApartmentManager/Handler/LoginHandler.cs +++ b/ApartmentManager/ApartmentManager/Handler/LoginHandler.cs @@ -2,10 +2,6 @@ using ApartmentManager.Persistency; using Newtonsoft.Json; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace ApartmentManager.Handler { @@ -13,14 +9,13 @@ namespace ApartmentManager.Handler { public static void LogIn(string username, string password) { - string serializedUser = ApiClient.GetData($"api/Users/by-username/{username}"); if (serializedUser != null) { User user = JsonConvert.DeserializeObject<User>(serializedUser); if (user.Password == password) { - UserSingleton.CurrentUser = user; + UserSingleton.Instance.CurrentUser = user; } else throw new Exception("Wrong password!"); } @@ -30,7 +25,7 @@ namespace ApartmentManager.Handler public static void LogOut() { - UserSingleton.CurrentUser = null; + UserSingleton.Instance.CurrentUser = null; } } } diff --git a/ApartmentManager/ApartmentManager/Singletons/UserSingleton.cs b/ApartmentManager/ApartmentManager/Singletons/UserSingleton.cs index aa09cf2..e5ca71e 100644 --- a/ApartmentManager/ApartmentManager/Singletons/UserSingleton.cs +++ b/ApartmentManager/ApartmentManager/Singletons/UserSingleton.cs @@ -6,10 +6,10 @@ using System.Threading.Tasks; namespace ApartmentManager.Model { - class UserSingleton + public class UserSingleton { private static UserSingleton instance; - public static User CurrentUser; + public User CurrentUser { get; set; } private UserSingleton() { } diff --git a/ApartmentManager/ApartmentManager/ViewModel/LoginViewModel.cs b/ApartmentManager/ApartmentManager/ViewModel/LoginViewModel.cs index 0290053..cb8dfbb 100644 --- a/ApartmentManager/ApartmentManager/ViewModel/LoginViewModel.cs +++ b/ApartmentManager/ApartmentManager/ViewModel/LoginViewModel.cs @@ -69,7 +69,7 @@ namespace ApartmentManager.ViewModel { // When the navigation stack isn't restored, navigate to the first page // suppressing the initial entrance animation. - if (UserSingleton.CurrentUser.Type == "B") appShell.AppFrame.Navigate(typeof(BoardMembersPage)); + if (UserSingleton.Instance.CurrentUser.Type == "B") appShell.AppFrame.Navigate(typeof(BoardMembersPage)); else appShell.AppFrame.Navigate(typeof(ApartmentPage)); } diff --git a/Diagrams/Add-remove-edit apartment SSD.vsdx b/Diagrams/Add-remove-edit apartment SSD.vsdx Binary files differnew file mode 100644 index 0000000..dc9670c --- /dev/null +++ b/Diagrams/Add-remove-edit apartment SSD.vsdx diff --git a/Diagrams/Add-remove-edit resident SSD.vsdx b/Diagrams/Add-remove-edit resident SSD.vsdx Binary files differnew file mode 100644 index 0000000..d412812 --- /dev/null +++ b/Diagrams/Add-remove-edit resident SSD.vsdx diff --git a/Diagrams/Add-remove-edit user SSD.vsdx b/Diagrams/Add-remove-edit user SSD.vsdx Binary files differnew file mode 100644 index 0000000..3d9ed00 --- /dev/null +++ b/Diagrams/Add-remove-edit user SSD.vsdx diff --git a/Diagrams/Domain Model.vsdx b/Diagrams/Domain Model.vsdx Binary files differnew file mode 100644 index 0000000..e34c569 --- /dev/null +++ b/Diagrams/Domain Model.vsdx diff --git a/Diagrams/Use Case Diagram.vsdx b/Diagrams/Use Case Diagram.vsdx Binary files differnew file mode 100644 index 0000000..4eea820 --- /dev/null +++ b/Diagrams/Use Case Diagram.vsdx diff --git a/Report.odt b/Report.odt Binary files differnew file mode 100644 index 0000000..eb289fb --- /dev/null +++ b/Report.odt diff --git a/Test queries/deleteapartmentanduser.sql b/Test queries/deleteapartmentanduser.sql new file mode 100644 index 0000000..754b098 --- /dev/null +++ b/Test queries/deleteapartmentanduser.sql @@ -0,0 +1,2 @@ +DELETE FROM Users WHERE ApartmentNr=3; +DELETE FROM Apartments WHERE ApartmentNumber=3;
\ No newline at end of file diff --git a/Test queries/insertapartmentanduser.sql b/Test queries/insertapartmentanduser.sql new file mode 100644 index 0000000..af06738 --- /dev/null +++ b/Test queries/insertapartmentanduser.sql @@ -0,0 +1,2 @@ +INSERT INTO Apartments VALUES(3,30,2,'200Dkk',1,'Adres') +INSERT INTO Users(ApartmentNr,Username,Password,Type,FirstName,LastName,BirthDate,Phone,Email) VALUES(3,'nuser','pass','N','Jan','Kowalski','01/01/1970','34567890','jan@onet.pl')
\ No newline at end of file diff --git a/Test queries/selectapartmentanduser.sql b/Test queries/selectapartmentanduser.sql new file mode 100644 index 0000000..a3f7ffd --- /dev/null +++ b/Test queries/selectapartmentanduser.sql @@ -0,0 +1 @@ +SELECT * FROM Apartments LEFT JOIN Users ON Apartments.ApartmentNumber=Users.ApartmentNr WHERE Users.LastName='Kowalski'
\ No newline at end of file diff --git a/Test queries/updateapartmentanduser.sql b/Test queries/updateapartmentanduser.sql new file mode 100644 index 0000000..3ab4192 --- /dev/null +++ b/Test queries/updateapartmentanduser.sql @@ -0,0 +1,2 @@ +UPDATE Apartments SET MonthlyCharge='5000' WHERE Size=30 +UPDATE Users SET LastName='Nowak' WHERE ApartmentNr=3;
\ No newline at end of file diff --git a/Use cases.odt b/Use cases.odt Binary files differnew file mode 100644 index 0000000..5085eae --- /dev/null +++ b/Use cases.odt |