public async Task <JsonResult> GDRemove() { try { var id = Guid.Parse(Request.Form["id"]); var oid = Guid.Parse(Request.Form["oid"]); var aid = Guid.Parse(Request.Form["aid"]); if (GroupingsDataService.Remove(id, oid, aid)) { return(Success(id.ToString())); } return(Failed(MessageUtilityService.FailedRemove(""))); } catch { return(Failed(MessageUtilityService.ServerError())); } }
public async Task <JsonResult> NMCheckUserNotification() { try { var uid = Guid.Parse(Request.Form["id"]); var aid = Guid.Parse(Request.Form["aid"]); var gdCatID = Guid.Parse(Request.Form["gdcid"]); var notificationsReceipent = GroupingsDataService.GetBySIDCIDAID(uid, gdCatID, aid, false); foreach (var notif in notificationsReceipent) { var sid = SignalRDataService.GetByOIDAPI(notif.SourceID, aid); NotificationManagerHub.NewNotification(notif.OwnerID.ToString(), sid.SignalRID.ToString()); //remove the receipent from database after it sents the notification to the receiver GroupingsDataService.Remove(notif.ID, notif.OwnerID, notif.API); } return(Success("")); } catch { return(Failed(MessageUtilityService.ServerError())); } }