/// <summary>
        /// Process a property
        /// </summary>
        public long?Process(PublicSafetyProperty property)
        {
            var link = 0;

            property.MasterPropertyId = _masterPropertyResolver.Resolve(property);
            try
            {
                // invoke classic rms procs for master property processing.
                link = new ProcessMasterProperty(property).Execute(_vsiData.Database);
            }
            catch (Exception e)
            {
                #region Handle Failure
                // TODO: Evaluate how the system should behave when unable to communicate with the classic system.
                // TODO: Should we set the link to null to indicate the property has yet to be processed?
                // TODO: We may want to only set it to null if it is not already a proper value, so we don't
                // TODO: lose a valid link just because we cannot communicate with classic.

                var log = LogProvider.Get <MasterPropertyProcessor>();
                log.Error("Failed to process property: " + Environment.NewLine + e);
                // TODO: What is a "valid" link? >0?  Do we need to do Anything?
                if (!property.MasterPropertyId.HasValue || property.MasterPropertyId < 1)
                {
                    link = 0;
                }
                #endregion
            }

            // Set the Link
            property.SetMasterIndexLink(link);

            // Return the link for quick reference
            return(property.MasterPropertyId);
        }
Esempio n. 2
0
        public void ProcessMasterIndexes_Property_AsEntity()
        {
            _propertyProcessor.Setup(mock => mock.Process(It.IsAny <PublicSafetyProperty>()));
            PublicSafetyProperty entity = new PublicSafetyProperty(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid());

            masterIndexServiceObj.ProcessMasterIndexes <PublicSafetyProperty>(entity);
            _propertyProcessor.VerifyAll();
        }
        private void SetUpIncidentProperty()
        {
            var incidentProperty = new PublicSafetyProperty(DataEntryUnitTestFixture.IdentityId, DataEntryUnitTestFixture.AgencyDetails.Id, Guid.NewGuid());

            _summariesUnitOfWork.Setup(mock => mock.Find <PublicSafetyProperty>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>()))
            .Returns(incidentProperty);
            _incidentSummary.Property.Add(incidentProperty);
            _incidentPropertyId = incidentProperty.Id;
        }
Esempio n. 4
0
        public long?Resolve(PublicSafetyProperty property)
        {
            var masterPropertyId = 0;

            if (property.Make != null && property.Model != null && property.Serial != null)
            {
                masterPropertyId = _vsiData.Master_Property.Where(x => x.Make == property.Make.Description && x.Model == property.Model && x.Serial == property.Serial).Select(x => x.Master_Property_Link).FirstOrDefault();
            }
            return(masterPropertyId);
        }
        public void FindArrestProperty()
        {
            //Arrange
            var publicSafetyProperty = new PublicSafetyProperty(DataEntryUnitTestFixture.IdentityId, DataEntryUnitTestFixture.AgencyDetails.Id, Guid.NewGuid());

            summariesUnitOfWork.Setup(mock => mock.Find <PublicSafetyProperty>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>())).Returns(publicSafetyProperty);
            //Act
            var arrestProperty = arrestSummaryQueryService.FindArrestProperty(It.IsAny <Guid>());

            //Assert
            arrestProperty.Should().NotBeNull();
        }
Esempio n. 6
0
 public ProcessMasterProperty(PublicSafetyProperty property)
 {
     _property = property;
 }
Esempio n. 7
0
 private void ProcessProperty(PublicSafetyProperty property)
 {
     _propertyProcessor.Process(property);
 }