/// <summary> ///删除部门/院系信息 /// </summary> /// <param name="id">部门/院系编号</param> /// <param name="context">数据库连接上下文对象</param> /// <returns></returns> public async Task <bool> DeleteDepartmentAsync(long id, ApplicationDbContext context) { try { //Delete Department Data await SchoolRepository.DeleteAsync(id, context); //Add Operate Information var operate = string.Format("删除部门/院系数据,部门/院系Id:{0}", id); PSURepository.InsertRecordAsync("Department", "SchoolDomain", "DeleteDepartmentAsync", operate, (short)PSURepository.OperateCode.Delete, id, context); var index = await context.SaveChangesAsync(); return(index == 2); } catch (Exception ex) { _logger.LogError("删除部门/院系失败:{0},\r\n内部错误信息:{1}", ex.Message, ex.InnerException.Message); return(false); } }