Example #1
0
        public void Update(ClientInfo clientInfo)
        {
            SyncStatus       = Shared.Enum.SyncStatus.Staged;
            SyncStatusDate   = DateTime.Now;
            IsFamilyMember   = clientInfo.IsFamilyMember;
            IsPartner        = clientInfo.IsPartner;
            MaritalStatus    = clientInfo.MaritalStatus;
            KeyPop           = clientInfo.KeyPop;
            OtherKeyPop      = clientInfo.OtherKeyPop;
            PreventEnroll    = clientInfo.PreventEnroll;
            AlreadyTestedPos = clientInfo.AlreadyTestedPos;
            UserId           = clientInfo.UserId;

            Identifiers.Clear();
            var identifiers = ClientIdentifier.Create(clientInfo);

            AddIdentifiers(identifiers);

            Relationships.Clear();
            var relationships = ClientRelationship.Create(clientInfo);

            AddRelationships(relationships);

            ClientStates.Clear();
            var stats = ClientState.Create(clientInfo);

            AddClientStates(stats);
        }
Example #2
0
        public ClientInfo GetClientInfo()
        {
            var c  = new ClientInfo();
            var cl = Clients.FirstOrDefault();

            if (null != cl)
            {
                c.Id               = cl.Id;
                c.MaritalStatus    = cl.MaritalStatus;
                c.KeyPop           = cl.KeyPop;
                c.OtherKeyPop      = cl.OtherKeyPop;
                c.IsFamilyMember   = cl.IsFamilyMember;
                c.IsPartner        = cl.IsPartner;
                c.PreventEnroll    = cl.PreventEnroll;
                c.AlreadyTestedPos = cl.AlreadyTestedPos;

                c.PracticeId = cl.PracticeId;
                c.Person     = GetPersonInfo();
                if (null != c.Person)
                {
                    c.PersonId = c.Person.Id;
                }
                c.Identifiers   = ClientIdentifier.GetIdentifierInfos(cl.Identifiers.ToList());
                c.Relationships = ClientRelationship.GetClientRelationshipInfos(cl.Relationships.ToList());
                c.ClientStates  = ClientState.GetClientStateInfos(cl.ClientStates.ToList());
            }

            return(c);
        }
Example #3
0
        public static Client Create(ClientInfo clientInfo, Guid practiceId, Guid personId)
        {
            var client = new Client(clientInfo.Id, clientInfo.MaritalStatus, clientInfo.KeyPop, clientInfo.OtherKeyPop, practiceId,
                                    personId, clientInfo.IsFamilyMember, clientInfo.IsPartner, clientInfo.PreventEnroll, clientInfo.AlreadyTestedPos);

            var identifiers = ClientIdentifier.Create(clientInfo);

            client.AddIdentifiers(identifiers);

            var relationships = ClientRelationship.Create(clientInfo);

            client.AddRelationships(relationships);

            var states = ClientState.Create(clientInfo);

            client.AddClientStates(states);
            client.UserId         = clientInfo.UserId;
            client.SyncStatus     = Shared.Enum.SyncStatus.Staged;
            client.SyncStatusDate = DateTime.Now;
            return(client);
        }
Example #4
0
 public void AddIdentifier(ClientIdentifier personName)
 {
     personName.ClientId = Id;
     Identifiers.Add(personName);
 }