Exemple #1
0
        public CswNbtNodePropViewReference(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node)
            : base(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node)
        {
            _ViewIdSubField         = ((CswNbtFieldTypeRuleViewReference)_FieldTypeRule).ViewIdSubField;
            _CachedViewNameSubField = ((CswNbtFieldTypeRuleViewReference)_FieldTypeRule).CachedViewNameSubField;


            // Associate subfields with methods on this object, for SetSubFieldValue()
            _SubFieldMethods.Add(_ViewIdSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => ViewId,
                                                                                                     x =>
            {
                if (CswTools.IsInteger(x))
                {
                    ViewId = new CswNbtViewId(CswConvert.ToInt32(x));
                }
                else if (x is CswNbtViewId)
                {
                    ViewId = x;
                }
                else if (string.IsNullOrEmpty(x))
                {
                    ViewId = null;
                }
                else
                {
                    throw new CswDniException(CswEnumErrorType.Error, "Invalid parameter", "CswNbtNodePropViewReference got an invalid parameter for setting ViewId: " + x.ToString());
                }
            }));
            _SubFieldMethods.Add(_CachedViewNameSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => CachedViewName, x => CachedViewName = CswConvert.ToString(x)));
        }
        public CswNbtNodePropRelationship( CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node )
            : base( CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node )
        {
            _NameSubField = ( (CswNbtFieldTypeRuleRelationship) _FieldTypeRule ).NameSubField;
            _NodeIDSubField = ( (CswNbtFieldTypeRuleRelationship) _FieldTypeRule ).NodeIDSubField;

            // case 25956
            _SearchThreshold = CswConvert.ToInt32( _CswNbtResources.ConfigVbls.getConfigVariableValue( CswEnumNbtConfigurationVariables.relationshipoptionlimit.ToString() ) );
            if( _SearchThreshold <= 0 )
            {
                _SearchThreshold = 100;
            }

            // Associate subfields with methods on this object, for SetSubFieldValue()
            _SubFieldMethods.Add( _NameSubField.Name, new Tuple<Func<dynamic>, Action<dynamic>>( () => CachedNodeName, x => CachedNodeName = CswConvert.ToString( x ) ) );
            _SubFieldMethods.Add( _NodeIDSubField.Name, new Tuple<Func<dynamic>, Action<dynamic>>( () => RelatedNodeId,
                                                                                              x =>
                                                                                              {
                                                                                                  if( CswTools.IsInteger( x ) )
                                                                                                  {
                                                                                                      RelatedNodeId = new CswPrimaryKey( "nodes", x );
                                                                                                  }
                                                                                                  else
                                                                                                  {
                                                                                                      RelatedNodeId = CswConvert.ToPrimaryKey( x );
                                                                                                  }
                                                                                              } ) );
        }
 public CswNbtNodePropWrapper(CswNbtResources CswNbtResources, CswNbtNode Node, CswNbtNodeProp CswNbtNodeProp, CswNbtNodePropData CswNbtNodePropData)
 {
     _CswNbtNodeProp     = CswNbtNodeProp;
     _CswNbtNodePropData = CswNbtNodePropData;
     _CswNbtResources    = CswNbtResources;
     _Node = Node;
 }//ctor
        /// <summary>
        /// Constructor
        /// </summary>
        public CswNbtNodePropQuestion(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node)
            : base(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node)
        {
            //if( _CswNbtMetaDataNodeTypeProp.FieldType.FieldType != CswEnumNbtFieldType.Question )
            //{
            //    throw ( new CswDniException( ErrorType.Error, "A data consistency problem occurred",
            //                                "CswNbtNodePropQuestion() was created on a property with fieldtype: " + _CswNbtMetaDataNodeTypeProp.FieldType.FieldType ) );
            //}

            CswNbtFieldTypeRuleQuestion FieldTypeRule = (CswNbtFieldTypeRuleQuestion)_FieldTypeRule;

            _AnswerSubField           = FieldTypeRule.AnswerSubField;
            _CommentsSubField         = FieldTypeRule.CommentsSubField;
            _CorrectiveActionSubField = FieldTypeRule.CorrectiveActionSubField;
            _DateAnsweredSubField     = FieldTypeRule.DateAnsweredSubField;
            _DateCorrectedSubField    = FieldTypeRule.DateCorrectedSubField;
            _IsCompliantSubField      = FieldTypeRule.IsCompliantSubField;

            // Associate subfields with methods on this object, for SetSubFieldValue()
            _SubFieldMethods.Add(_AnswerSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => Answer, x => Answer       = CswConvert.ToString(x)));
            _SubFieldMethods.Add(_CommentsSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => Comments, x => Comments = CswConvert.ToString(x)));
            _SubFieldMethods.Add(_CorrectiveActionSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => CorrectiveAction, x => CorrectiveAction = CswConvert.ToString(x)));
            _SubFieldMethods.Add(_DateAnsweredSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => DateAnswered, x => DateAnswered             = CswConvert.ToDateTime(x)));
            _SubFieldMethods.Add(_DateCorrectedSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => DateCorrected, x => DateCorrected          = CswConvert.ToDateTime(x)));
            _SubFieldMethods.Add(_IsCompliantSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => IsCompliant, x => IsCompliant = CswConvert.ToBoolean(x)));
        }//ctor
        }//onBeforeUpdateNodePropRow()

        public override void Copy(CswNbtNodePropData Source)
        {
            if (false == _Node.IsTemp)
            {
                setBarcodeValue();
            }
        }
