private bool UpdateParts(ThisEntity entity, ref SaveStatus status)
        {
            bool   isAllValid    = true;
            Entity relatedEntity = EntityManager.GetEntity(entity.RowId);

            if (relatedEntity == null || relatedEntity.Id == 0)
            {
                status.AddError("Error - the related Entity was not found.");
                return(false);
            }

            EntityPropertyManager mgr = new EntityPropertyManager();

            //first clear all properties
            mgr.DeleteAll(relatedEntity, ref status);
            //
            if (mgr.AddProperties(entity.ExternalInputType, entity.RowId, CodesManager.ENTITY_TYPE_PROCESS_PROFILE, CodesManager.PROPERTY_CATEGORY_EXTERNAL_INPUT_TYPE, false, ref status) == false)
            {
                isAllValid = false;
            }
            if (mgr.AddProperties(entity.DataCollectionMethodType, entity.RowId, CodesManager.ENTITY_TYPE_PROCESS_PROFILE, CodesManager.PROPERTY_CATEGORY_DATA_COLLECTION_METHOD_TYPE, false, ref status) == false)
            {
                isAllValid = false;
            }

            if (HandleTargets(entity, relatedEntity, ref status) == false)
            {
                isAllValid = false;
            }
            //
            return(isAllValid);
        }
Beispiel #2
0
        private bool UpdateParts(ThisEntity entity, ref SaveStatus status)
        {
            bool isAllValid = true;

            EntityPropertyManager mgr = new EntityPropertyManager();

            if (mgr.AddProperties(entity.ClaimType, entity.RowId, CodesManager.ENTITY_TYPE_PROCESS_PROFILE, CodesManager.PROPERTY_CATEGORY_CLAIM_TYPE, false, ref status) == false)
            {
                isAllValid = false;
            }

            //CostProfile
            CostProfileManager cpm = new Factories.CostProfileManager();

            cpm.SaveList(entity.EstimatedCost, entity.RowId, ref status);

            int newId = 0;

            if (entity.TargetCredentialIds != null && entity.TargetCredentialIds.Count > 0)
            {
                Entity_CredentialManager ecm = new Entity_CredentialManager();
                foreach (int id in entity.TargetCredentialIds)
                {
                    ecm.Add(entity.RowId, id, ref newId, ref status);
                }
            }

            return(isAllValid);
        }
Beispiel #3
0
        private bool UpdateParts(ThisEntity entity, ref SaveStatus status)
        {
            bool isAllValid = true;

            EntityPropertyManager mgr = new EntityPropertyManager();

            if (mgr.AddProperties(entity.ApplicableAudienceType, entity.RowId, CodesManager.ENTITY_TYPE_COST_PROFILE_ITEM, CodesManager.PROPERTY_CATEGORY_AUDIENCE_TYPE, false, ref status) == false)
            {
                isAllValid = false;
            }

            if (mgr.AddProperties(entity.ResidencyType, entity.RowId, CodesManager.ENTITY_TYPE_COST_PROFILE_ITEM, CodesManager.PROPERTY_CATEGORY_RESIDENCY_TYPE, false, ref status) == false)
            {
                isAllValid = false;
            }

            return(isAllValid);
        }
Beispiel #4
0
        private bool UpdateParts(ThisEntity entity, ref SaveStatus status)
        {
            bool isAllValid = true;

            EntityPropertyManager mgr = new EntityPropertyManager();

            if (mgr.AddProperties(entity.ExternalInput, entity.RowId, CodesManager.ENTITY_TYPE_PROCESS_PROFILE, CodesManager.PROPERTY_CATEGORY_EXTERNAL_INPUT_TYPE, false, ref status) == false)
            {
                isAllValid = false;
            }

            if (HandleTargets(entity, ref status) == false)
            {
                isAllValid = false;
            }
            //
            return(isAllValid);
        }
        public bool UpdateParts(ThisEntity entity, bool isAdd, ref SaveStatus status)
        {
            bool isValid = true;

            EntityPropertyManager mgr = new EntityPropertyManager();

            if (mgr.AddProperties(entity.JurisdictionAssertion, entity.RowId, CodesManager.ENTITY_TYPE_JURISDICTION_PROFILE, CodesManager.PROPERTY_CATEGORY_JurisdictionAssertionType, false, ref status) == false)
            {
                isValid = false;
            }

            int id = GeoCoordinates_Add(entity.MainJurisdiction, entity.Id, ref status);

            if (entity.JurisdictionException != null)
            {
                foreach (var gc in entity.JurisdictionException)
                {
                    GeoCoordinates_Add(gc, entity.Id, ref status);
                }
            }
            return(isValid);
        }
        private bool UpdateParts(ThisEntity entity, ref SaveStatus status)
        {
            bool   isAllValid    = true;
            Entity relatedEntity = EntityManager.GetEntity(entity.RowId);

            if (relatedEntity == null || relatedEntity.Id == 0)
            {
                status.AddError("Error - the related Entity was not found.");
                return(false);
            }
            EntityPropertyManager mgr = new EntityPropertyManager();

            //first clear all properties
            mgr.DeleteAll(relatedEntity, ref status);
            //
            if (mgr.AddProperties(entity.ClaimType, entity.RowId, CodesManager.ENTITY_TYPE_PROCESS_PROFILE, CodesManager.PROPERTY_CATEGORY_CLAIM_TYPE, false, ref status) == false)
            {
                isAllValid = false;
            }

            //CostProfile
            CostProfileManager cpm = new Factories.CostProfileManager();

            cpm.SaveList(entity.EstimatedCost, entity.RowId, ref status);

            int newId = 0;
            Entity_CredentialManager ecm = new Entity_CredentialManager();

            ecm.DeleteAll(relatedEntity, ref status);
            if (entity.TargetCredentialIds != null && entity.TargetCredentialIds.Count > 0)
            {
                foreach (int id in entity.TargetCredentialIds)
                {
                    ecm.Add(entity.RowId, id, BaseFactory.RELATIONSHIP_TYPE_HAS_PART, ref newId, ref status);
                }
            }

            return(isAllValid);
        }
Beispiel #7
0
        public bool UpdateParts(ThisEntity entity, ref SaveStatus status)
        {
            bool   isAllValid    = true;
            Entity relatedEntity = EntityManager.GetEntity(entity.RowId);

            if (relatedEntity == null || relatedEntity.Id == 0)
            {
                status.AddError("Error - the related Entity was not found for financial assistance profile.");
                return(false);
            }

            EntityPropertyManager mgr = new EntityPropertyManager();

            //first clear all properties
            mgr.DeleteAll(relatedEntity, ref status);

            if (mgr.AddProperties(entity.FinancialAssistanceType, entity.RowId, CodesManager.ENTITY_TYPE_FINANCIAL_ASST_PROFILE, CodesManager.PROPERTY_CATEGORY_FINANCIAL_ASSISTANCE, false, ref status) == false)
            {
                isAllValid = false;
            }


            return(isAllValid);
        }         //