Exemplo n.º 1
0
        public ActionResult Save(string itemID, string like, string comment, int cacheDuration)
        {
            try
            {
                var item = new as_opinion
                {
                    id       = 0,
                    itemID   = RDL.Convert.StrToNullableInt32(itemID),
                    like     = System.Convert.ToBoolean(like),
                    comment  = comment,
                    created  = DateTime.Now,
                    username = RDL.User.UserName,
                    type     = "customer"
                };

                _mng.SaveOpinion(item, cacheDuration);

                return(Json(new { result = true }));
            }
            catch (Exception ex)
            {
                Debug.LogError(ex);
                return(Json(new { result = false }));
            }
        }
Exemplo n.º 2
0
 public void DeleteOpinion(as_opinion item)
 {
     try
     {
         RDL.CacheManager.PurgeCacheItems("as_opinion_" + item.id);
         db.DeleteOpinion(item.id);
     }
     catch (Exception ex)
     {
         RDL.Debug.LogError(ex);
     }
 }
Exemplo n.º 3
0
 public int SaveOpinion(as_opinion item, int cacheDuration = 0)
 {
     try
     {
         db.SaveOpinion(item);
         if (cacheDuration > 0)
         {
             CacheManager.CacheData(GetCacheKey(item.itemID ?? 0), item.itemID ?? 0, cacheDuration);
         }
     }
     catch (Exception ex)
     {
         Debug.LogError(ex);
     }
     return(item.id);
 }
Exemplo n.º 4
0
 private string GetCacheKey(as_opinion item)
 {
     return(GetCacheKey(item.itemID ?? 0));
 }