Exemple #6
0
        public CswNbtNodePropMol(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node)
            : base(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node)
        {
            _MolSubField = ((CswNbtFieldTypeRuleMol)_FieldTypeRule).MolSubField;

            // Associate subfields with methods on this object, for SetSubFieldValue()
            _SubFieldMethods.Add(_MolSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => getMol(), x => setMol(CswConvert.ToString(x))));
        }
        public CswNbtNodePropFormula(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node)
            : base(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node)
        {
            _RawFormulaTextSubfield = ((CswNbtFieldTypeRuleFormula)_FieldTypeRule).TextSubField;

            // Associate subfields with methods on this object, for SetSubFieldValue()
            _SubFieldMethods.Add(_RawFormulaTextSubfield.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => Text, x => Text = CswConvert.ToString(x)));
        }
Exemple #8
0
        /// <summary>
        /// Constructor
        /// </summary>
        public CswNbtNodePropNodeTypeSelect(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node)
            : base(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node)
        {
            _SelectedNodeTypeIdsSubField = ((CswNbtFieldTypeRuleNodeTypeSelect)_FieldTypeRule).SelectedNodeTypeIdsSubField;

            // Associate subfields with methods on this object, for SetSubFieldValue()
            _SubFieldMethods.Add(_SelectedNodeTypeIdsSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => SelectedNodeTypeIds, x => SelectedNodeTypeIds = new CswCommaDelimitedString(CswConvert.ToString(x))));
        }//ctor
Exemple #9
0
        public CswNbtNodePropLogical(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node)
            : base(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node)
        {
            _CheckedSubField = ((CswNbtFieldTypeRuleLogical)_FieldTypeRule).CheckedSubField;

            // Associate subfields with methods on this object, for SetSubFieldValue()
            _SubFieldMethods.Add(_CheckedSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => Checked, x => Checked = CswConvert.ToTristate(x)));
        }
        public CswNbtNodePropComposite(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node)
            : base(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node)
        {
            _CachedValueSubField = ((CswNbtFieldTypeRuleComposite)_FieldTypeRule).CachedValueSubField;

            // Associate subfields with methods on this object, for SetSubFieldValue()
            _SubFieldMethods.Add(_CachedValueSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => CachedValue, null));
        }
        public CswNbtNodePropPermission(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node)
            : base(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node)
        {
            _ValueSubField = ((CswNbtFieldTypeRulePermission)_FieldTypeRule).ValueSubField;

            // Associate subfields with methods on this object, for SetSubFieldValue()
            _SubFieldMethods.Add(_ValueSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => Value, x => Value = new CswCommaDelimitedString(CswConvert.ToString(x))));
        }
        public CswNbtNodePropDateTime(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node)
            : base(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node)
        {
            _DateValueSubField = ((CswNbtFieldTypeRuleDateTime)_FieldTypeRule).DateValueSubField;

            // Associate subfields with methods on this object, for SetSubFieldValue()
            _SubFieldMethods.Add(_DateValueSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => DateTimeValue, x => DateTimeValue = CswConvert.ToDateTime(x)));
        }
