/// <summary> /// 删除菜单 /// </summary> /// <param name="requestModel">参数</param> /// <returns></returns> public ApiResultModel <int> Delete(BaseIdModel requestModel) { var result = new ApiResultModel <int>(); if (requestModel.Id.IsNullOrEmpty()) { result.Message = "菜单ID不能为空"; return(result); } var menus = _menuRepository.Find(x => x.id == requestModel.Id || x.parentId == requestModel.Id).ToList(); if (!menus.Any(x => x.id == requestModel.Id)) { result.Message = "菜单不存在"; return(result); } else if (menus.Any(x => x.parentId == requestModel.Id)) { result.Message = "该菜单存在子级,不能删除"; return(result); } var menu = menus.FirstOrDefault(x => x.id == requestModel.Id); //_db.Entry(menu).State = EntityState.Deleted; //_db.SaveChanges(); _menuRepository.Delete(menu); _menuRepository.SaveChanges(); result.Code = ApiResultCode.Success; return(result); }
public void ExcelHumUrgentyNotificationTest() { var model = new BaseIdModel("en", 45820000633, false) { ExportFormat = ReportExportType.Xlsx.ToString() }; byte[] bytes = m_Facade.ExportHumUrgentyNotification(model); AssertXLSX(bytes); }
public void RtfHumUrgentyNotificationTest() { var model = new BaseIdModel("en", 45820000633, false) { ExportFormat = ReportExportType.Rtf.ToString() }; byte[] bytes = m_Facade.ExportHumUrgentyNotification(model); // File.WriteAllBytes("C:\\1.rtf", bytes); AssertRTF(bytes); }
public ApiResultModel <QueryUserResponseModel> GetOne(BaseIdModel idModel) { throw new System.NotImplementedException(); }
public ApiResultModel <int> Delete(BaseIdModel idModel) { throw new System.NotImplementedException(); }
public ApiResultModel <QueryRoleResponseModel> GetOne(BaseIdModel idModel) { throw new NotImplementedException(); }
public ApiResultModel <int> Delete(BaseIdModel requestModel) { return(_menuService.Delete(requestModel)); }