Ejemplo n.º 1
0
        private bool ObjectIsEnabledOfType(string objectTypeCode, int objectId)
        {
            var maybeGenderType = _objectTypesService.Get(code: objectTypeCode);

            if (!maybeGenderType.Success)
            {
                return(false);
            }
            var maybeGenderObject = _objectsService.GetById(objectId: objectId);

            if (!maybeGenderObject.Success)
            {
                return(false);
            }
            if (maybeGenderObject.Value.ObjectTypeId != maybeGenderType.Value.Id)
            {
                return(false);
            }
            if (!maybeGenderObject.Value.IsEnabled)
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 2
0
        private IEnumerable <ObjectItem> ActiveOfType(string typeCode)
        {
            var eyeColorType = _objectTypesService.Get(typeCode);

            return(_objectsService.ActiveOfType(eyeColorType.Value.Id));
        }