Exemple #13
0
        public CswNbtNodePropImage(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node)
            : base(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node)
        {
            //_FileNameSubField = ( (CswNbtFieldTypeRuleImage) _FieldTypeRule ).FileNameSubField;
            //_ContentTypeSubField = ( (CswNbtFieldTypeRuleImage) _FieldTypeRule ).ContentTypeSubField;

            // No subfields
        }
Exemple #14
0
        //All WCF Data Contracts MUST have a default constructor

        /// <summary>
        /// Constructor
        /// </summary>
        protected CswNbtNodeProp(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp MetaDataNodeTypeProp, CswNbtNode Node)
        {
            _CswNbtNodePropData = CswNbtNodePropData;
            _Node                       = Node;
            _CswNbtResources            = CswNbtResources;
            _CswNbtMetaDataNodeTypeProp = MetaDataNodeTypeProp;

            _construct();
        }
        public CswNbtNodePropScientific(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node)
            : base(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node)
        {
            _BaseSubField     = ((CswNbtFieldTypeRuleScientific)_FieldTypeRule).BaseSubField;
            _ExponentSubField = ((CswNbtFieldTypeRuleScientific)_FieldTypeRule).ExponentSubField;

            // Associate subfields with methods on this object, for SetSubFieldValue()
            _SubFieldMethods.Add(_BaseSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => Base, x => Base             = CswConvert.ToDouble(x)));
            _SubFieldMethods.Add(_ExponentSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => Exponent, x => Exponent = CswConvert.ToInt32(x)));
        }
        public CswNbtNodePropSequence(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node)
            : base(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node)
        {
            _SequenceSubField       = ((CswNbtFieldTypeRuleSequence)_FieldTypeRule).SequenceSubField;
            _SequenceNumberSubField = ((CswNbtFieldTypeRuleSequence)_FieldTypeRule).SequenceNumberSubField;
            _Sequence = CswNbtMetaDataNodeTypeProp.Sequence;

            // Associate subfields with methods on this object, for SetSubFieldValue()
            _SubFieldMethods.Add(_SequenceSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => Sequence, x => setSequenceValueOverride(CswConvert.ToString(x), true)));
            _SubFieldMethods.Add(_SequenceNumberSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => SequenceNumber, null));
        }
Exemple #17
0
        //public static CswNbtNodePropWrapper makeNodeProp( CswNbtResources CswNbtResources, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp )
        //{
        //    CswNbtNodePropData CswNbtNodePropData = new CswNbtNodePropData( CswNbtResources, CswNbtMetaDataNodeTypeProp.PropId );
        //    return makeNodeProp( CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp );
        //}

        //public static CswNbtNodePropWrapper makeNodeProp( CswNbtResources CswNbtResources, DataRow PropRow, DataTable PropsTable, CswPrimaryKey NodeId, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtMetaDataNodeTypeTab Tab, NodeEditMode EditMode = NodeEditMode.Edit )
        //{
        //    CswNbtNodePropData CswNbtNodePropData = new CswNbtNodePropData( CswNbtResources, PropRow, PropsTable, NodeId, CswNbtMetaDataNodeTypeProp.PropId );
        //    CswNbtNode Node = CswNbtResources.Nodes.GetNode( NodeId );
        //    return _makeNodeProp( CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node, Tab, EditMode );
        //}

        public static CswNbtNodePropWrapper makeNodeProp(CswNbtResources CswNbtResources, DataRow PropRow, DataTable PropsTable, CswNbtNode Node, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswDateTime Date)
        {
            CswPrimaryKey NodeId = null;

            if (null != Node)
            {
                NodeId = Node.NodeId;
            }
            CswNbtNodePropData CswNbtNodePropData = new CswNbtNodePropData(CswNbtResources, PropRow, PropsTable, NodeId, CswNbtMetaDataNodeTypeProp, Date);

            return(_makeNodeProp(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node));
        }
