diff --git a/Borepin/Borepin/Page/UserPage.xaml b/Borepin/Borepin/Page/UserPage.xaml
index 9c6bd6c..ea4c8b6 100644
--- a/Borepin/Borepin/Page/UserPage.xaml
+++ b/Borepin/Borepin/Page/UserPage.xaml
@@ -42,7 +42,7 @@
-
+
diff --git a/Borepin/Borepin/PageModel/CreateCardPageModel.cs b/Borepin/Borepin/PageModel/CreateCardPageModel.cs
index 1dbfe5b..7cbefca 100644
--- a/Borepin/Borepin/PageModel/CreateCardPageModel.cs
+++ b/Borepin/Borepin/PageModel/CreateCardPageModel.cs
@@ -238,6 +238,17 @@ namespace Borepin.PageModel
{
IsBusy = true;
+ if(ReaderID == null)
+ {
+ Device.BeginInvokeOnMainThread(async () =>
+ {
+ await _PageDialogService.DisplayAlertAsync("NFC Error", "No Card Reader selected", Resources.Text.TextResource.OK).ConfigureAwait(false);
+
+ IsBusy = false;
+ });
+ return;
+ }
+
try
{
_CardConfig.PICCKey = _CardConfig.ConvertFromString(PICCKey);
diff --git a/Borepin/Borepin/PageModel/UserPageModel.cs b/Borepin/Borepin/PageModel/UserPageModel.cs
index e2fc337..d87831c 100644
--- a/Borepin/Borepin/PageModel/UserPageModel.cs
+++ b/Borepin/Borepin/PageModel/UserPageModel.cs
@@ -97,9 +97,11 @@ namespace Borepin.PageModel
CanAdmin = !((UserSystem.ManageInterface_Proxy)_API.Session.UserSystem.Manage).IsNull;
CanManage = !((User.ManageInterface_Proxy)_User.Manage).IsNull;
- // TODO CanCreateCard = !((User.CardDESFireInterface_Proxy)_User.CardDESFireEV2).IsNull;
- CanCreateCard = true;
- HasCardBinded = false;
+ CanCreateCard = !((User.CardDESFireInterface_Proxy)_User.CardDESFireEV2).IsNull;
+ if(CanCreateCard)
+ {
+ HasCardBinded = (await _User.CardDESFireEV2.GetTokenList().ConfigureAwait(false)).Count > 0;
+ }
}
#endregion
@@ -241,9 +243,23 @@ namespace Borepin.PageModel
set => SetProperty(ref _UnbindCardCommand, value);
}
- public void UnbindCardCommandExecute()
+ public async void UnbindCardCommandExecute()
{
IsBusy = true;
+ IReadOnlyList> list = await _User.CardDESFireEV2.GetTokenList().ConfigureAwait(false);
+
+ if(list.Count > 0)
+ {
+ await _User.CardDESFireEV2.Unbind(list[0]).ConfigureAwait(false);
+ try
+ {
+ await LoadAPIData().ConfigureAwait(false);
+ }
+ catch
+ {
+ // TODO
+ }
+ }
IsBusy = false;
}
diff --git a/external/NFC b/external/NFC
index e79b6aa..a6479be 160000
--- a/external/NFC
+++ b/external/NFC
@@ -1 +1 @@
-Subproject commit e79b6aace26c8b362a5f450345a67ba700f06805
+Subproject commit a6479be14e86add7a84b3a1a502608a665ec51f0