public ActionResult UpdateRequest(int requestId, int prioryty, int status, string description) { try { var result = _requestDomain.UpdateRequest(requestId, prioryty, status, description); return(Json(new { result }, JsonRequestBehavior.AllowGet)); } finally { if (status == (int)RequestStatusEnum.Pending) { var result = _agencyDomain.FindITSupporterByRequestId(requestId); if (!result.IsError && result.ObjReturn > 0) { FirebaseService firebaseService = new FirebaseService(); firebaseService.SendNotificationFromFirebaseCloudForITSupporterReceive(result.ObjReturn, requestId); } } } }
public HttpResponseMessage FindITSupporterByRequestId(int requestId) { var result = _agencyDomain.FindITSupporterByRequestId(requestId); try { return(Request.CreateResponse(HttpStatusCode.OK, result.WarningMessage)); } finally { if (!result.IsError && result.ObjReturn > 0) { _requestDomain.AcceptRequestFromITSupporter(result.ObjReturn, requestId, true, "check"); } } }