Esempio n. 1
0
        public int DeleteBargainProductById(int PKID)
        {
            if (PKID < 1)
            {
                return(0);
            }
            var dat = ShareBargainManager.DeleteBargainProductById(PKID);

            if (dat)
            {
                using (var client = new ShareBargainClient())
                {
                    client.RefreshShareBargainCache();
                }
            }
            return(dat ? 1 : 0);
        }
Esempio n. 2
0
 /// <summary>
 /// 删除砍价商品
 /// </summary>
 /// <param name="PKID"></param>
 /// <returns></returns>
 public ActionResult DeleteBargainProductById(int PKID)
 {
     if (PKID < 1)
     {
         return(Json(new { Status = false, Msg = "删除失败" }));
     }
     try
     {
         var delResult = ShareBargainManager.DeleteBargainProductById(PKID);
         if (delResult)
         {
             DeleteLog(PKID);
             using (var client = new ShareBargainClient())
             {
                 var refreshResult = client.RefreshShareBargainCache();
                 if (!refreshResult.Success)
                 {
                     //缓存刷新失败补偿一次
                     var repeatRefreshResult = client.RefreshShareBargainCache();
                     if (!repeatRefreshResult.Success)
                     {
                         Logger.Log(Level.Warning, $"DeleteBargainProductById,刷新缓存失败,ErrorMessage:{repeatRefreshResult.ErrorMessage}");
                         return(Json(new { Status = false, Msg = "数据保存成功,但刷新缓存失败,请手动刷新缓存" }));
                     }
                 }
             }
         }
         else
         {
             return(Json(new { Status = false, Msg = "删除失败" }));
         }
     }
     catch (Exception ex)
     {
         Logger.Log(Level.Error, $"DeleteBargainProductById异常,ex{ex}");
     }
     return(Json(new { Status = true, Msg = "删除成功" }));
 }