/// <summary> /// Remove a contribution from Recent Info /// </summary> private void RemoveContribution <TRecentInfo>(ContributionDetails contributionDetails) where TRecentInfo : Domain.RecentInfo.Aggregates.RecentInfo { var info = FindContributionForDelete <TRecentInfo>(contributionDetails); if (info != null) { UnitOfWork.Remove(info); UnitOfWork.Commit(); } else { Log.Info("Remove requested for Contribution: Contribution could not be found."); } }
private bool Contribute_Person_Works() { using (var ioc = DependencyContainer.Resolve <IRecentInfoCommandService>()) { var data = new RecentPersonDetails() { Age = new CodeValue("25", "25"), Age2 = 35, AttorneyName = new CodeValue("ATT", "Attorney"), Build = new CodeValue("B", "Big"), DateOfBirth = DateTime.Now, Email = "*****@*****.**", Ethnicity = new CodeValue("Y", "Yes"), EyeColor = new CodeValue("7", "Yellow"), FacialHair = new CodeValue("YL", "Yes Lots"), FirstName = "John", Glasses = new CodeValue("Y", "Yes"), HairColor = new CodeValue("BRN", "Brown"), HairLength = new CodeValue("XXL", "2 Meters"), HairStyle = new CodeValue("B", "Bad"), Height = "123", JcaNumber = "JCA54321", LastName = "Vernacle", LicenseNumber = "5", LicenseState = new CodeValue("NC", "North Carolina"), MaritalStatus = new CodeValue("Y", "Yes"), MethodOfOperation = new CodeValue("Y", "Yes"), MiddleName = "Bart", MiscellaneousIdNumber = "7", MiscellaneousIdState = new CodeValue("Y", "Yes"), MiscellaneousIdType = new CodeValue("Y", "Yes"), Moniker = "Jimmy", OrganizationName = "Place I Work?", OrganizationType = new CodeValue("Y", "Yes"), Contact1 = new ContactInfo(new CodeValue("H", "Home"), "827388123"), Contact2 = new ContactInfo(new CodeValue("H", "Home"), "827388123"), Contact3 = new ContactInfo(new CodeValue("H", "Home"), "827388123"), PlaceOfBirth = new CodeValue("Y", "Yes"), //PrimaryAddress = HostTestService.NewLocation, Race = new CodeValue("Y", "Yes"), ResidentStatus = new CodeValue("Y", "Yes"), //SecondaryAddress = HostTestService.NewLocation, Sex = new CodeValue("Y", "Yes"), Skin = new CodeValue("Y", "Yes"), Ssn = "123456789", Suffix = "Jr.", Weight = 125 }; var svc = ioc.Instance; var contributionDetails = new ContributionDetails() { Contributor = "TEST", Agency = "TEST", ResourceId = Guid.NewGuid().ToString(), ResourceType = "Person", System = "InformRMSTest" }; var id = svc.ContributePerson(contributionDetails, RecentInfoType.MISC, data); return(id != Guid.Empty); } }
public RecentPerson(ContributionDetails contributionDetails, RecentInfoType recentInfoType) : base(contributionDetails, recentInfoType) { }
public void RemoveEvent(ContributionDetails contributionDetails) { RemoveContribution <RecentEvent>(contributionDetails); }
public void RemoveVehicle(ContributionDetails contributionDetails) { RemoveContribution <RecentVehicle>(contributionDetails); }
/// <summary> /// Attempt to locate and return an existing Recent Info entity using the contribution details. /// If no existing entity is found, a new one is created and returned. /// </summary> private Domain.RecentInfo.Aggregates.RecentInfo FindOrCreateContribution <TRecentInfo>(ContributionDetails contributionDetails, Func <TRecentInfo> constructor) where TRecentInfo : Domain.RecentInfo.Aggregates.RecentInfo { var recentContribution = FindContributionForUpdate <TRecentInfo>(contributionDetails); if (recentContribution == null) { Log.Debug("Creating New Recent Info: {0}", typeof(TRecentInfo).Name); recentContribution = constructor(); UnitOfWork.Add(recentContribution); } else { Log.Debug("Updating Recent Info: {0} [{1}]", typeof(TRecentInfo).Name, recentContribution.Id); } return(recentContribution); }
public void RemoveProperty(ContributionDetails contributionDetails) { RemoveContribution <RecentProperty>(contributionDetails); }
public void RemovePerson(ContributionDetails contributionDetails) { RemoveContribution <RecentPerson>(contributionDetails); }
public RecentProperty(ContributionDetails contributionDetails, RecentInfoType recentInfoType) : base(contributionDetails, recentInfoType) { }
public RecentCallForService(ContributionDetails contributionDetails, RecentInfoType recentInfoType) : base(contributionDetails, recentInfoType) { }
protected RecentInfo(ContributionDetails contributionDetails, RecentInfoType recentInfoType) { ContributionDetails = contributionDetails; RecentInfoType = recentInfoType; SetContributionDate(DateTime.Now); }