public IHttpActionResult ClickLikes() { try { int UID = int.Parse(requestHelper.GetRequsetForm("UID", "")); int PhotoCollectionID = int.Parse(requestHelper.GetRequsetForm("PhotoCollectionID", "")); WebApi_BLL.T_Photo_Likes tpl_bll = new WebApi_BLL.T_Photo_Likes(); if (tpl_bll.Exists(UID, PhotoCollectionID)) { tpl_bll.Delete(UID, PhotoCollectionID); return(Ok(ReturnJsonResult.GetJsonResult(1, "OK", "-1"))); } else { WebApi_Model.T_Photo_Likes model = new WebApi_Model.T_Photo_Likes(); model.UID = UID; model.PhotoCollectionID = PhotoCollectionID; tpl_bll.Add(model); return(Ok(ReturnJsonResult.GetJsonResult(1, "OK", "+1"))); } } catch (Exception ex) { return(Ok(ReturnJsonResult.GetJsonResult(1, "Error", ex.Message))); } }
public IHttpActionResult CheckStatus(int UID, int PhotoCollectionID) { WebApi_BLL.T_Photo_Likes tpl_bll = new WebApi_BLL.T_Photo_Likes(); WebApi_BLL.T_Photo_Store tps_bll = new WebApi_BLL.T_Photo_Store(); WebApi_BLL.T_Photo_Pay tpp_bll = new WebApi_BLL.T_Photo_Pay(); bool IsLike = tpl_bll.Exists(UID, PhotoCollectionID); bool IsStore = tps_bll.Exists(UID, PhotoCollectionID); bool IsBuy = tpp_bll.Exists(UID, PhotoCollectionID); ArrayList list = new ArrayList(); Hashtable ht = new Hashtable(); ht.Add("IsLike", IsLike); ht.Add("IsStore", IsStore); ht.Add("IsBuy", IsBuy); list.Add(ht); return(Ok(ReturnJsonResult.GetJsonResult(1, "OK", JsonConvert.SerializeObject(list)))); }