|
@@ -104,11 +104,11 @@ namespace comal.timesheets
|
|
|
#endregion
|
|
|
|
|
|
#region Buttons / Taps
|
|
|
- private void NotificationListView_Tapped(object sender, EventArgs e)
|
|
|
+ private async void NotificationListView_Tapped(object sender, EventArgs e)
|
|
|
{
|
|
|
NotificationShell shell = notificationListView.SelectedItem as NotificationShell;
|
|
|
string extra = CreateOption(shell);
|
|
|
- string chosenOption = ChooseOption(extra, shell).Result;
|
|
|
+ string chosenOption = await DisplayActionSheet(shell.Description, "Cancel", null, "View / Reply Message", "Dismiss Message", extra);
|
|
|
ProcessOption(chosenOption, shell);
|
|
|
}
|
|
|
|
|
@@ -124,20 +124,29 @@ namespace comal.timesheets
|
|
|
case "Dismiss Message":
|
|
|
DismissNotification(shell);
|
|
|
break;
|
|
|
- case "View Task":
|
|
|
+ case VIEWTASK:
|
|
|
ViewTask(shell);
|
|
|
break;
|
|
|
- case "View Leave":
|
|
|
+ case VIEWLEAVE:
|
|
|
OpenLeaveList();
|
|
|
break;
|
|
|
- case "View Request Form":
|
|
|
+ case VIEWLEAVEFORM:
|
|
|
ViewRequestForm(shell);
|
|
|
break;
|
|
|
+ case VIEWDELIVERY:
|
|
|
+ ViewDelivery(shell);
|
|
|
+ break;
|
|
|
default:
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void ViewDelivery(NotificationShell shell)
|
|
|
+ {
|
|
|
+ DeliveryDetails page = new DeliveryDetails(shell.EntityID);
|
|
|
+ Navigation.PushAsync(page);
|
|
|
+ }
|
|
|
+
|
|
|
private void ViewRequestForm(NotificationShell shell)
|
|
|
{
|
|
|
DigitalFormHostModel<LeaveRequest, LeaveRequestLink, LeaveRequestForm> model = new DigitalFormHostModel<LeaveRequest, LeaveRequestLink, LeaveRequestForm>();
|
|
@@ -168,25 +177,26 @@ namespace comal.timesheets
|
|
|
Navigation.PushAsync(leaveRequestList);
|
|
|
}
|
|
|
|
|
|
+ const string VIEWTASK = "View Task";
|
|
|
+ const string VIEWLEAVE = "View Leave";
|
|
|
+ const string VIEWLEAVEFORM = "View Leave Request Form";
|
|
|
+ const string VIEWDELIVERY = "View Delivery";
|
|
|
+
|
|
|
private string CreateOption(NotificationShell shell)
|
|
|
{
|
|
|
- if (!string.IsNullOrWhiteSpace(shell.EntityType))
|
|
|
+ if (string.IsNullOrWhiteSpace(shell.EntityType))
|
|
|
return "";
|
|
|
if (shell.EntityType == "Comal.Classes.Kanban")
|
|
|
- return "View Task";
|
|
|
+ return VIEWTASK;
|
|
|
if (shell.EntityType == "Comal.Classes.LeaveRequest")
|
|
|
- return "View Leave";
|
|
|
+ return VIEWLEAVE;
|
|
|
if (shell.EntityType == "Comal.Classes.LeaveRequestLink")
|
|
|
- return "View Request Form";
|
|
|
+ return VIEWLEAVEFORM;
|
|
|
+ if (shell.EntityType == "Comal.Classes.Delivery")
|
|
|
+ return VIEWDELIVERY;
|
|
|
else
|
|
|
return "";
|
|
|
}
|
|
|
-
|
|
|
- private async Task<string> ChooseOption(string extra, NotificationShell shell)
|
|
|
- {
|
|
|
- string chosenOption = await DisplayActionSheet(shell.Description, "Cancel", null, "View / Reply Message", "Dismiss Message", extra);
|
|
|
- return chosenOption;
|
|
|
- }
|
|
|
protected override void OnDisappearing()
|
|
|
{
|
|
|
NotificationsClosed?.Invoke(notificationShells.Count());
|