Пример #1
0
        private static void CheckCompanyAccess(CompanyEntity company)
        {
            if (company.State == (int)ResourceState.Blocked)
            {
                throw new ForbiddenException(string.Format("Company {0} is blocked", company.Id));
            }

            if (company.State == (int)ResourceState.Deleted)
            {
                throw new NotFoundException(string.Format("Company {0} is deleted", company.Id));
            }
        }
Пример #2
0
 private async Task<DomainClientForAdmin> GetClientDataAsync(CompanyEntity company)
 {
     return new DomainClientForAdmin
     {
         Id = company.Id,
         Name = company.Name,
         Email = company.Email,
         Created = company.Created,
         Balance = await _balanceService.GetBalanceAsync(company.Id),
         State = (ResourceState)company.State
     };
 }