Exemple #18
0
        public CswNbtNodePropBlob(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node)
            : base(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node)
        {
            _FileNameSubField     = ((CswNbtFieldTypeRuleBlob)_FieldTypeRule).FileNameSubField;
            _ContentTypeSubField  = ((CswNbtFieldTypeRuleBlob)_FieldTypeRule).ContentTypeSubField;
            _DateModifiedSubField = ((CswNbtFieldTypeRuleBlob)_FieldTypeRule).DateModifiedSubField;

            // Associate subfields with methods on this object, for SetSubFieldValue()
            //_SubFieldMethods.Add( _FileNameSubField.Name, new Tuple<Func<dynamic>, Action<dynamic>>( () => FileName, x => FileName = CswConvert.ToString( x ) ) );
            //_SubFieldMethods.Add( _ContentTypeSubField.Name, new Tuple<Func<dynamic>, Action<dynamic>>( () => ContentType, x => ContentType = CswConvert.ToString( x ) ) );
            //_SubFieldMethods.Add( _DateModifiedSubField.Name, new Tuple<Func<dynamic>, Action<dynamic>>( () => DateModified, x => DateModified = CswConvert.ToDateTime( x ) ) );
        }
Exemple #19
0
        public CswNbtNodePropPassword(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node)
            : base(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node)
        {
            _EncryptedPasswordSubField = ((CswNbtFieldTypeRulePassword)_FieldTypeRule).EncryptedPasswordSubField;
            _ChangedDateSubField       = ((CswNbtFieldTypeRulePassword)_FieldTypeRule).ChangedDateSubField;
            _PreviouslyUsedPasswords   = ((CswNbtFieldTypeRulePassword)_FieldTypeRule).PreviouslyUsedPasswords;

            _CswEncryption = new CswEncryption(CswNbtResources.MD5Seed);

            // Associate subfields with methods on this object, for SetSubFieldValue()
            _SubFieldMethods.Add(_EncryptedPasswordSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => EncryptedPassword, x => EncryptedPassword = CswConvert.ToString(x)));
            _SubFieldMethods.Add(_ChangedDateSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => ChangedDate, x => ChangedDate = CswConvert.ToDateTime(x)));
            _SubFieldMethods.Add(_PreviouslyUsedPasswords.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => PreviouslyUsedPasswords, x => PreviouslyUsedPasswords = CswConvert.ToString(x)));
        }
        public CswNbtNodePropNFPA(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node)
            : base(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node)
        {
            _RedSubField    = ((CswNbtFieldTypeRuleNFPA)_FieldTypeRule).RedSubField;
            _YellowSubField = ((CswNbtFieldTypeRuleNFPA)_FieldTypeRule).YellowSubField;
            _BlueSubField   = ((CswNbtFieldTypeRuleNFPA)_FieldTypeRule).BlueSubField;
            _WhiteSubField  = ((CswNbtFieldTypeRuleNFPA)_FieldTypeRule).WhiteSubField;

            // Associate subfields with methods on this object, for SetSubFieldValue()
            _SubFieldMethods.Add(_RedSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => Red, x => Red          = CswConvert.ToString(x)));
            _SubFieldMethods.Add(_YellowSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => Yellow, x => Yellow = CswConvert.ToString(x)));
            _SubFieldMethods.Add(_BlueSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => Blue, x => Blue       = CswConvert.ToString(x)));
            _SubFieldMethods.Add(_WhiteSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => White, x => White    = CswConvert.ToString(x)));
        }
        public CswNbtNodePropList(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node)
            : base(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node)
        {
            _ValueSubField = ((CswNbtFieldTypeRuleList)_FieldTypeRule).ValueSubField;
            _TextSubField  = ((CswNbtFieldTypeRuleList)_FieldTypeRule).TextSubField;

            // Associate subfields with methods on this object, for SetSubFieldValue()
            _SubFieldMethods.Add(_ValueSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => Value, x => Value = CswConvert.ToString(x)));
            _SubFieldMethods.Add(_TextSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => Text, x => Text    = x));

            _SearchThreshold = CswConvert.ToInt32(_CswNbtResources.ConfigVbls.getConfigVariableValue(CswEnumNbtConfigurationVariables.relationshipoptionlimit.ToString()));
            if (_SearchThreshold <= 0)
            {
                _SearchThreshold = 100;
            }
        }
        public CswNbtNodePropQuantity(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node)
            : base(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node)
        {
            _QuantitySubField    = ((CswNbtFieldTypeRuleQuantity)_FieldTypeRule).QuantitySubField;
            _Val_kg_SubField     = ((CswNbtFieldTypeRuleQuantity)_FieldTypeRule).Val_kg_SubField;
            _Val_Liters_SubField = ((CswNbtFieldTypeRuleQuantity)_FieldTypeRule).Val_Liters_SubField;
            _UnitNameSubField    = ((CswNbtFieldTypeRuleQuantity)_FieldTypeRule).UnitNameSubField;
            _UnitIdSubField      = ((CswNbtFieldTypeRuleQuantity)_FieldTypeRule).UnitIdSubField;

            // Associate subfields with methods on this object, for SetSubFieldValue()
            _SubFieldMethods.Add(_QuantitySubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => Quantity, x => Quantity             = CswConvert.ToDouble(x)));
            _SubFieldMethods.Add(_Val_kg_SubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => Val_kg, x => Val_kg                  = CswConvert.ToDouble(x)));
            _SubFieldMethods.Add(_Val_Liters_SubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => Val_Liters, x => Val_Liters      = CswConvert.ToDouble(x)));
            _SubFieldMethods.Add(_UnitNameSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => CachedUnitName, x => CachedUnitName = CswConvert.ToString(x)));
            _SubFieldMethods.Add(_UnitIdSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => UnitId, x => UnitId = CswConvert.ToPrimaryKey(x)));
        }
