示例#1
0
        public ActionResult SaveData(SKUChangeViewModel skus)
        {
            if (skus.updated != null)
            {
                foreach (var updated in skus.updated)
                {
                    _sKUService.Update(updated);
                }
            }
            if (skus.deleted != null)
            {
                foreach (var deleted in skus.deleted)
                {
                    _sKUService.Delete(deleted);
                }
            }
            if (skus.inserted != null)
            {
                foreach (var inserted in skus.inserted)
                {
                    _sKUService.Insert(inserted);
                }
            }
            _unitOfWork.SaveChanges();

            return(Json(new { Success = true }, JsonRequestBehavior.AllowGet));
        }