public IBEO this[BEOKey key] { get { foreach (IBEO beo in _List) { if (beo.Key.Equals(key)) { return beo; } } return null; } }
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; }
public object Delete() { if (this.PreDelete()) { _internalKey = Key; _BCO.Delete(_RowIndex); _isDeleted = true; } this.PostDelete(); return true; }
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; }
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; }
public RetrieveContext(string context, BEOKey key, IBEO user) { Context = context; Key = key; User = user; }
public RetrieveContext(string context, BEOKey key) : this(context, key, null) { }
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; }