Exemple #23
0
        public CswNbtNodePropButton(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node)
            : base(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node)
        {
            CswNbtFieldTypeRuleButton FieldTypeRule = (CswNbtFieldTypeRuleButton)_FieldTypeRule;

            _StateSubField       = FieldTypeRule.StateSubField;
            _MenuOptionsSubField = FieldTypeRule.MenuOptionsSubField;
            _DisplayNameSubField = FieldTypeRule.DisplayNameField;
            _IconSubField        = FieldTypeRule.IconSubField;

            // Associate subfields with methods on this object, for SetSubFieldValue()
            _SubFieldMethods.Add(_StateSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => State, x => State = CswConvert.ToString(x)));
            _SubFieldMethods.Add(_MenuOptionsSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => MenuOptions, x => MenuOptions = CswConvert.ToString(x)));
            _SubFieldMethods.Add(_DisplayNameSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => DisplayName, x => DisplayName = CswConvert.ToString(x)));
            _SubFieldMethods.Add(_IconSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => Icon, x => Icon = CswConvert.ToString(x)));
        }
Exemple #24
0
        public CswNbtNodePropTimeInterval(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node)
            : base(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node)
        {
            //_RateInterval = new CswRateInterval(CswNbtNodePropData.Gestalt);   //this should be backwards compatible...

            _init(CswNbtNodePropData.ClobData);

            _IntervalSubField  = ((CswNbtFieldTypeRuleTimeInterval)_FieldTypeRule).IntervalSubField;
            _StartDateSubField = ((CswNbtFieldTypeRuleTimeInterval)_FieldTypeRule).StartDateSubField;
            _ClobDataSubField  = ((CswNbtFieldTypeRuleTimeInterval)_FieldTypeRule).ClobDataSubField;

            // Associate subfields with methods on this object, for SetSubFieldValue()
            _SubFieldMethods.Add(_IntervalSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => null, x => { }));           // weird but intentional - Interval comes from clob
            _SubFieldMethods.Add(_ClobDataSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => RateInterval, x => _init(x)));
            _SubFieldMethods.Add(_StartDateSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => getStartDate(), x => {})); // weird but intentional - start date comes from clob
        }
