public IHttpActionResult ClickStore() { try { int UID = int.Parse(requestHelper.GetRequsetForm("UID", "")); int PhotoCollectionID = int.Parse(requestHelper.GetRequsetForm("PhotoCollectionID", "")); WebApi_BLL.T_Photo_Store tps_bll = new WebApi_BLL.T_Photo_Store(); if (tps_bll.Exists(UID, PhotoCollectionID)) { tps_bll.Delete(UID, PhotoCollectionID); return(Ok(ReturnJsonResult.GetJsonResult(1, "OK", "-1"))); } else { WebApi_Model.T_Photo_Store model = new WebApi_Model.T_Photo_Store(); model.UID = UID; model.PhotoCollectionID = PhotoCollectionID; model.CreatDate = DateTime.Now; tps_bll.Add(model); return(Ok(ReturnJsonResult.GetJsonResult(1, "OK", "+1"))); } } catch (Exception ex) { return(Ok(ReturnJsonResult.GetJsonResult(1, "Error", ex.Message))); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(WebApi_Model.T_Photo_Store model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(WebApi_Model.T_Photo_Store model) { return(dal.Add(model)); }