Ejemplo n.º 1
0
        public JObject OfflineGood(OnlineGoodDto dto)
        {
            JObject jo     = new JObject();
            var     length = dto.IdList.Count;

            for (var i = 0; i < length; i++)
            {
                long temp   = dto.IdList[i];
                var  result = WebapiDbContext.Goods.Where(o => o.Id == temp).FirstOrDefault();
                if (result != null && result.Is_deleted == "否" && result.State == "已上架")
                {
                    result.State = "已下架";
                    WebapiDbContext.SaveChanges();
                }
            }
            jo["stateCode"] = 200;
            jo["message"]   = "success!";
            return(jo);
        }
Ejemplo n.º 2
0
 public IActionResult OfflineGood([FromServices] IWebapiService webapiService, [FromBody] OnlineGoodDto dto)
 {
     return(Json(webapiService.OfflineGood(dto)));
 }