Esempio n. 1
0
 public IBEO this[BEOKey key]
 {
     get
     {
         foreach (IBEO beo in _List)
         {
             if (beo.Key.Equals(key))
             {
                 return beo;
             }
         }
         return null;
     }
 }
Esempio n. 2
0
        internal void AttachSource(BCO aBCO, int aRowIndex)
        {
            _BCO = aBCO;
            _RowIndex = aRowIndex;

            RegisterBusinessObject();

            _BCO.Callback += bcoCallback;

            //System.Diagnostics.Debug.WriteLine(String.Format("BEO.AttachSource() {0} {1}", aBCO.TableName, _RowIndex));

            _isDeleted = _BCO.CheckDeleted(_RowIndex);
            _isModified = _BCO.CheckModified(_RowIndex);
            _isNew = _BCO.CheckAdded(_RowIndex);

            _internalKey = Key;
        }
Esempio n. 3
0
 public object Delete()
 {
     if (this.PreDelete())
     {
         _internalKey = Key;
         _BCO.Delete(_RowIndex);
         _isDeleted = true;
     }
     this.PostDelete();
     return true;
 }
Esempio n. 4
0
        public bool SetSourceValue(string aPropertyName, object aValue)
        {
            _isModified = true;
            bool ret = _BCO.SetSourceValue(_RowIndex, aPropertyName, aValue);
            PropertyDef def = _BCO.Properties.GetWithPropertyName(aPropertyName);

            if (def == null)
                throw new NullReferenceException("PropertyDef is null");

            if (def.KeyType == KeyType.PrimaryKey)
            {
                _internalKey = Key;
            }
            return ret;
        }
Esempio n. 5
0
        public object Save()
        {
            object ret = null;
            if (this.Validate() && this.PreSave())
            {
                if (!_isDeleted)
                    _internalKey = Key;
                ret = _BCO.Save();

                _isModified = false;
                _isNew = false;

                this.PostSave();
            }
            return ret;
        }
Esempio n. 6
0
 public RetrieveContext(string context, BEOKey key, IBEO user)
 {
     Context = context;
     Key = key;
     User = user;
 }
Esempio n. 7
0
 public RetrieveContext(string context, BEOKey key)
     : this(context, key, null)
 {
 }
Esempio n. 8
0
        public bool Equals(BEOKey key)
        {
            if (key.Count != this.Count)
                return false;

            var myCols = this.GetEnumerator();
            var extCols = key.GetEnumerator();

            while (myCols.MoveNext() && extCols.MoveNext())
            {
                if (!compare(myCols.Current, extCols.Current))
                    return false;
            }
            return true;
        }