Exemplo n.º 1
0
 private string GetHash(BusinessDocument doc)
 {
     return doc.HashString().ToLower();
 }
Exemplo n.º 2
0
 public void Undelete(BusinessDocument doc)
 {
     if (doc.GetType() != m_SupportedType)
       {
     throw new DocumentNotSupportedException();
       }
       DocumentIndexValue value1 = (DocumentIndexValue) m_IndexList[GetHash(doc)];
       if (value1 == null)
       {
     throw new DocumentNotInContainerException();
       }
       if (value1.State != DocumentState.Deleted)
       {
     throw new DocumentInvalidStateException();
       }
       value1.State = value1.PrevState;
       doc.SetDocumentState(value1.State);
 }
Exemplo n.º 3
0
 public int Insert(BusinessDocument doc)
 {
     return Add(doc, DocumentState.Inserted);
 }
Exemplo n.º 4
0
 public DocumentState GetState(BusinessDocument doc)
 {
     DocumentIndexValue value1 = (DocumentIndexValue) m_IndexList[GetHash(doc)];
       if (value1 == null)
       {
     return DocumentState.Unknown;
       }
       return value1.State;
 }
Exemplo n.º 5
0
 public int Add(BusinessDocument doc, DocumentState iniState)
 {
     if (doc.GetType() != m_SupportedType)
       {
     throw new DocumentNotSupportedException();
       }
       DocumentIndexValue value1 = (DocumentIndexValue) m_IndexList[GetHash(doc)];
       if (value1 != null)
       {
     if (value1.State == DocumentState.Deleted)
     {
       throw new DocumentInvalidStateException();
     }
     throw new ContainerPKViolationException();
       }
       int num1 = m_AllContainer.Add(doc);
       m_IndexList.Add(GetHash(doc), new DocumentIndexValue(num1, iniState, DocumentState.Unknown));
       doc.SetDocumentState(iniState);
       return num1;
 }
Exemplo n.º 6
0
 public int Add(BusinessDocument doc)
 {
     return Add(doc, DocumentState.Unchanged);
 }