aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulius Klezys <paul4618@edu.easj.dk>2017-05-10 09:22:54 +0200
committerPaulius Klezys <paul4618@edu.easj.dk>2017-05-10 09:22:54 +0200
commit3bb2b6b33225463abaa881c7562cdc0a39c5ce5e (patch)
tree354e6489227670263953e1ba41653ea7ff0d7f02
parent753a8c8685afb04e0289b3b4cfbd628a8cbaa8cb (diff)
parente720bee61ae7a045606ecea09f421dfdf5ef371a (diff)
Merge branch 'master' of https://github.com/marcinzelent/ApartmentAdmin
-rw-r--r--ApartmentAdmin.odtbin25200 -> 0 bytes
-rw-r--r--ApartmentManager/ApartmentManager/AppShell.xaml.cs6
-rw-r--r--ApartmentManager/ApartmentManager/Handler/LoginHandler.cs9
-rw-r--r--ApartmentManager/ApartmentManager/Singletons/UserSingleton.cs4
-rw-r--r--ApartmentManager/ApartmentManager/ViewModel/LoginViewModel.cs2
-rw-r--r--Diagrams/Add-remove-edit apartment SSD.vsdxbin0 -> 46730 bytes
-rw-r--r--Diagrams/Add-remove-edit resident SSD.vsdxbin0 -> 46594 bytes
-rw-r--r--Diagrams/Add-remove-edit user SSD.vsdxbin0 -> 46514 bytes
-rw-r--r--Diagrams/Domain Model.vsdxbin0 -> 38859 bytes
-rw-r--r--Diagrams/Use Case Diagram.vsdxbin0 -> 26390 bytes
-rw-r--r--Report.odtbin0 -> 27672 bytes
-rw-r--r--Test queries/deleteapartmentanduser.sql2
-rw-r--r--Test queries/insertapartmentanduser.sql2
-rw-r--r--Test queries/selectapartmentanduser.sql1
-rw-r--r--Test queries/updateapartmentanduser.sql2
-rw-r--r--Use cases.odtbin0 -> 6884 bytes
16 files changed, 15 insertions, 13 deletions
diff --git a/ApartmentAdmin.odt b/ApartmentAdmin.odt
deleted file mode 100644
index 470dcd5..0000000
--- a/ApartmentAdmin.odt
+++ /dev/null
Binary files differ
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
new file mode 100644
index 0000000..dc9670c
--- /dev/null
+++ b/Diagrams/Add-remove-edit apartment SSD.vsdx
Binary files differ
diff --git a/Diagrams/Add-remove-edit resident SSD.vsdx b/Diagrams/Add-remove-edit resident SSD.vsdx
new file mode 100644
index 0000000..d412812
--- /dev/null
+++ b/Diagrams/Add-remove-edit resident SSD.vsdx
Binary files differ
diff --git a/Diagrams/Add-remove-edit user SSD.vsdx b/Diagrams/Add-remove-edit user SSD.vsdx
new file mode 100644
index 0000000..3d9ed00
--- /dev/null
+++ b/Diagrams/Add-remove-edit user SSD.vsdx
Binary files differ
diff --git a/Diagrams/Domain Model.vsdx b/Diagrams/Domain Model.vsdx
new file mode 100644
index 0000000..e34c569
--- /dev/null
+++ b/Diagrams/Domain Model.vsdx
Binary files differ
diff --git a/Diagrams/Use Case Diagram.vsdx b/Diagrams/Use Case Diagram.vsdx
new file mode 100644
index 0000000..4eea820
--- /dev/null
+++ b/Diagrams/Use Case Diagram.vsdx
Binary files differ
diff --git a/Report.odt b/Report.odt
new file mode 100644
index 0000000..eb289fb
--- /dev/null
+++ b/Report.odt
Binary files differ
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
new file mode 100644
index 0000000..5085eae
--- /dev/null
+++ b/Use cases.odt
Binary files differ