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); }
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); }