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

            return(Json(new { Success = true }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public ActionResult DeleteConfirmed(int id)
        {
            ProjectType projectType = _projectTypeService.GetById((int)id);

            _projectTypeService.Delete(id);
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 3
0
        public IActionResult Delete(int id)
        {
            var projectTypesFromRepo = _services.GetByID(id);

            if (projectTypesFromRepo == null)
            {
                return(BadRequest("Not a value projectType id"));
            }
            _services.Delete(projectTypesFromRepo);
            _services.SaveChange();

            return(Ok());
        }