Exemplo n.º 1
0
 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)));
     }
 }
Exemplo n.º 2
0
        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))));
        }
Exemplo n.º 3
0
 public IHttpActionResult GetUserStoreByUID(int UID)
 {
     WebApi_BLL.T_Photo_Store tps_bll = new WebApi_BLL.T_Photo_Store();
     return(Ok(ReturnJsonResult.GetJsonResult(1, "OK", JsonConvert.SerializeObject(tps_bll.GetModelList("UID=" + UID)))));
 }