예제 #1
0
 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)));
     }
 }
예제 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(WebApi_Model.T_Photo_Likes model)
 {
     return(dal.Update(model));
 }
예제 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(WebApi_Model.T_Photo_Likes model)
 {
     return(dal.Add(model));
 }