| | |
| | | using DocumentServiceAPI.Application.ProjectInfo.ViewMode; |
| | | using DocumentServiceAPI.Application.Repository; |
| | | using DocumentServiceAPI.Model.cyDocumentModel; |
| | | using DocumentServiceAPI.Model.Permissions; |
| | | using DocumentServiceAPI.Model.UserInfoModel; |
| | | using DocumentServiceAPI.Utility; |
| | | using MapsterMapper; |
| | |
| | | } |
| | | else |
| | | { |
| | | var aaa = GetJwtInfo(); |
| | | var tenantPermissions = _db.Queryable<TenantPermissions>().Where(x => x.IsDel == false && x.IsEn == true && x.TenantId == aaa.TEID.Value && x.PermissionsType == TenantPermissionsType.Manage).First(); |
| | | if (tenantPermissions != null) |
| | | { |
| | | var times = _db.Queryable<Document_TenderUnit>().Count(x => x.IsDeled == false && x.IsEn == true && x.TenantId == aaa.TEID.Value); |
| | | if (tenantPermissions.UnitMaxCount > 0 && tenantPermissions.UnitMaxCount <= times) |
| | | { |
| | | throw new Exception("投标单位数量超出最大值!无法新增"); |
| | | } |
| | | } |
| | | dp.IsEn = true; |
| | | dp.IsDeled = false; |
| | | _db.Insertable<Document_TenderUnit>(dp).ExecuteCommand(); |
| | | } |
| | | |
| | |
| | | { |
| | | var aaa = GetJwtInfo(); |
| | | |
| | | |
| | | var tenantPermissions = _db.Queryable<TenantPermissions>().Where(x => x.IsDel == false && x.IsEn == true && x.TenantId == aaa.TEID.Value && x.PermissionsType == TenantPermissionsType.Manage).First(); |
| | | if (tenantPermissions != null) |
| | | { |
| | | var times = _db.Queryable<EmployeeAtTenant>().Count(x => x.IsDel == false && x.IsEn == true && x.TenantID == aaa.TEID.Value ); |
| | | if(tenantPermissions.EmployeeMaxCount>0 && tenantPermissions.EmployeeMaxCount<= times) |
| | | { |
| | | throw new Exception("员工数量超出最大值!无法新增"); |
| | | } |
| | | } |
| | | |
| | | dp.EmployeeId = _db.Insertable<Document_EmployeeInfo>(document_EmployeeInfo).ExecuteReturnIdentity(); |
| | | |