public Resp_Binary Del(Base_Del_Request request) { var entity = _sysModuleRepository.GetById(request.Id); if (entity.IsNull()) { return new Resp_Binary { message = "菜单不存在" } } ; var sub_entities = entity.SubSysModules; if (sub_entities.Count() > 0) { return new Resp_Binary { message = "删除失败,有下属关联,请先删除关联下属" } } ; _sysModuleRepository.Delete(entity); if (_sysModuleRepository.UnitOfWork.Commite() > 0) { return(Resp_Binary.Del_Sucess); } return(Resp_Binary.Del_Failed); }
public Resp_Binary Del(Base_Del_Request request) { if (request.Ids.IsNotNull() && request.Ids.Count > 0) { if (request.Ids.Contains(1)) { return new Resp_Binary { message = "系统角色不允许删除" } } ; _sysRoleRepository.Delete(request.Ids); if (_sysRoleRepository.UnitOfWork.Commite() > 0) { return(Resp_Binary.Del_Sucess); } } else { return(new Resp_Binary { message = "请选择要操作的记录" }); } return(Resp_Binary.Del_Failed); }
public Resp_Binary Del_Btn(Base_Del_Request request) { if (request.Id < 1 && _sysModuleOperateRepository.GetById(request.Id).IsNull()) { return new Resp_Binary { message = "请选择操作记录" } } ; _sysModuleOperateRepository.DeleteById(request.Id); if (_sysModuleOperateRepository.UnitOfWork.Commite() > 0) { return(Resp_Binary.Del_Sucess); } return(Resp_Binary.Del_Failed); }
public Resp_Binary Del(Base_Del_Request request) { if (request.Ids.IsNotNull() && request.Ids.Count() > 0) { if (request.Ids.Contains(1)) //系统自生成的管理员 { return(new Resp_Binary { message = "系统管理员不能被删除" }); } _sysUserRepository.Delete(request.Ids); if (_sysUserRepository.UnitOfWork.Commite() > 0) { return(Resp_Binary.Del_Sucess); } } return(Resp_Binary.Del_Failed); }