Example #1
0
 public List <AccountDomainEntity> GetListByPerson(PersonDomainEntity person)
 {
     return(GetListBy(
                a =>
                a.OwnerType == AccountOwnerType.Person.ToInt() && a.OwnerId == person.PersonId
                ));
 }
Example #2
0
 public CompanyDomainEntity With(
     string companyName,
     PersonDomainEntity responsablePerson,
     string address,
     string phoneNumber,
     string taxNumber)
 {
     CompanyName       = companyName ?? throw new CommonException.RequiredParameterMissingException(nameof(companyName));
     ResponsablePerson = responsablePerson ?? throw new CommonException.RequiredParameterMissingException(nameof(responsablePerson));
     Address           = address ?? throw new CommonException.RequiredParameterMissingException(nameof(address));
     PhoneNumber       = phoneNumber ?? throw new CommonException.RequiredParameterMissingException(nameof(phoneNumber));
     TaxNumber         = taxNumber ?? throw new CommonException.RequiredParameterMissingException(nameof(taxNumber));
     return(this);
 }
Example #3
0
        public TokenDomainEntity With(PersonDomainEntity person, ApplicationDomainEntity application)
        {
            Person      = person ?? throw new CommonException.RequiredParameterMissingException(nameof(person));
            Application = application ?? throw new CommonException.RequiredParameterMissingException(nameof(application));

            Guid guid = Guid.NewGuid();

            Value = coreContext.Cryptographer.GenerateMD5Hash(guid.ToString());

            CreateDate = DateTime.Now;
            ValidUntil = CreateDate.AddHours(1);

            return(this);
        }
Example #4
0
        public void Insert(bool forceToInsertDb = true)
        {
            PersonDomainEntity person = null;

            try
            {
                person = personRepository.GetByIdentityNumber(IdentityNumber);
            }
            catch (System.Exception)
            {
            }

            if (person != null)
            {
                throw new AccountManagementException.PersonAlreadyExistWithTheGivenIdentityNumberException(string.Format("{0} = {1}", nameof(IdentityNumber), IdentityNumber));
            }

            personRepository.InsertEntity(this, forceToInsertDb);
        }
Example #5
0
 public CompanyDomainEntity GetByResponsablePerson(PersonDomainEntity person)
 {
     return(GetFirstBy(p => p.ResponsablePersonId == person.PersonId));
 }