private ServerXObjectContainer GetReportInner(Guid _uid, out ServerXObjectContainer _xObject) { if (!m_objects.TryGetValue(_uid, out _xObject)) { using (var st = CreateStorage()) { var descriptor = st.LoadObjectCharacteristics(_uid); _xObject = new ServerXObjectContainer(_uid, descriptor); var records = st.LoadObject(_uid).ToList(); foreach (var record in records) { if (record is StorageChild) { var rt = (StorageChild)record; _xObject.AddChildren(rt.Field, rt.Uid); m_parents[rt.Uid] = _xObject.Uid; } else if (record is IStorageValueInternal) { var val = (IStorageValueInternal)record; _xObject.SetValue(val.Field, val); } else { throw new NotImplementedException(); } } } m_objects.Add(_uid, _xObject); } return(_xObject); }
internal uint AddNew(XReport _report, SessionId _sessionId, Guid _parentUid) { _report.ActualFrom = NextGeneration(); var obj = new ServerXObjectContainer(_report.Kind, _report.Uid); obj.FillFromClient(_report, _sessionId); m_objects.Add(_report.Uid, obj); return(_report.ActualFrom); }
private ServerXObjectContainer GetReportInner(Guid _uid, out ServerXObjectContainer _xObject) { if (!m_objects.TryGetValue(_uid, out _xObject)) { using (var st = CreateStorage()) { var descriptor = st.LoadObjectCharacteristics(_uid); _xObject = new ServerXObjectContainer(_uid, descriptor); var records = st.LoadObject(_uid).ToList(); foreach (var record in records) { if (record is StorageChild) { var rt = (StorageChild) record; _xObject.AddChildren(rt.Field, rt.Uid); m_parents[rt.Uid] = _xObject.Uid; } else if (record is IStorageValueInternal) { var val = (IStorageValueInternal) record; _xObject.SetValue(val.Field, val); } else { throw new NotImplementedException(); } } } m_objects.Add(_uid, _xObject); } return _xObject; }
internal uint AddNew(XReport _report, SessionId _sessionId, Guid _parentUid) { _report.ActualFrom = NextGeneration(); var obj = new ServerXObjectContainer(_report.Kind, _report.Uid); obj.FillFromClient(_report, _sessionId); m_objects.Add(_report.Uid, obj); return _report.ActualFrom; }