示例#1
0
 public ClientRegistered(ClientId clientId, IdentityNumber identityNumber, PersonName clientName, TelephoneNumber primaryContactNumber)
 {
     ClientId = clientId;
     IdentityNumber = identityNumber;
     ClientName = clientName;
     PrimaryContactNumber = primaryContactNumber;
 }
示例#2
0
 void IHandleClientStateTransitions.When(ClientRegistered @event)
 {
     Identity = @event.ClientId;
     identityNumber = @event.IdentityNumber;
     clientName = @event.ClientName;
     primaryContactNumber = @event.PrimaryContactNumber;
     dateOfBirth = @event.IdentityNumber.GetDateOfBirth();
 }
示例#3
0
        public virtual bool Equals(IdentityNumber other)
        {
            if (null != other && other.GetType() == GetType())
            {
                return other.Number.Equals(Number);
            }

            return false;
        }
示例#4
0
        public RegisterClient(IdentityNumber identityNumber, PersonName clientName, TelephoneNumber primaryContactNumber)
        {
            Mandate.ParameterNotDefaut(identityNumber, "identityNumber");
            Mandate.ParameterNotDefaut(clientName, "clientName");
            Mandate.ParameterNotDefaut(primaryContactNumber, "primaryContactNumber");

            IdentityNumber = identityNumber;
            ClientName = clientName;
            PrimaryContactNumber = primaryContactNumber;
        }
        public void Build(string[] args)
        {
            if (args.Length != 4)
            {
                throw new Exception(String.Format("Error. Usage is: {0}", Usage));
            }

            ClientName = new PersonName(args[0], args[1]);
            IdentityNumber = new IdentityNumber(args[2]);
            PrimaryContactNumber = new TelephoneNumber(args[3]);
        }
示例#6
0
        public ClientRegistered(ClientId clientId, IdentityNumber identityNumber, PersonName clientName, TelephoneNumber primaryContactNumber)
        {
            Mandate.ParameterNotNull(clientId, "clientId");
            Mandate.ParameterNotDefaut(identityNumber, "identityNumber");
            Mandate.ParameterNotDefaut(clientName, "clientName");
            Mandate.ParameterNotDefaut(primaryContactNumber, "primaryContactNumber");

            ClientId = clientId;
            IdentityNumber = identityNumber;
            ClientName = clientName;
            PrimaryContactNumber = primaryContactNumber;
        }
示例#7
0
        protected override void RestoreSnapshot(IMemento memento)
        {
            var snapshot = (ClientSnapshot)memento;

            dateOfBirth = snapshot.DateOfBirth;
            clientName = snapshot.ClientName;
            primaryContactNumber = snapshot.PrimaryContactNumber;
            identityNumber = snapshot.IdentityNumber;
            isDeceased = snapshot.IsDeceased;
        }
示例#8
0
 public Client Get(IdentityNumber identityNumber)
 {
     return Get(new ClientId(identityNumber));
 }