/// <summary> /// Generates the final Toast options /// </summary> /// <returns>Notification options that are used to load the toast notifications</returns> public NotificationOption GenerateToastOption() { var notificationOption = new NotificationOption(); if (Status == NotificationStatus.Success) { notificationOption.ToastTitle = "Success!"; if (NotificationItem.GetType() == typeof(Product)) { notificationOption.ToastContent = $"Successfully added {(NotificationItem as Product).Title} to the Database"; } if (NotificationItem.GetType() == typeof(Customer)) { notificationOption.ToastContent = $"Successfully added {(NotificationItem as Customer).FirstName} to the Database"; } notificationOption.ToastCSS = "e-toast-success"; return(notificationOption); } if (Status == NotificationStatus.Failed) { notificationOption.ToastTitle = "Error!"; if (NotificationItem.GetType() == typeof(Product)) { notificationOption.ToastContent = $"There was an error adding {(NotificationItem as Product).Title} to the Database"; } if (NotificationItem.GetType() == typeof(Customer)) { notificationOption.ToastContent = $"There was an error adding {(NotificationItem as Customer).FirstName} to the Database"; } notificationOption.ToastCSS = "e-toast-error"; return(notificationOption); } // TODO :: Write code to inform there was an error with the notification return(notificationOption); }
public object GetNotificationType() { return(NotificationItem.GetType()); }