public JsonResult LikePost(long id) { var result = new JsonResultLikeSub { Success = true }; try { var resDB = BLL.Data.LikePostById(id, _currentUserId); if (resDB != 0) { result.Added = true; } else { result.Added = false; } result.Result = resDB; } catch (Exception ex) { result.Success = false; result.Result = ex.Message; } return(Json(result)); }
public JsonResult AddSubcribtion(long userId, long subTo) { var result = new JsonResultLikeSub { Success = true }; try { var resDB = BLL.Data.CreateUpdateSubscription(userId, subTo); result.Added = resDB; } catch (Exception ex) { result.Success = false; result.Result = ex.Message; } return(Json(result, JsonRequestBehavior.AllowGet)); }