Added new notification nuget. Added auto regenerate JWT token on error.

This commit is contained in:
Patrick Fic
2020-07-24 11:14:51 -07:00
parent e8c58dab2f
commit 32ec745c77
8 changed files with 123 additions and 48 deletions

View File

@@ -10,6 +10,7 @@ using BodyshopPartner.Models;
using BodyshopPartner.Utils.Growls;
using GraphQL.Common.Request;
using Newtonsoft.Json.Linq;
using ToastNotifications.Messages;
namespace BodyshopPartner.Utils
{
@@ -159,12 +160,14 @@ namespace BodyshopPartner.Utils
logger.Trace("Job insert succesful. Show notification");
App.Current.Dispatcher.Invoke(() =>
{
Growler.AddNotification(new Notification()
{
Title = Properties.Resources.Msg_NewJobUploaded,
Subtitle = item.Job?.ownr_fn?.Value + " " + item.Job?.ownr_ln?.Value + " | " + item.Job?.clm_no?.Value,
//Message = item.Job?.vehicle?.data?.v_model_yr?.Value + " " + item.Job?.vehicle?.data?.v_make_desc?.Value + " " + item.Job?.vehicle?.data?.v_model_desc?.Value
});
string msg = Properties.Resources.Msg_NewJobUploaded + " " + item.Job?.ownr_fn?.Value + " " + item.Job?.ownr_ln?.Value + " | " + item.Job?.clm_no?.Value;
Utils.Notifications.notifier.ShowSuccess(msg);
//Growler.AddNotification(new Notification()
//{
// Title = Properties.Resources.Msg_NewJobUploaded,
// Subtitle = item.Job?.ownr_fn?.Value + " " + item.Job?.ownr_ln?.Value + " | " + item.Job?.clm_no?.Value,
// //Message = item.Job?.vehicle?.data?.v_model_yr?.Value + " " + item.Job?.vehicle?.data?.v_make_desc?.Value + " " + item.Job?.vehicle?.data?.v_model_desc?.Value
//});
});
}
@@ -174,12 +177,14 @@ namespace BodyshopPartner.Utils
//Succesful upsert
App.Current.Dispatcher.Invoke(() =>
{
Growler.AddNotification(new Notification()
{
Title = Properties.Resources.Msg_NewJobUploadError,
Subtitle = item.Job?.ownr_fn?.Value + " " + item.Job?.ownr_ln?.Value,
Message = Ex.Message
}); ;
string msg = Properties.Resources.Msg_NewJobUploadError + " " + item.Job?.ownr_fn?.Value + " " + item.Job?.ownr_ln?.Value + Ex.Message;
Notifications.notifier.ShowError(msg);
//Growler.AddNotification(new Notification()
//{
// Title = Properties.Resources.Msg_NewJobUploadError,
// Subtitle = item.Job?.ownr_fn?.Value + " " + item.Job?.ownr_ln?.Value,
// Message = Ex.Message
//}); ;
});
}
_jobs.Dequeue();