Exemple #25
0
        public CswNbtNodePropComments(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node)
            : base(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node)
        {
            _CommentSubField = ((CswNbtFieldTypeRuleComments)_FieldTypeRule).CommentSubField;

            // Associate subfields with methods on this object, for SetSubFieldValue()
            _SubFieldMethods.Add(_CommentSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(
                                     () => CommentsJson,
                                     x =>
            {
                if (null != x && false == String.IsNullOrEmpty(x.ToString()))
                {
                    // not sure if this should be AddComment()
                    CommentsJson = CswConvert.ToJArray(x);
                }
            }));
        }
        public CswNbtNodePropMTBF(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node)
            : base(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node)
        {
            _StartDateTimeSubField = ((CswNbtFieldTypeRuleMTBF)_FieldTypeRule).StartDateTimeSubField;
            _UnitsSubField         = ((CswNbtFieldTypeRuleMTBF)_FieldTypeRule).UnitsSubField;
            _ValueSubField         = ((CswNbtFieldTypeRuleMTBF)_FieldTypeRule).ValueSubField;

            if (string.IsNullOrEmpty(Units))
            {
                Units = "days";
            }

            // Associate subfields with methods on this object, for SetSubFieldValue()
            _SubFieldMethods.Add(_StartDateTimeSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => StartDateTime, x => StartDateTime = CswConvert.ToDateTime(x)));
            _SubFieldMethods.Add(_UnitsSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => Units, x => Units             = CswConvert.ToString(x)));
            _SubFieldMethods.Add(_ValueSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => CachedValue, x => CachedValue = CswConvert.ToDouble(x)));
        }
        public CswNbtNodePropNumericRange(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node)
            : base(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node)
        {
            _LowerSubField          = ((CswNbtFieldTypeRuleNumericRange)_FieldTypeRule).LowerSubField;
            _TargetSubField         = ((CswNbtFieldTypeRuleNumericRange)_FieldTypeRule).TargetSubField;
            _UpperSubField          = ((CswNbtFieldTypeRuleNumericRange)_FieldTypeRule).UpperSubField;
            _LowerInclusiveSubField = ((CswNbtFieldTypeRuleNumericRange)_FieldTypeRule).LowerInclusiveSubField;
            _UpperInclusiveSubField = ((CswNbtFieldTypeRuleNumericRange)_FieldTypeRule).UpperInclusiveSubField;
            _UnitsSubField          = ((CswNbtFieldTypeRuleNumericRange)_FieldTypeRule).UnitsSubField;

            // Associate subfields with methods on this object, for SetSubFieldValue()
            _SubFieldMethods.Add(_LowerSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => Lower, x => Lower    = CswConvert.ToDouble(x)));
            _SubFieldMethods.Add(_TargetSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => Target, x => Target = CswConvert.ToDouble(x)));
            _SubFieldMethods.Add(_UpperSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => Upper, x => Upper    = CswConvert.ToDouble(x)));
            _SubFieldMethods.Add(_LowerInclusiveSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => LowerInclusive, x => LowerInclusive = CswConvert.ToBoolean(x)));
            _SubFieldMethods.Add(_UpperInclusiveSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => UpperInclusive, x => UpperInclusive = CswConvert.ToBoolean(x)));
            _SubFieldMethods.Add(_UnitsSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => Units, x => Units = x));
        }
Exemple #28
0
        /// <summary>
        /// Represents the data of a set of checkboxes
        /// </summary>
        public CswNbtNodePropLogicalSet(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node)
            : base(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node)
        {
            if (Empty)
            {
                ResetXml();
            }
            else
            {
                LogicalSetXmlDoc = new XmlDocument();
                LogicalSetXmlDoc.LoadXml(ClobData);
            }

            _ClobDataSubField = ((CswNbtFieldTypeRuleLogicalSet)_FieldTypeRule).ClobDataSubField;

            // Associate subfields with methods on this object, for SetSubFieldValue()
            _SubFieldMethods.Add(_ClobDataSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => LogicalSetXmlDoc, x => setXml(CswConvert.ToString(x))));
        }//ctor
