public IActionResult Delete(DeleteAttributeViewModel vm) { if (vm.smartControll && vm.decisionControll) { return(RedirectToAction("Index", "Attribute")); } else { return(RedirectToAction("Index", "Attribute")); } }
public IActionResult Delete(DeleteAttributeViewModel vm) { var attributeToDelete = _unityOfWork.Attribute.GetAttributeForDelete(vm.ID); if (vm.smartControll && vm.decisionControll) { _unityOfWork.Attribute.Delete(attributeToDelete); _unityOfWork.Save(); return(RedirectToAction("Index", "Attribute")); } else { return(RedirectToAction("Index", "Attribute")); } }
public IActionResult Delete(long id) { var attributeToDelete = _unityOfWork.Attribute.GetAttributeForDelete(id); var deleteAttributes = new DeleteAttributeViewModel() { ID = id, Name = attributeToDelete.Name, }; foreach (var type in attributeToDelete.TypeAttributes) { deleteAttributes.containingTypes.Add(_unityOfWork.Type.GetById(type.DeviceTypeID).Name); } return(View(deleteAttributes)); }