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)); }
public ActionResult DeleteConfirmed(int id) { ProjectType projectType = _projectTypeService.GetById((int)id); _projectTypeService.Delete(id); return(RedirectToAction("Index")); }
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()); }