示例#1
0
 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);
 }
示例#2
0
        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);
        }
示例#3
0
 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;
 }
示例#4
0
 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;
 }