public async Task CreateAsync(OrganizationExtended organizationExtendedUnit) { organizationExtendedUnit.Code = await GetNextChildCodeAsync(organizationExtendedUnit.ParentId); await ValidateOrganizationUnitAsync(organizationExtendedUnit); await OrganizationExtendedUnitRepository.InsertAsync(organizationExtendedUnit); }
public async Task <List <OrganizationExtended> > GetExtendedOrganizationUnitsAsync(User user, EntityClassification entityClassificationId) { var query = await(from uou in UserOrganizationUnitRepository.GetAll() join ou in OrganizationExtendedUnitRepository.GetAll() on uou.OrganizationUnitId equals ou.Id where uou.UserId == user.Id && ou.EntityClassificationId == entityClassificationId select ou).ToListAsync(); return(query); }
public async Task UpdateAsync(OrganizationExtended organizationExtendedUnit) { await ValidateOrganizationUnitAsync(organizationExtendedUnit); await OrganizationExtendedUnitRepository.UpdateAsync(organizationExtendedUnit); }