Exemple #29
0
        /// <summary>
        /// Handles when the property value is copied to another node
        /// </summary>
        public void CopyGeneric(CswNbtNodePropData Source)
        {
            // Default, just copy the data values

            CswEnumNbtFieldType  FieldType     = Source.getFieldTypeValue();
            ICswNbtFieldTypeRule FieldTypeRule = _CswNbtResources.MetaData.getFieldTypeRule(FieldType);

            foreach (CswNbtSubField SubField in FieldTypeRule.SubFields)
            {
                if (SubField.Column == CswEnumNbtPropColumn.Field1_FK)
                {
                    //Implementing FieldType specific behavior here. Blame Steve.
                    if (FieldType == CswEnumNbtFieldType.ViewReference)
                    {
                        //we want to copy views to the new node by value, so changes to the view on either node don't affect the other
                        CswNbtView View     = _CswNbtResources.ViewSelect.restoreView(new CswNbtViewId(Source.Field1_Fk));
                        CswNbtView ViewCopy = new CswNbtView(_CswNbtResources);
                        ViewCopy.saveNew(View.ViewName, View.Visibility, View.VisibilityRoleId, View.VisibilityUserId, View);
                        SetSubFieldValue(CswEnumNbtSubFieldName.ViewID, ViewCopy.ViewId);
                    }
                    else
                    {
                        SetSubFieldValue(SubField.Name, Source.Field1_Fk);
                    }
                } // if( SubField.Column == CswEnumNbtPropColumn.Field1_FK )
                else
                {
                    SetSubFieldValue(SubField.Name, Source.GetPropRowValue(SubField));
                }
            } // foreach( CswNbtSubField SubField in NodeTypeProp.getFieldTypeRule().SubFields )

            // Also copy Gestalt, which usually isn't listed as a subfield
            SetSubFieldValue(CswEnumNbtSubFieldName.Gestalt, Source.Gestalt);
            SetSubFieldValue(CswEnumNbtSubFieldName.GestaltSearch, Source.GestaltSearch);

            //Case 31362 - also copy Blob_Data if necessary
            if (Source.getFieldTypeValue() == CswEnumNbtFieldType.MOL || Source.getFieldTypeValue() == CswEnumNbtFieldType.Image || Source.getFieldTypeValue() == CswEnumNbtFieldType.File)
            {
                CswNbtSdBlobData.CopyBlobData(_CswNbtResources, Source.JctNodePropId, JctNodePropId);
            }
        }
Exemple #30
0
        public CswNbtNodePropLocation(CswNbtResources CswNbtResources, CswNbtNodePropData CswNbtNodePropData, CswNbtMetaDataNodeTypeProp CswNbtMetaDataNodeTypeProp, CswNbtNode Node)
            : base(CswNbtResources, CswNbtNodePropData, CswNbtMetaDataNodeTypeProp, Node)
        {
            CswNbtFieldTypeRuleLocation FieldTypeRule = (CswNbtFieldTypeRuleLocation)_FieldTypeRule;

            _NameSubField    = FieldTypeRule.NameSubField;
            _NodeIdSubField  = FieldTypeRule.NodeIdSubField;
            _RowSubField     = FieldTypeRule.RowSubField;
            _ColumnSubField  = FieldTypeRule.ColumnSubField;
            _PathSubField    = FieldTypeRule.PathSubField;
            _BarcodeSubField = FieldTypeRule.BarcodeSubField;

            // Associate subfields with methods on this object, for SetSubFieldValue()
            _SubFieldMethods.Add(_NameSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => CachedNodeName, x => CachedNodeName   = CswConvert.ToString(x)));
            _SubFieldMethods.Add(_NodeIdSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => SelectedNodeId, x => SelectedNodeId = CswConvert.ToPrimaryKey(x)));
            _SubFieldMethods.Add(_RowSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => SelectedRow, x => SelectedRow          = CswConvert.ToInt32(x)));
            _SubFieldMethods.Add(_ColumnSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => SelectedColumn, x => SelectedColumn = CswConvert.ToInt32(x)));
            _SubFieldMethods.Add(_PathSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => CachedPath, x => CachedPath           = CswConvert.ToString(x)));
            _SubFieldMethods.Add(_BarcodeSubField.Name, new Tuple <Func <dynamic>, Action <dynamic> >(() => CachedBarcode, x => CachedBarcode  = CswConvert.ToString(x)));

            _SearchThreshold = CswConvert.ToInt32(_CswNbtResources.ConfigVbls.getConfigVariableValue(CswEnumNbtConfigurationVariables.relationshipoptionlimit.ToString()));
        }