public ActionResult AjaxDelete(int id) { var entity = _profileTypeService.GetById(id); if (entity == null) { return(AjaxResult(AjaxProcessResult.NotFound)); } if (entity.SystemType) { return(AjaxResult(AjaxProcessResult.NotValid)); } try { _profileTypeService.Delete(entity); } catch (Exception ex) { _logger.WriteLog("Failed to delete ProfileType.", ex); return(AjaxResult(AjaxProcessResult.Failed)); } return(AjaxResult(AjaxProcessResult.Success)); }
public virtual ActionResult Remove(long profileTypeId) { var profileType = profileTypeService.Find(profileTypeId); if (profileType != null) { profileTypeService.Delete(profileType); } return(RedirectToAction("Show")); }