public static IEnumerable <PersonRegistrationKey> GetByCriteria(PartDataContext dataContext, SoegObjektType soegObject, params Guid[] personRegistrationIds) { var elements = PersonRegistration.CreateXQueryElements(soegObject); if (personRegistrationIds != null) { if (personRegistrationIds.Length == 0) { return(new PersonRegistrationKey[0]); } else { elements.Add( new InWhereCondition() { ColumnName = "PersonRegistrationId", Values = personRegistrationIds.Select( id => id.ToString() ).ToArray() }); } } var byCriteria = WhereCondition.GetMatchingObjects <PersonRegistrationKey>(dataContext, elements, "PersonRegistration", new string[] { "PersonRegistrationId", "UUID" }); return(byCriteria); }
public static IEnumerable <Guid> GetUuidsByCriteria(PartDataContext dataContext, SoegObjektType soegObject, int startIndex, int maxCount) { var elements = PersonRegistration.CreateXQueryElements(soegObject); #if Mono var byCriteriaStr = WhereCondition.GetMatchingObjects <object>(dataContext, elements, "PersonRegistration", true, new string[] { "UUID" }, startIndex, maxCount, "UUID"); var byCriteria = byCriteriaStr.Select(o => new Guid(o.ToString())); #else var byCriteria = WhereCondition.GetMatchingObjects <Guid>(dataContext, elements, "PersonRegistration", true, new string[] { "UUID" }, startIndex, maxCount, "UUID"); #endif return(byCriteria); }
public static Schemas.Part.RegistreringType1 ToXmlType(PersonRegistration db) { if (db != null) { var xml = db.Contents.ToString(); // Deserialize the stored XML for maximum performance var ret = Strings.Deserialize <RegistreringType1>(xml); if (db.SourceObjects != null) { ret.SourceObjectsXml = db.SourceObjects.ToString(); } return(ret); } return(null); }
public static PersonRegistration FromXmlType(CprBroker.Schemas.Part.RegistreringType1 partRegistration) { PersonRegistration ret = null; if (partRegistration != null) { ret = new PersonRegistration() { PersonRegistrationId = Guid.NewGuid(), ActorRef = ActorRef.FromXmlType(partRegistration.AktoerRef), CommentText = partRegistration.CommentText, LifecycleStatusId = LifecycleStatus.GetCode(partRegistration.LivscyklusKode), RegistrationDate = partRegistration.Tidspunkt.ToDateTime().Value, //PersonState = PersonState.FromXmlType(partRegistration.TilstandListe) }; /* * if (partRegistration.AttributListe != null) * { * ret.PersonAttributes.AddRange(CprBroker.Data.Part.PersonAttributes.FromXmlType(partRegistration.AttributListe)); * } * * if (partRegistration.RelationListe != null) * { * ret.PersonRelationships.AddRange(PersonRelationship.FromXmlType(partRegistration.RelationListe)); * } */ ret.SetContents(partRegistration); if (!string.IsNullOrEmpty(partRegistration.SourceObjectsXml)) { ret.SourceObjects = System.Xml.Linq.XElement.Parse(partRegistration.SourceObjectsXml); } } return(ret); }
private void detach_PersonRegistrations(PersonRegistration entity) { this.SendPropertyChanging(); entity.ActorRef = null; }
private void attach_PersonRegistrations(PersonRegistration entity) { this.SendPropertyChanging(); entity.Person = this; }
private void detach_PersonRegistrations(PersonRegistration entity) { this.SendPropertyChanging(); entity.LifecycleStatus = null; }