public static NotificationSystem.Notice Notification(NotificationSystem.Notice notice) { try { var db = AssetController.GetSetting(notice.Guid); var n = new NotificationSystem.Notice().DeserializeFromXmlString <NotificationSystem.Notice>(db.XmlData); return(n); } catch { return(null); } }
public static bool Notification(NotificationSystem.Notice notice) { try { SettingsDBData db = new SettingsDBData(); db.Appname = notice.Guid; db.XmlData = notice.SerializeToXmlString(notice); return(AssetController.PushSetting(db)); } catch { return(false); } }
public static Task <bool> NotificationAsync(NotificationSystem.Notice notice) { return(Task.Run(() => { try { SettingsDBData db = new SettingsDBData(); db.Appname = notice.Guid; db.XmlData = notice.SerializeToXmlString(notice); return AssetController.PushSetting(db); } catch { return false; } })); }