Ejemplo n.º 1
0
        public ActionResult SaveData(BOMComponentChangeViewModel bomcomponents)
        {
            if (bomcomponents.updated != null)
            {
                foreach (var updated in bomcomponents.updated)
                {
                    _bOMComponentService.Update(updated);
                }
            }
            if (bomcomponents.deleted != null)
            {
                foreach (var deleted in bomcomponents.deleted)
                {
                    _bOMComponentService.Delete(deleted);
                }
            }
            if (bomcomponents.inserted != null)
            {
                foreach (var inserted in bomcomponents.inserted)
                {
                    _bOMComponentService.Insert(inserted);
                }
            }
            _unitOfWork.SaveChanges();

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