public HttpResponseMessage AddNotificationToSpesficUser(NotificationForUser userNotification) { int id = NotificationBL.AddNotification(userNotification.message); if (id != -1) { NotificationBL.AddNotificationForUser(userNotification.userId, id); return(Request.CreateResponse(HttpStatusCode.OK, true)); } return(Request.CreateResponse(HttpStatusCode.ExpectationFailed, true)); }
// POST api/<controller> public IHttpActionResult Post([FromBody] Notification n) { try { NotificationBL.AddNotification(n); return(Ok()); } catch { throw; } }
public BaseServiceResult AddNotification(byte[] NotificationContent, byte[] NotificationPreviewContent, IEnumerable <string> oldReceiverIdList) { try { using (var notificationBL = new NotificationBL()) { notificationBL.AddNotification(NotificationContent, NotificationPreviewContent, oldReceiverIdList); return(new BaseServiceResult(ResultStatusCodes.OK, null)); } } catch (Exception ex) { Logger.Error("AddNotification", ex); return(BaseServiceResult.InternalErrorResult); } }
public HttpResponseMessage SendNotificationForUserNotPay(List <NotificationForUser> userNotification) { int id = NotificationBL.AddNotification(userNotification[0].message); if (id != -1) { foreach (var t in userNotification) { NotificationBL.AddNotificationForUser(t.userId, id); } return(Request.CreateResponse(HttpStatusCode.OK, true)); } return(Request.CreateResponse(HttpStatusCode.ExpectationFailed, true)); }
public HttpResponseMessage AddNotificationForAllUsers(NotificationForUser userNotification) { int id = NotificationBL.AddNotification(userNotification.message); if (id != -1) { List <tenant_tbl> tenants = TenantBL.GetAllTenantByBuilding(userNotification.userId); foreach (var t in tenants) { NotificationBL.AddNotificationForUser(t.user_id, id); } return(Request.CreateResponse(HttpStatusCode.OK, true)); } return(Request.CreateResponse(HttpStatusCode.ExpectationFailed, true)); }