public void DeleteForm(string keyValue) { if (service.IQueryable().Count(t => t.F_ParentId.Equals(keyValue)) > 0) { throw new Exception("删除失败!操作的对象包含了下级数据。"); } else { service.Delete(t => t.F_Id == keyValue); } }
public IActionResult Delete(long Id) { BaseResponeModel respone; int result = navigationRepository.Delete(Id); if (result > 0) { respone = new BaseResponeModel().SetStatus(AppGlobal.Success).SetMessage(AppGlobal.EditSuccess); } else { respone = new BaseResponeModel().SetStatus(AppGlobal.Error).SetMessage(AppGlobal.EditError); } return(Json(respone)); }
public ActionResult <CommonResponeModel> Delete(long Id) { int result = navigationRepository.Delete(Id); if (result > 0) { Result = new SuccessResultFactory().Factory(ActionType.Delete); } else { Result = new ErrorResultFactory().Factory(ActionType.Delete); } return(GetCommonRespone()); }
public static void Remove(int Id, INavigationRepository Repository) { Repository.Delete(Id); }